diff --git a/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/LessonContent.kt b/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/LessonContent.kt index a7b82b0..4154930 100644 --- a/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/LessonContent.kt +++ b/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/LessonContent.kt @@ -21,6 +21,9 @@ import ui.screen.lesson.composable.item.QuestionLessonItem import ui.screen.lesson.composable.item.SoundLessonItem import ui.screen.lesson.composable.item.TextLessonItem +val ItemSpacing = 12.dp +val ItemSpacingBig = 16.dp + @Composable fun LessonContent( viewState: LessonViewState, diff --git a/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/ImageLessonItem.kt b/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/ImageLessonItem.kt index 3aa2da5..9026ecd 100644 --- a/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/ImageLessonItem.kt +++ b/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/ImageLessonItem.kt @@ -9,6 +9,7 @@ import androidx.compose.ui.unit.dp import io.kamel.image.KamelImage import io.kamel.image.asyncPainterResource import ui.screen.lesson.ImageItemViewState +import ui.screen.lesson.composable.ItemSpacing @Composable fun ImageLessonItem( @@ -16,7 +17,7 @@ fun ImageLessonItem( modifier: Modifier = Modifier, ) { KamelImage( - modifier = modifier.padding(top = 12.dp) + modifier = modifier.padding(top = ItemSpacing) .clip(RoundedCornerShape(16.dp)), resource = asyncPainterResource(viewState.imageUrl), contentDescription = null diff --git a/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/QuestionLessonItem.kt b/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/QuestionLessonItem.kt index 3c4ae36..e0748f0 100644 --- a/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/QuestionLessonItem.kt +++ b/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/QuestionLessonItem.kt @@ -17,6 +17,7 @@ import component.text.SubTitle import ui.screen.lesson.AnswerViewState import ui.screen.lesson.QuestionItemViewState import ui.screen.lesson.QuestionTypeViewState +import ui.screen.lesson.composable.ItemSpacingBig import ui.theme.Green import ui.theme.Red @@ -28,7 +29,7 @@ fun QuestionLessonItem( onCheckClick: (List) -> Unit ) { Card( - modifier = modifier.padding(top = 12.dp), + modifier = modifier.padding(top = ItemSpacingBig), shape = RoundedCornerShape(16.dp), elevation = 4.dp ) { diff --git a/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/SoundLessonItem.kt b/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/SoundLessonItem.kt index afc54f3..ab61632 100644 --- a/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/SoundLessonItem.kt +++ b/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/SoundLessonItem.kt @@ -5,9 +5,9 @@ import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.PlayArrow import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp import component.button.SecondaryButton import ui.screen.lesson.SoundItemViewState +import ui.screen.lesson.composable.ItemSpacing @Composable fun SoundLessonItem( @@ -16,7 +16,7 @@ fun SoundLessonItem( modifier: Modifier = Modifier, ) { SecondaryButton( - modifier = modifier.padding(top = 12.dp), + modifier = modifier.padding(top = ItemSpacing), text = viewState.text, icon = Icons.Default.PlayArrow, onClick = { onClick(viewState.soundUrl) }, diff --git a/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/TextLessonItem.kt b/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/TextLessonItem.kt index f0bc4d7..960c6df 100644 --- a/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/TextLessonItem.kt +++ b/composeApp/src/commonMain/kotlin/ui/screen/lesson/composable/item/TextLessonItem.kt @@ -3,11 +3,12 @@ package ui.screen.lesson.composable.item import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.unit.dp import component.text.Body import component.text.HeadlineSmall import ui.screen.lesson.TextItemViewState import ui.screen.lesson.TextStyleViewState +import ui.screen.lesson.composable.ItemSpacing +import ui.screen.lesson.composable.ItemSpacingBig @Composable fun TextLessonItem( @@ -16,12 +17,12 @@ fun TextLessonItem( ) { when (viewState.style) { TextStyleViewState.Heading -> HeadlineSmall( - modifier = modifier.padding(top = 16.dp), + modifier = modifier.padding(top = ItemSpacingBig), text = viewState.text ) TextStyleViewState.Body -> Body( - modifier = modifier.padding(top = 12.dp), + modifier = modifier.padding(top = ItemSpacing), text = viewState.text ) }