diff --git a/app/src/main/java/com/gildongmu/dduru/core/designsystem/typography/Type.kt b/app/src/main/java/com/gildongmu/dduru/core/designsystem/typography/Type.kt index 3f3d34d..cb67b58 100644 --- a/app/src/main/java/com/gildongmu/dduru/core/designsystem/typography/Type.kt +++ b/app/src/main/java/com/gildongmu/dduru/core/designsystem/typography/Type.kt @@ -39,7 +39,8 @@ data class DduruTypography( val Caption1: TextStyle, val Caption2: TextStyle, - val Micro: TextStyle + val Micro: TextStyle, + val Micro2: TextStyle ) val defaultDduruTypography = DduruTypography( @@ -157,6 +158,13 @@ val defaultDduruTypography = DduruTypography( ), Micro = TextStyle( + fontFamily = Pretendard, + fontWeight = FontWeight.Bold, + fontSize = 10.sp, + lineHeight = 12.sp + ), + + Micro2 = TextStyle( fontFamily = Pretendard, fontWeight = FontWeight.SemiBold, fontSize = 10.sp, diff --git a/app/src/main/java/com/gildongmu/dduru/presentation/feature/home/component/HomeHashtag.kt b/app/src/main/java/com/gildongmu/dduru/presentation/feature/home/component/HomeHashtag.kt new file mode 100644 index 0000000..4713929 --- /dev/null +++ b/app/src/main/java/com/gildongmu/dduru/presentation/feature/home/component/HomeHashtag.kt @@ -0,0 +1,97 @@ +package com.gildongmu.dduru.presentation.feature.home.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.gildongmu.dduru.core.designsystem.theme.DduruTheme + +@Composable +fun HomeHashtag( + text: String, + textColor: Color, + textStyle: TextStyle, + backgroundColor: Color, + contentPadding: PaddingValues, + modifier: Modifier = Modifier +) { + Box( + modifier = modifier + .clip(shape = RoundedCornerShape(size = 99.dp)) + .background(color = backgroundColor) + .padding(contentPadding), + contentAlignment = Alignment.Center + ) { + Text( + text = "#$text", + color = textColor, + style = textStyle + ) + } +} + +@Preview(name = "OnboardingHashtag - 설문조사 완료") +@Composable +private fun OnboardingHashtagPreview() { + DduruTheme { + HomeHashtag( + text = "세심함", + textColor = DduruTheme.colors.gray700, + textStyle = DduruTheme.typography.Caption2, + backgroundColor = DduruTheme.colors.gray300, + contentPadding = PaddingValues(horizontal = 8.dp, vertical = 4.dp) + ) + } +} + +@Preview(name = "HomeHashtag - 실시간인기여행지") +@Composable +private fun HomeHashtagRealtimePreview() { + DduruTheme { + HomeHashtag( + text = "힐링", + textColor = DduruTheme.colors.gray700, + textStyle = DduruTheme.typography.Micro2, + backgroundColor = DduruTheme.colors.gray100, + contentPadding = PaddingValues(horizontal = 8.dp, vertical = 4.dp) + ) + } +} + +@Preview(name = "HomeHashtag - 슈퍼호스트") +@Composable +private fun HomeHashtagDefaultPreview() { + DduruTheme { + HomeHashtag( + text = "일출", + textColor = DduruTheme.colors.gray500, + textStyle = DduruTheme.typography.Caption1, + backgroundColor = DduruTheme.colors.gray100, + contentPadding = PaddingValues(horizontal = 8.dp, vertical = 4.dp) + ) + } +} + +@Preview(name = "HomeHashtag - AI추천여행지") +@Composable +private fun HomeHashtagAIPreview() { + DduruTheme { + HomeHashtag( + text = "카페투어", + textColor = DduruTheme.colors.gray300, + textStyle = DduruTheme.typography.Caption2, + backgroundColor = DduruTheme.colors.gray300.copy(alpha = 0.3f), + contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp) + ) + } +} diff --git a/app/src/main/java/com/gildongmu/dduru/presentation/feature/home/component/HomeSectionTrailingAction.kt b/app/src/main/java/com/gildongmu/dduru/presentation/feature/home/component/HomeSectionTrailingAction.kt new file mode 100644 index 0000000..700bcf5 --- /dev/null +++ b/app/src/main/java/com/gildongmu/dduru/presentation/feature/home/component/HomeSectionTrailingAction.kt @@ -0,0 +1,54 @@ +package com.gildongmu.dduru.presentation.feature.home.component + +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.padding +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.filled.KeyboardArrowRight +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.gildongmu.dduru.core.designsystem.theme.DduruTheme + +@Composable +fun HomeSectionTrailingAction( + text: String, + onClick: () -> Unit, + modifier: Modifier = Modifier +) { + Row( + modifier = modifier + .clickable(onClick = onClick) + .padding(vertical = 4.dp), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(8.dp) + ) { + Text( + text = text, + style = DduruTheme.typography.Body4, + color = DduruTheme.colors.gray600 + ) + + Icon( + imageVector = Icons.AutoMirrored.Filled.KeyboardArrowRight, + contentDescription = null, + tint = DduruTheme.colors.gray600 + ) + } +} + +@Preview +@Composable +private fun HomeSectionTrailingActionPreview() { + DduruTheme { + HomeSectionTrailingAction( + text = "전체보기", + onClick = {} + ) + } +}