Skip to content

Commit

Permalink
Previous commits
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Sep 3, 2024
1 parent 9828e54 commit 9ebf95c
Show file tree
Hide file tree
Showing 57 changed files with 523 additions and 420 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/rebase-default-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# GitHub Actions Virtual Environments
# https://github.com/actions/virtual-environments/

# Rebases a pull request on the repo's default branch when the "rebase" label is added
# Note: you'll need to add a personal access token to your repo, `PERSONAL_ACCESS_TOKEN`. (`REBASE_PR_TOKEN`)
# Link: https://github.com/jessesquires/gh-workflows/blob/main/.github/workflows/rebase-default-branch.yml

name: Rebase Pull Request

on:
pull_request:
types: [ labeled ]

env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}

jobs:
main:
if: ${{ contains(github.event.*.labels.*.name, 'rebase') }}
name: Rebase
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.REBASE_PR_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

# Link: https://httgp.com/signing-commits-in-github-actions/
- name: Import bot's GPG key for signing commits
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.BOT_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.BOT_GPG_PASSPHRASE }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true

- name: perform rebase
run: |
git config --global user.email "[email protected]"
git status
git pull
git checkout "$DEFAULT_BRANCH"
git status
git pull
git checkout "$GITHUB_HEAD_REF"
git rebase "$DEFAULT_BRANCH"
git push --force-with-lease
git status
# Link: https://github.com/marketplace/actions/actions-ecosystem-remove-labels
- name: remove label
if: always()
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: rebase
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.icons.app.Camera
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons
import com.infomaniak.swisstransfer.ui.images.icons.Camera
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun BottomStickyButtonScaffold(
.fillMaxWidth()
.padding(contentPaddings)
) {
Box(modifier = Modifier.weight(1f), content = content)
Box(modifier = Modifier.weight(1.0f), content = content)
DoubleButtonCombo(topButton, bottomButton)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.icons.illu.LogoInfomaniak
import com.infomaniak.swisstransfer.ui.icons.illu.LogoSwissTransfer
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus
import com.infomaniak.swisstransfer.ui.images.illus.LogoInfomaniak
import com.infomaniak.swisstransfer.ui.images.illus.LogoSwissTransfer
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
import com.infomaniak.swisstransfer.ui.utils.PreviewMobile
Expand All @@ -46,11 +46,11 @@ fun BrandTobAppBar() {
),
title = {
Row(verticalAlignment = Alignment.CenterVertically) {
Image(imageVector = AppIcons.Illu.LogoInfomaniak, contentDescription = null)
Image(imageVector = AppIllus.LogoInfomaniak, contentDescription = null)
Spacer(modifier = Modifier.width(Margin.Medium))
VerticalDivider(modifier = Modifier.height(Margin.Large), color = SwissTransferTheme.colors.toolbarTextColor)
Spacer(modifier = Modifier.width(Margin.Medium))
Image(imageVector = AppIcons.Illu.LogoSwissTransfer, contentDescription = null)
Image(imageVector = AppIllus.LogoSwissTransfer, contentDescription = null)
Spacer(modifier = Modifier.width(Margin.Small))
Text(text = stringResource(id = R.string.appName), color = SwissTransferTheme.colors.toolbarTextColor)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,45 +30,45 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.icons.app.Add
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons
import com.infomaniak.swisstransfer.ui.images.icons.Add
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.Shapes
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme

@Composable
fun LargeButton(
modifier: Modifier = Modifier,
@StringRes titleRes: Int,
modifier: Modifier = Modifier,
style: ButtonType = ButtonType.PRIMARY,
enabled: Boolean = true,
onClick: () -> Unit,
imageVector: ImageVector? = null,
) {
CoreButton(modifier, ButtonSize.LARGE, style, enabled, onClick, imageVector, titleRes)
CoreButton(titleRes, modifier, ButtonSize.LARGE, style, enabled, onClick, imageVector)
}

@Composable
fun SmallButton(
modifier: Modifier = Modifier,
@StringRes titleRes: Int,
modifier: Modifier = Modifier,
style: ButtonType = ButtonType.PRIMARY,
enabled: Boolean = true,
onClick: () -> Unit,
imageVector: ImageVector? = null,
) {
CoreButton(modifier, ButtonSize.SMALL, style, enabled, onClick, imageVector, titleRes)
CoreButton(titleRes, modifier, ButtonSize.SMALL, style, enabled, onClick, imageVector)
}

@Composable
private fun CoreButton(
@StringRes titleRes: Int,
modifier: Modifier,
buttonSize: ButtonSize,
style: ButtonType,
enabled: Boolean,
onClick: () -> Unit,
imageVector: ImageVector?,
titleRes: Int
) {
Button(
modifier = modifier.height(buttonSize.height),
Expand Down Expand Up @@ -113,7 +113,8 @@ enum class ButtonType(val buttonColors: @Composable () -> ButtonColors) {
}

private enum class ButtonSize(val height: Dp) {
LARGE(56.dp), SMALL(40.dp)
LARGE(56.dp),
SMALL(40.dp),
}

@Preview(name = "Light")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ private fun HorizontallyStackedButtons(
horizontalArrangement = Arrangement.spacedBy(Margin.Medium),
verticalAlignment = Alignment.CenterVertically,
) {
topButton(Modifier.weight(1f))
bottomButton(Modifier.weight(1f))
topButton(Modifier.weight(1.0f))
bottomButton(Modifier.weight(1.0f))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.icons.illu.ArrowCurvedDownright
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIllus
import com.infomaniak.swisstransfer.ui.images.illus.ArrowCurvedDownright
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme

Expand Down Expand Up @@ -115,7 +115,7 @@ private fun BottomSheetDefaultsPreview() {
SwissTransferTheme {
Surface {
BottomSheetContent(
imageVector = AppIcons.Illu.ArrowCurvedDownright,
imageVector = AppIllus.ArrowCurvedDownright,
titleRes = R.string.appName,
descriptionRes = R.string.sentEmptyTitle,
content = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.icons.app.Add
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons
import com.infomaniak.swisstransfer.ui.images.icons.Add
import com.infomaniak.swisstransfer.ui.theme.Margin
import com.infomaniak.swisstransfer.ui.theme.Shapes
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import androidx.compose.runtime.Immutable
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import com.infomaniak.swisstransfer.R
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.icons.app.Add
import com.infomaniak.swisstransfer.ui.icons.app.ArrowLeft
import com.infomaniak.swisstransfer.ui.icons.app.Cross
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons
import com.infomaniak.swisstransfer.ui.images.icons.Add
import com.infomaniak.swisstransfer.ui.images.icons.ArrowLeft
import com.infomaniak.swisstransfer.ui.images.icons.Cross
import com.infomaniak.swisstransfer.ui.theme.SwissTransferTheme
import com.infomaniak.swisstransfer.ui.utils.PreviewMobile
import com.infomaniak.swisstransfer.ui.utils.PreviewTablet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,17 @@ fun <T> TwoPaneScaffold(
val navigator = rememberListDetailPaneScaffoldNavigator<T>(
scaffoldDirective = paneScaffoldDirective.copy(
maxHorizontalPartitions = maxHorizontalPartitions,
horizontalPartitionSpacerSize = 0.dp
)
horizontalPartitionSpacerSize = 0.dp,
),
)

BackHandler(navigator.canNavigateBack()) {
navigator.navigateBack()
}
BackHandler(navigator.canNavigateBack()) { navigator.navigateBack() }

ListDetailPaneScaffold(
directive = navigator.scaffoldDirective,
value = navigator.scaffoldValue,
listPane = {
AnimatedPane {
navigator.listPane()
}
},
detailPane = {
AnimatedPane {
navigator.detailPane()
}
},
listPane = { AnimatedPane { navigator.listPane() } },
detailPane = { AnimatedPane { navigator.detailPane() } },
modifier = modifier,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.infomaniak.swisstransfer.ui.icons
package com.infomaniak.swisstransfer.ui.images

import androidx.compose.ui.unit.dp

object AppIcons {
object Illu
object AppImages {
object AppIcons
object AppIllus

val previewSize = 250.dp
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.infomaniak.swisstransfer.ui.icons.app
package com.infomaniak.swisstransfer.ui.images.icons

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
Expand All @@ -16,19 +16,19 @@ import androidx.compose.ui.graphics.vector.group
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.infomaniak.swisstransfer.ui.icons.AppIcons
import com.infomaniak.swisstransfer.ui.images.AppImages
import com.infomaniak.swisstransfer.ui.images.AppImages.AppIcons

val AppIcons.Add: ImageVector
get() {
if (_add != null) {
return _add!!
}
if (_add != null) return _add!!

_add = Builder(
name = "Add",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f
viewportHeight = 24.0f,
).apply {
group {
path(
Expand All @@ -38,7 +38,7 @@ val AppIcons.Add: ImageVector
strokeLineCap = Round,
strokeLineJoin = StrokeJoin.Round,
strokeLineMiter = 4.0f,
pathFillType = NonZero
pathFillType = NonZero,
) {
moveTo(1.5f, 12.0f)
horizontalLineToRelative(21.0f)
Expand All @@ -47,6 +47,7 @@ val AppIcons.Add: ImageVector
}
}
}.build()

return _add!!
}

Expand All @@ -59,7 +60,7 @@ private fun Preview() {
Image(
imageVector = AppIcons.Add,
contentDescription = null,
modifier = Modifier.size(AppIcons.previewSize)
modifier = Modifier.size(AppImages.previewSize),
)
}
}
Loading

0 comments on commit 9ebf95c

Please sign in to comment.