|
| 1 | +package com.threegap.bitnagil.presentation.routinelist.component.template |
| 2 | + |
| 3 | +import androidx.compose.foundation.background |
| 4 | +import androidx.compose.foundation.layout.Arrangement |
| 5 | +import androidx.compose.foundation.layout.Box |
| 6 | +import androidx.compose.foundation.layout.Column |
| 7 | +import androidx.compose.foundation.layout.Spacer |
| 8 | +import androidx.compose.foundation.layout.height |
| 9 | +import androidx.compose.foundation.layout.padding |
| 10 | +import androidx.compose.foundation.shape.RoundedCornerShape |
| 11 | +import androidx.compose.material3.Text |
| 12 | +import androidx.compose.runtime.Composable |
| 13 | +import androidx.compose.ui.Alignment |
| 14 | +import androidx.compose.ui.Modifier |
| 15 | +import androidx.compose.ui.tooling.preview.Preview |
| 16 | +import androidx.compose.ui.unit.dp |
| 17 | +import com.threegap.bitnagil.designsystem.BitnagilTheme |
| 18 | +import com.threegap.bitnagil.designsystem.modifier.clickableWithoutRipple |
| 19 | + |
| 20 | +@Composable |
| 21 | +fun EmptyRoutineListView( |
| 22 | + onRegisterRoutineClick: () -> Unit, |
| 23 | + modifier: Modifier = Modifier, |
| 24 | +) { |
| 25 | + Column( |
| 26 | + verticalArrangement = Arrangement.Center, |
| 27 | + horizontalAlignment = Alignment.CenterHorizontally, |
| 28 | + modifier = modifier, |
| 29 | + ) { |
| 30 | + Text( |
| 31 | + text = "등록한 루틴이 없어요", |
| 32 | + style = BitnagilTheme.typography.subtitle1SemiBold, |
| 33 | + color = BitnagilTheme.colors.coolGray30, |
| 34 | + modifier = Modifier.height(28.dp), |
| 35 | + ) |
| 36 | + |
| 37 | + Text( |
| 38 | + text = "루틴을 등록하고, 작은 변화부터 시작해보세요!", |
| 39 | + style = BitnagilTheme.typography.body2Regular, |
| 40 | + color = BitnagilTheme.colors.coolGray70, |
| 41 | + ) |
| 42 | + |
| 43 | + Spacer(modifier = Modifier.height(16.dp)) |
| 44 | + |
| 45 | + Box( |
| 46 | + modifier = Modifier |
| 47 | + .background( |
| 48 | + color = BitnagilTheme.colors.coolGray96, |
| 49 | + shape = RoundedCornerShape(8.dp), |
| 50 | + ) |
| 51 | + .clickableWithoutRipple { onRegisterRoutineClick() } |
| 52 | + .padding( |
| 53 | + vertical = 10.dp, |
| 54 | + horizontal = 14.dp, |
| 55 | + ), |
| 56 | + contentAlignment = Alignment.Center, |
| 57 | + ) { |
| 58 | + Text( |
| 59 | + text = "루틴 등록하기", |
| 60 | + style = BitnagilTheme.typography.caption1SemiBold, |
| 61 | + color = BitnagilTheme.colors.coolGray30, |
| 62 | + ) |
| 63 | + } |
| 64 | + } |
| 65 | +} |
| 66 | + |
| 67 | +@Preview |
| 68 | +@Composable |
| 69 | +private fun EmptyRoutineListViewPreview() { |
| 70 | + EmptyRoutineListView(onRegisterRoutineClick = {}) |
| 71 | +} |
0 commit comments