diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/AtomikIcon.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/AtomikIcon.kt new file mode 100644 index 00000000..30d60c9a --- /dev/null +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/AtomikIcon.kt @@ -0,0 +1,23 @@ +package com.kevinschildhorn.fotopresenter.ui.screens.common.composables + +import androidx.compose.material.Icon +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.ImageVector +import com.kevinschildhorn.atomik.atomic.atoms.interfaces.TextAtom +import com.kevinschildhorn.atomik.color.base.composeColor + +@Composable +fun AtomikIcon( + imageVector: ImageVector, + atom: TextAtom, + modifier: Modifier = Modifier, + contentDescription: String +) { + Icon( + imageVector = imageVector, + contentDescription = contentDescription, + tint = atom.textColor.composeColor, + modifier = modifier, + ) +} \ No newline at end of file diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/AtomikText.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/AtomikText.kt index 6e5eecd4..64ddc51f 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/AtomikText.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/AtomikText.kt @@ -3,12 +3,12 @@ package com.kevinschildhorn.fotopresenter.ui.screens.common.composables import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import com.kevinschildhorn.atomik.atomic.atoms.interfaces.SimpleTextAtom +import com.kevinschildhorn.atomik.atomic.atoms.interfaces.TextAtom import com.kevinschildhorn.atomik.atomic.atoms.textStyle import com.kevinschildhorn.atomik.color.base.composeColor @Composable -fun AtomikText(text: String, atom: SimpleTextAtom, modifier: Modifier = Modifier) { +fun AtomikText(text: String, atom: TextAtom, modifier: Modifier = Modifier) { Text( text, style = atom.textStyle, diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/ErrorView.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/ErrorView.kt index 518e304b..444ef6f3 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/ErrorView.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/ErrorView.kt @@ -30,10 +30,6 @@ fun ErrorView( vertical = atom.paddingVertical?.dp ?: 0.dp, ).fillMaxWidth(), ) { - Text( - text = message, - color = atom.textColor.composeColor, - style = atom.textStyle, - ) + AtomikText(message,atom) } } diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/TitleView.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/TitleView.kt index 9afc7b4d..de287166 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/TitleView.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/common/composables/TitleView.kt @@ -14,11 +14,5 @@ fun TitleView( modifier: Modifier = Modifier, ) { val atom = title(typography = FotoTypography.h3) - - Text( - text = value, - color = atom.textColor.composeColor, - style = atom.textStyle, - modifier = modifier, - ) + AtomikText(value, atom, modifier) } diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/playlist/composables/PlaylistColumn.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/playlist/composables/PlaylistColumn.kt index ebc34458..38a3e11c 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/playlist/composables/PlaylistColumn.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/playlist/composables/PlaylistColumn.kt @@ -21,6 +21,7 @@ import com.kevinschildhorn.atomik.atomic.atoms.textStyle import com.kevinschildhorn.atomik.color.base.composeColor import com.kevinschildhorn.fotopresenter.Playlist import com.kevinschildhorn.fotopresenter.ui.atoms.FotoColors +import com.kevinschildhorn.fotopresenter.ui.screens.common.composables.AtomikText import com.kevinschildhorn.fotopresenter.ui.screens.playlist.PlaylistScreenAtoms @Composable @@ -40,9 +41,9 @@ fun PlaylistColumn( .background(FotoColors.secondary.composeColor) ) { Column(Modifier.fillMaxWidth().padding(Padding.MEDIUM.dp)) { - Text( + AtomikText( "Playlists", - style = atom.textStyle + atom = atom ) LazyColumn { items(options) { diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/playlist/composables/PlaylistScreenCreateRow.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/playlist/composables/PlaylistScreenCreateRow.kt index 74e358f3..3f6746ae 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/playlist/composables/PlaylistScreenCreateRow.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/playlist/composables/PlaylistScreenCreateRow.kt @@ -15,6 +15,8 @@ import androidx.compose.ui.unit.dp import com.kevinschildhorn.atomik.atomic.atoms.textStyle import com.kevinschildhorn.atomik.color.base.composeColor import com.kevinschildhorn.fotopresenter.ui.atoms.Padding +import com.kevinschildhorn.fotopresenter.ui.screens.common.composables.AtomikIcon +import com.kevinschildhorn.fotopresenter.ui.screens.common.composables.AtomikText import com.kevinschildhorn.fotopresenter.ui.screens.playlist.PlaylistScreenAtoms import compose.icons.EvaIcons import compose.icons.evaicons.Outline @@ -34,17 +36,13 @@ fun PlaylistScreenCreateRow( modifier = Modifier.fillMaxWidth(), onClick = onClick ) { - Icon( + AtomikIcon( EvaIcons.Outline.PlusCircle, - tint = atom.textColor.composeColor, + atom, contentDescription = "Create", ) Spacer(Modifier.width(Padding.SMALL.dp)) - Text( - text = "Create", - color = atom.textColor.composeColor, - style = atom.textStyle, - ) + AtomikText("Create", atom) Spacer(Modifier.fillMaxWidth()) } } diff --git a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/playlist/composables/PlaylistScreenPlaylistRow.kt b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/playlist/composables/PlaylistScreenPlaylistRow.kt index 737f01be..83aff0dd 100644 --- a/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/playlist/composables/PlaylistScreenPlaylistRow.kt +++ b/shared/src/commonMain/kotlin/com/kevinschildhorn/fotopresenter/ui/screens/playlist/composables/PlaylistScreenPlaylistRow.kt @@ -17,6 +17,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import com.kevinschildhorn.atomik.atomic.atoms.textStyle import com.kevinschildhorn.atomik.color.base.composeColor +import com.kevinschildhorn.fotopresenter.ui.screens.common.composables.AtomikIcon +import com.kevinschildhorn.fotopresenter.ui.screens.common.composables.AtomikText import com.kevinschildhorn.fotopresenter.ui.screens.playlist.PlaylistScreenAtoms import compose.icons.EvaIcons import compose.icons.evaicons.Outline @@ -40,11 +42,7 @@ fun PlaylistScreenPlaylistRow( onClick = onClick, modifier = Modifier.fillMaxSize(0.7f) ) { - Text( - text = title, - color = atom.textColor.composeColor, - style = atom.textStyle, - ) + AtomikText(title, atom) Spacer(Modifier.fillMaxWidth()) } Row(modifier = Modifier.fillMaxHeight()) { @@ -52,9 +50,9 @@ fun PlaylistScreenPlaylistRow( modifier = Modifier.width(44.dp), onClick = onEdit ) { - Icon( + AtomikIcon( EvaIcons.Outline.Edit, - tint = atom.textColor.composeColor, + atom, contentDescription = "Edit", ) } @@ -62,9 +60,9 @@ fun PlaylistScreenPlaylistRow( modifier = Modifier.width(44.dp), onClick = onDelete, ) { - Icon( + AtomikIcon( EvaIcons.Outline.Trash, - tint = atom.textColor.composeColor, + atom, contentDescription = "Trash" ) }