Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Commit

Permalink
chore: made publishable
Browse files Browse the repository at this point in the history
  • Loading branch information
charlee-dev committed Jun 30, 2024
1 parent c93e7a0 commit 7a07f3a
Show file tree
Hide file tree
Showing 44 changed files with 225 additions and 268 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
IMAGE_TAG: ${{ github.sha }}

steps:
- name: Checkout code
Expand All @@ -25,23 +32,20 @@ jobs:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
aws-access-key-id: $AWS_ACCESS_KEY_ID
aws-secret-access-key: $AWS_SECRET_ACCESS_KEY
aws-region: $AWS_REGION

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2

- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
- name: Update App Runner image in AWS
run: |
echo $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
aws apprunner create-service --service-name benatty-shop-web-client --source-configuration '{"ImageRepository": {"ImageIdentifier": "'"$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"'", "ImageRepositoryType": "ECR"}}'
4 changes: 2 additions & 2 deletions apps/admin/web/src/jsMain/kotlin/AppEntry.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package web

import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import com.varabyte.kobweb.compose.css.CSSTransition
import com.varabyte.kobweb.compose.css.ScrollBehavior
import com.varabyte.kobweb.compose.css.Transition
import com.varabyte.kobweb.compose.css.TransitionTimingFunction
import com.varabyte.kobweb.compose.foundation.layout.Box
import com.varabyte.kobweb.compose.ui.Modifier
Expand Down Expand Up @@ -55,7 +55,7 @@ fun AppEntry(content: @Composable () -> Unit) {
.minHeight(100.vh)
.scrollBehavior(ScrollBehavior.Smooth)
.backgroundColor(colorMode.toPalette().background)
.transition(CSSTransition("background-color", 0.3.s, TransitionTimingFunction.Ease))
.transition(Transition.of("background-color", 0.3.s, TransitionTimingFunction.Ease))
) {
content()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import com.varabyte.kobweb.compose.css.CSSTransition
import com.varabyte.kobweb.compose.css.Cursor
import com.varabyte.kobweb.compose.css.TextOverflow
import com.varabyte.kobweb.compose.css.Transition
import com.varabyte.kobweb.compose.css.TransitionTimingFunction
import com.varabyte.kobweb.compose.foundation.layout.Box
import com.varabyte.kobweb.compose.foundation.layout.Row
Expand Down Expand Up @@ -86,8 +86,8 @@ fun SideNavMainItem(
// .backgroundColor(bgColor)
// .color(contentColor)
.transition(
CSSTransition("background-color", 0.3.s, TransitionTimingFunction.Ease),
CSSTransition("color", 0.3.s, TransitionTimingFunction.Ease)
Transition.of("background-color", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("color", 0.3.s, TransitionTimingFunction.Ease)
)
.tabIndex(0)
.onEnterKeyDown(onMenuItemClicked)
Expand Down Expand Up @@ -129,7 +129,7 @@ fun SideNavSubItem(
.onClick { onMenuItemClicked() }
.onMouseEnter { hovered = true }
.onMouseLeave { hovered = false }
.transition(CSSTransition("background-color", 0.3.s, TransitionTimingFunction.Ease))
.transition(Transition.of("background-color", 0.3.s, TransitionTimingFunction.Ease))
.cursor(Cursor.Pointer)
.tabIndex(0)
) {
Expand All @@ -149,8 +149,8 @@ fun SideNavSubItem(
.opacity(if (isSubCurrent) 1f else 0f)
.translateX(if (isSubCurrent) 0.em else (-0.5).em)
.transition(
CSSTransition("opacity", 0.3.s, TransitionTimingFunction.Ease),
CSSTransition("translate", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("opacity", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("translate", 0.3.s, TransitionTimingFunction.Ease),
)
)
SpanText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import com.copperleaf.ballast.navigation.routing.RouterContract
import com.varabyte.kobweb.compose.css.AlignItems
import com.varabyte.kobweb.compose.css.CSSTransition
import com.varabyte.kobweb.compose.css.Transition
import com.varabyte.kobweb.compose.css.TransitionTimingFunction
import com.varabyte.kobweb.compose.css.UserSelect
import com.varabyte.kobweb.compose.foundation.layout.Box
Expand Down Expand Up @@ -131,7 +131,7 @@ fun AdminLayout(
.alignItems(AlignItems.Center)
.minWidth(0.px)
.zIndex(1)
.transition(CSSTransition("background-color", 0.3.s, TransitionTimingFunction.EaseInOut))
.transition(Transition.of("background-color", 0.3.s, TransitionTimingFunction.EaseInOut))
) {
content()
}
Expand Down Expand Up @@ -371,7 +371,7 @@ private fun SearchBar(
.align(Alignment.CenterStart)
.userSelect(UserSelect.None)
.margin(left = 0.5.em)
.transition(CSSTransition("color", 0.3.s, TransitionTimingFunction.EaseInOut))
.transition(Transition.of("color", 0.3.s, TransitionTimingFunction.EaseInOut))
)

TextInput(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import com.varabyte.kobweb.compose.css.AlignItems
import com.varabyte.kobweb.compose.css.CSSTransition
import com.varabyte.kobweb.compose.css.Transition
import com.varabyte.kobweb.compose.css.TransitionTimingFunction
import com.varabyte.kobweb.compose.foundation.layout.Arrangement
import com.varabyte.kobweb.compose.foundation.layout.Box
Expand Down Expand Up @@ -155,7 +155,7 @@ fun NavTopSection(
.opacity(subOpacity)
.onMouseOver { subHovered = true }
.onMouseOut { subHovered = false }
.transition(CSSTransition("opacity", 0.3.s, TransitionTimingFunction.Ease))
.transition(Transition.of("opacity", 0.3.s, TransitionTimingFunction.Ease))
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import com.varabyte.kobweb.compose.css.CSSTransition
import com.varabyte.kobweb.compose.css.Cursor
import com.varabyte.kobweb.compose.css.ObjectFit
import com.varabyte.kobweb.compose.css.Transition
import com.varabyte.kobweb.compose.css.TransitionTimingFunction
import com.varabyte.kobweb.compose.css.UserSelect
import com.varabyte.kobweb.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -253,8 +253,8 @@ fun Item(
.onClick { vm.trySend(AdminListContract.Inputs.Click.Item(item.id)) }
.cursor(Cursor.Pointer)
.transition(
CSSTransition("background-color", 0.3.s, TransitionTimingFunction.Ease),
CSSTransition("color", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("background-color", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("color", 0.3.s, TransitionTimingFunction.Ease),
)
) {
when (state.dataType) {
Expand Down Expand Up @@ -312,7 +312,7 @@ private fun MiniImage(url: String) {
.onMouseLeave { hovered = false }
// .overflow(Overflow.Hidden)
.scale(if (hovered) 4 else 1.0)
.transition(CSSTransition("scale", 0.3.s, TransitionTimingFunction.Ease))
.transition(Transition.of("scale", 0.3.s, TransitionTimingFunction.Ease))
)
}

Expand All @@ -339,7 +339,7 @@ private fun TopBarItem(
.cursor(Cursor.Pointer)
.onMouseEnter { hovered = true }
.onMouseLeave { hovered = false }
.transition(CSSTransition("color", 0.3.s, TransitionTimingFunction.Ease))
.transition(Transition.of("color", 0.3.s, TransitionTimingFunction.Ease))
}
) {
SpanText(text)
Expand All @@ -350,9 +350,9 @@ private fun TopBarItem(
.opacity(if (isSelected) 1.0 else 0.0)
.rotateZ(if (sortDirection == SortDirection.ASC) 0.deg else 180.deg)
.transition(
CSSTransition("opacity", 0.3.s, TransitionTimingFunction.Ease),
CSSTransition("rotate", 0.3.s, TransitionTimingFunction.Ease),
CSSTransition("scale", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("opacity", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("rotate", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("scale", 0.3.s, TransitionTimingFunction.Ease),
)
)
}
Expand Down
8 changes: 4 additions & 4 deletions apps/admin/web/src/jsMain/kotlin/components/widgets/Button.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import com.varabyte.kobweb.compose.css.CSSTransition
import com.varabyte.kobweb.compose.css.Cursor
import com.varabyte.kobweb.compose.css.FontWeight
import com.varabyte.kobweb.compose.css.TextDecorationLine
import com.varabyte.kobweb.compose.css.TextTransform
import com.varabyte.kobweb.compose.css.Transition
import com.varabyte.kobweb.compose.css.TransitionTimingFunction
import com.varabyte.kobweb.compose.css.WhiteSpace
import com.varabyte.kobweb.compose.foundation.layout.Box
Expand Down Expand Up @@ -140,7 +140,7 @@ fun AppTextButton(
.onFocusIn { hovered = true }
.onFocusOut { hovered = false }
.textDecorationLine(if (hovered) TextDecorationLine.Underline else TextDecorationLine.None)
.transition(CSSTransition("text-decoration-line", 0.3.s, TransitionTimingFunction.Ease))
.transition(Transition.of("text-decoration-line", 0.3.s, TransitionTimingFunction.Ease))
)
.toAttrs(),
) {
Expand Down Expand Up @@ -245,7 +245,7 @@ fun TextLink(
.tabIndex(0)
.onEnterKeyDown { if (enabled) onClick() }
.opacity(if (enabled) 1.0 else 0.6)
.transition(CSSTransition("opacity", 0.3.s, TransitionTimingFunction.Ease))
.transition(Transition.of("opacity", 0.3.s, TransitionTimingFunction.Ease))
) {
SpanText(
text = text.uppercase(),
Expand All @@ -260,7 +260,7 @@ fun TextLink(
.height(2.px)
.fillMaxWidth(if (hovered && enabled) 100.percent else 0.percent)
.backgroundColor(color)
.transition(CSSTransition("width", 0.3.s, TransitionTimingFunction.Ease))
.transition(Transition.of("width", 0.3.s, TransitionTimingFunction.Ease))
)
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package web.components.widgets

import androidx.compose.runtime.Composable
import com.varabyte.kobweb.compose.css.CSSTransition
import com.varabyte.kobweb.compose.css.Cursor
import com.varabyte.kobweb.compose.css.Transition
import com.varabyte.kobweb.compose.css.TransitionTimingFunction
import com.varabyte.kobweb.compose.foundation.layout.Column
import com.varabyte.kobweb.compose.foundation.layout.Row
Expand Down Expand Up @@ -49,7 +49,7 @@ fun CheckboxSection(
text = title,
modifier = Modifier
.opacity(opacity)
.transition(CSSTransition("opacity", 0.3.s, TransitionTimingFunction.Ease))
.transition(Transition.of("opacity", 0.3.s, TransitionTimingFunction.Ease))
)
}
errorText?.let {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package web.components.widgets

import androidx.compose.runtime.Composable
import com.varabyte.kobweb.compose.css.CSSTransition
import com.varabyte.kobweb.compose.css.ObjectFit
import com.varabyte.kobweb.compose.css.Transition
import com.varabyte.kobweb.compose.css.TransitionTimingFunction
import com.varabyte.kobweb.compose.foundation.layout.Box
import com.varabyte.kobweb.compose.foundation.layout.Column
Expand Down Expand Up @@ -60,16 +60,16 @@ fun ImagePreviewDialog(
.backgroundColor(ColorMode.current.toPalette().color)
.opacity(if (open) 0.7 else 0.0)
.onClick { onClose() }
.transition(CSSTransition("opacity", 0.3.s, TransitionTimingFunction.Ease)),
.transition(Transition.of("opacity", 0.3.s, TransitionTimingFunction.Ease)),
)
AppFilledCard(
modifier = Modifier
.fillMaxSize(70.percent)
.opacity(if (open) 1.0 else 0.0)
.scaleY(if (open) 1.0 else 0.5)
.transition(
CSSTransition("opacity", 0.3.s, TransitionTimingFunction.Ease),
CSSTransition("scale", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("opacity", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("scale", 0.3.s, TransitionTimingFunction.Ease),
),
) {
Column(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import com.varabyte.kobweb.compose.css.CSSTransition
import com.varabyte.kobweb.compose.css.FontWeight
import com.varabyte.kobweb.compose.css.PointerEvents
import com.varabyte.kobweb.compose.css.Transition
import com.varabyte.kobweb.compose.css.TransitionTimingFunction
import com.varabyte.kobweb.compose.css.UserSelect
import com.varabyte.kobweb.compose.foundation.layout.Box
Expand Down Expand Up @@ -102,8 +102,8 @@ fun HasChangesWidget(
style = LineStyle.Solid,
)
.transition(
CSSTransition("translate", 0.15.s, TransitionTimingFunction.Ease),
CSSTransition("opacity", 0.15.s, TransitionTimingFunction.Ease),
Transition.of("translate", 0.15.s, TransitionTimingFunction.Ease),
Transition.of("opacity", 0.15.s, TransitionTimingFunction.Ease),
)
) {
Row(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import com.varabyte.kobweb.compose.css.CSSTransition
import com.varabyte.kobweb.compose.css.Cursor
import com.varabyte.kobweb.compose.css.FontWeight
import com.varabyte.kobweb.compose.css.Transition
import com.varabyte.kobweb.compose.css.TransitionTimingFunction
import com.varabyte.kobweb.compose.ui.Modifier
import com.varabyte.kobweb.compose.ui.graphics.Color
Expand Down Expand Up @@ -67,8 +67,8 @@ fun AppIconButton(
.scale(if (hovered) 1.1f else 1f)
.fontWeight(FontWeight.Lighter)
.transition(
CSSTransition("opacity", 0.3.s, TransitionTimingFunction.Ease),
CSSTransition("scale", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("opacity", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("scale", 0.3.s, TransitionTimingFunction.Ease),
)
)
.thenIf(!enabled, Modifier.opacity(0.6f))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package web.components.widgets

import androidx.compose.runtime.Composable
import com.varabyte.kobweb.compose.css.CSSTransition
import com.varabyte.kobweb.compose.css.FontWeight
import com.varabyte.kobweb.compose.css.Transition
import com.varabyte.kobweb.compose.css.TransitionTimingFunction
import com.varabyte.kobweb.compose.css.UserSelect
import com.varabyte.kobweb.compose.ui.Modifier
Expand Down Expand Up @@ -35,8 +35,8 @@ fun RotatableChevron(
.userSelect(UserSelect.None)
.draggable(false)
.transition(
CSSTransition("rotate", 0.3.s, TransitionTimingFunction.Ease),
CSSTransition("color", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("rotate", 0.3.s, TransitionTimingFunction.Ease),
Transition.of("color", 0.3.s, TransitionTimingFunction.Ease),
)
)
}
8 changes: 4 additions & 4 deletions apps/admin/web/src/jsMain/kotlin/components/widgets/Keys.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package web.components.widgets

import androidx.compose.runtime.Composable
import com.varabyte.kobweb.compose.css.CSSTransition
import com.varabyte.kobweb.compose.css.Transition
import com.varabyte.kobweb.compose.css.TransitionTimingFunction
import com.varabyte.kobweb.compose.foundation.layout.Row
import com.varabyte.kobweb.compose.ui.Alignment
Expand All @@ -23,7 +23,7 @@ fun TrailingIconGoToNextOrSubmit(show: Boolean) {
.gap(0.25.em)
.opacity(if (show) 0.6 else 0)
.transition(
CSSTransition("opacity", 0.3.s, TransitionTimingFunction.EaseInOut)
Transition.of("opacity", 0.3.s, TransitionTimingFunction.EaseInOut)
)
) {
MdiKeyboardTab()
Expand All @@ -43,7 +43,7 @@ fun TrailingIconGoToNext(show: Boolean) {
modifier = Modifier
.opacity(if (show) 0.6 else 0)
.transition(
CSSTransition("opacity", 0.3.s, TransitionTimingFunction.EaseInOut)
Transition.of("opacity", 0.3.s, TransitionTimingFunction.EaseInOut)
)
)
}
Expand All @@ -54,7 +54,7 @@ fun TrailingIconSubmit(show: Boolean) {
modifier = Modifier
.opacity(if (show) 0.6 else 0)
.transition(
CSSTransition("opacity", 0.3.s, TransitionTimingFunction.EaseInOut)
Transition.of("opacity", 0.3.s, TransitionTimingFunction.EaseInOut)
)
)
}
Loading

0 comments on commit 7a07f3a

Please sign in to comment.