diff --git a/dodam-design-system/src/commonMain/composeResources/drawable/ic_full_moon_face.xml b/dodam-design-system/src/commonMain/composeResources/drawable/ic_full_moon_face.xml new file mode 100644 index 0000000..a530544 --- /dev/null +++ b/dodam-design-system/src/commonMain/composeResources/drawable/ic_full_moon_face.xml @@ -0,0 +1,27 @@ + + + + + + + + + diff --git a/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/DodamEmpty.kt b/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/DodamEmpty.kt new file mode 100644 index 0000000..933b82c --- /dev/null +++ b/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/component/DodamEmpty.kt @@ -0,0 +1,60 @@ +package com.b1nd.dodam.designsystem.component + +import androidx.compose.foundation.BorderStroke +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material3.Icon +import androidx.compose.material3.Surface +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.b1nd.dodam.designsystem.DodamTheme +import com.b1nd.dodam.designsystem.foundation.DodamIcons + +@Composable +fun DodamEmpty( + modifier: Modifier = Modifier, + onClick: () -> Unit, + title: String, + buttonText: String, + border: BorderStroke? = null +) { + Surface( + modifier = modifier, + color = DodamTheme.colors.backgroundNormal, + shape = DodamTheme.shapes.large, + border = border + ) { + Column( + modifier = Modifier.padding(16.dp), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Image( + modifier = Modifier.size(36.dp), + imageVector = DodamIcons.FullMoonFace.value, + contentDescription = "달이 웃는 표정" + ) + Spacer(modifier = Modifier.height(12.dp)) + Text( + text = title, + style = DodamTheme.typography.labelMedium(), + color = DodamTheme.colors.labelAlternative.copy(alpha = 0.5f), + ) + Spacer(modifier = Modifier.height(24.dp)) + DodamButton( + modifier = Modifier.fillMaxWidth(), + onClick = onClick, + text = buttonText, + buttonSize = ButtonSize.Large, + buttonRole = ButtonRole.Assistive + ) + } + } +} \ No newline at end of file diff --git a/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/foundation/DodamIcons.kt b/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/foundation/DodamIcons.kt index 472f659..8b64332 100644 --- a/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/foundation/DodamIcons.kt +++ b/dodam-design-system/src/commonMain/kotlin/com/b1nd/dodam/designsystem/foundation/DodamIcons.kt @@ -19,6 +19,7 @@ import com.b1nd.dodam.designsystem.resources.ic_exclamationmark_circle import com.b1nd.dodam.designsystem.resources.ic_eye import com.b1nd.dodam.designsystem.resources.ic_eye_slash import com.b1nd.dodam.designsystem.resources.ic_fork_and_knife +import com.b1nd.dodam.designsystem.resources.ic_full_moon_face import com.b1nd.dodam.designsystem.resources.ic_gear import com.b1nd.dodam.designsystem.resources.ic_home import com.b1nd.dodam.designsystem.resources.ic_magnifyingglass @@ -59,7 +60,8 @@ enum class DodamIcons { Gear, Person, Dev, - Close; + Close, + FullMoonFace; val value: ImageVector @Composable @@ -92,5 +94,6 @@ enum class DodamIcons { Person -> vectorResource(Res.drawable.ic_person) Dev -> vectorResource(Res.drawable.ic_dev) Close -> vectorResource(Res.drawable.ic_close_line) + FullMoonFace -> vectorResource(Res.drawable.ic_full_moon_face) } } diff --git a/dodam-design-system/src/main/java/com/b1nd/dodam/designsystem/previews/DodamEmptyPreview.kt b/dodam-design-system/src/main/java/com/b1nd/dodam/designsystem/previews/DodamEmptyPreview.kt new file mode 100644 index 0000000..e547ade --- /dev/null +++ b/dodam-design-system/src/main/java/com/b1nd/dodam/designsystem/previews/DodamEmptyPreview.kt @@ -0,0 +1,49 @@ +package com.b1nd.dodam.designsystem.previews + +import androidx.compose.foundation.BorderStroke +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.b1nd.dodam.designsystem.DodamTheme +import com.b1nd.dodam.designsystem.component.DodamEmpty + +@Composable +@Preview +fun DodamEmptyPreview( + +){ + DodamTheme { + Column( + modifier = Modifier + .fillMaxSize() + .background(DodamTheme.colors.backgroundNormal) + ) { + DodamEmpty( + modifier = Modifier + .padding(16.dp) + .fillMaxWidth(), + onClick = { }, + title = "외출/외박 승인 명단을 불러올 수 없어요", + buttonText = "다시 불러오기" + ) + DodamEmpty( + modifier = Modifier + .padding(16.dp) + .fillMaxWidth(), + onClick = { }, + title = "외출/외박 승인 명단을 불러올 수 없어요", + buttonText = "다시 불러오기", + border = BorderStroke( + width = 1.dp, + color = DodamTheme.colors.lineAlternative + ) + ) + } + } +} \ No newline at end of file