Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.amsterdam.ui.components.appBar

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.height
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
Expand Down Expand Up @@ -41,13 +44,15 @@ fun DefaultAppBar(
title =
title.takeIf { it.isNotBlank() }?.let { text ->
{
Text(
text = text,
color = AppTheme.color.title,
style = AppTheme.textStyle.title.large,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
Box(Modifier.height(40.dp), contentAlignment = Alignment.Center) {
Text(
text = text,
color = AppTheme.color.title,
style = AppTheme.textStyle.title.large,
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
}
}
},
leadingIcon =
Expand Down Expand Up @@ -102,3 +107,15 @@ private fun DefaultAppBarPreview() {
)
}
}

@ThemeAndLocalePreviews
@Composable
private fun DefaultAppBaarPreview() {
AflamiTheme {
DefaultAppBar(
title = stringResource(R.string.my_account),
containerColor = AppTheme.color.surface,
showNavigateBackButton = false
)
}
}