11package com.threegap.bitnagil.presentation.home.component.template
22
3- import androidx.compose.foundation.background
4- import androidx.compose.foundation.border
5- import androidx.compose.foundation.layout.Box
6- import androidx.compose.foundation.layout.Column
7- import androidx.compose.foundation.layout.IntrinsicSize
3+ import androidx.compose.foundation.layout.Arrangement
84import androidx.compose.foundation.layout.Row
9- import androidx.compose.foundation.layout.Spacer
10- import androidx.compose.foundation.layout.fillMaxHeight
11- import androidx.compose.foundation.layout.height
12- import androidx.compose.foundation.layout.padding
13- import androidx.compose.foundation.layout.size
14- import androidx.compose.foundation.shape.CircleShape
5+ import androidx.compose.foundation.layout.defaultMinSize
6+ import androidx.compose.foundation.layout.fillMaxWidth
157import androidx.compose.material3.Text
16- import androidx.compose.material3.VerticalDivider
178import androidx.compose.runtime.Composable
18- import androidx.compose.ui.Alignment
199import androidx.compose.ui.Modifier
2010import androidx.compose.ui.tooling.preview.Preview
2111import androidx.compose.ui.unit.dp
2212import com.threegap.bitnagil.designsystem.BitnagilTheme
2313import com.threegap.bitnagil.domain.routine.model.RoutineType
2414import com.threegap.bitnagil.presentation.home.component.block.RoutineItem
25- import com.threegap.bitnagil.presentation.home.component.block.SubRoutinesItem
2615import com.threegap.bitnagil.presentation.home.model.RoutineUiModel
2716import com.threegap.bitnagil.presentation.home.model.SubRoutineUiModel
2817import com.threegap.bitnagil.presentation.home.util.formatExecutionTime
@@ -32,76 +21,31 @@ fun RoutineSection(
3221 routine : RoutineUiModel ,
3322 onRoutineToggle : (Boolean ) -> Unit ,
3423 onSubRoutineToggle : (String , Boolean ) -> Unit ,
35- onMoreClick : () -> Unit ,
3624 modifier : Modifier = Modifier ,
3725) {
38- Column (
39- modifier = modifier,
26+ Row (
27+ modifier = modifier.fillMaxWidth(),
28+ horizontalArrangement = Arrangement .spacedBy(8 .dp),
4029 ) {
4130 Text (
42- text = " ${routine.executionTime.formatExecutionTime()} 부터 시작" ,
43- style = BitnagilTheme .typography.caption1Regular,
44- color = BitnagilTheme .colors.navy300,
31+ text = routine.executionTime.formatExecutionTime(),
32+ style = BitnagilTheme .typography.body2Medium,
33+ color = BitnagilTheme .colors.coolGray10,
34+ modifier = Modifier .defaultMinSize(minWidth = 42 .dp),
4535 )
4636
47- Spacer (modifier = Modifier .height(10 .dp))
48-
49- Row (
50- modifier = Modifier .height(IntrinsicSize .Min ),
51- ) {
52- Box (
53- modifier = Modifier
54- .fillMaxHeight()
55- .padding(
56- start = 9 .dp,
57- end = 10 .dp,
58- ),
59- ) {
60- VerticalDivider (
61- modifier = Modifier
62- .fillMaxHeight()
63- .border(
64- width = 1 .dp,
65- color = BitnagilTheme .colors.lightBlue300,
66- )
67- .align(Alignment .Center ),
68- )
69-
70- Box (
71- modifier = Modifier
72- .padding(top = 26.5 .dp)
73- .size(8 .dp)
74- .background(
75- color = BitnagilTheme .colors.navy500,
76- shape = CircleShape ,
77- ),
78- )
79- }
80-
81- Column {
82- RoutineItem (
83- routine = routine,
84- onRoutineToggle = onRoutineToggle,
85- onMoreClick = onMoreClick,
86- )
87-
88- if (routine.subRoutines.isNotEmpty()) {
89- SubRoutinesItem (
90- subRoutines = routine.subRoutines,
91- onSubRoutineToggle = { subRoutineId, isCompleted ->
92- onSubRoutineToggle(subRoutineId, isCompleted)
93- },
94- modifier = Modifier .padding(top = 10 .dp),
95- )
96- }
97- }
98- }
37+ RoutineItem (
38+ routine = routine,
39+ onRoutineToggle = onRoutineToggle,
40+ onSubRoutineToggle = onSubRoutineToggle,
41+ modifier = Modifier .fillMaxWidth(),
42+ )
9943 }
10044}
10145
10246@Preview(showBackground = true )
10347@Composable
104- private fun RoutineTemplatePreview () {
48+ private fun RoutineSectionPreview () {
10549 RoutineSection (
10650 routine = RoutineUiModel (
10751 routineId = " uuid1" ,
@@ -148,6 +92,5 @@ private fun RoutineTemplatePreview() {
14892 ),
14993 onRoutineToggle = {},
15094 onSubRoutineToggle = { _, _ -> },
151- onMoreClick = {},
15295 )
15396}
0 commit comments