From 883a1dc6438311288d9256825eb679cfa7d83935 Mon Sep 17 00:00:00 2001 From: arinming Date: Fri, 30 Aug 2024 19:05:43 +0900 Subject: [PATCH] =?UTF-8?q?[FEAT/#191]=20InternTitle=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/terning/feature/intern/InternRoute.kt | 54 ++---------- .../feature/intern/component/InternTitle.kt | 85 +++++++++++++++++++ feature/src/main/res/drawable/ic_view_14.xml | 20 +++++ 3 files changed, 111 insertions(+), 48 deletions(-) create mode 100644 feature/src/main/java/com/terning/feature/intern/component/InternTitle.kt create mode 100644 feature/src/main/res/drawable/ic_view_14.xml diff --git a/feature/src/main/java/com/terning/feature/intern/InternRoute.kt b/feature/src/main/java/com/terning/feature/intern/InternRoute.kt index a3408c08c..339f658c6 100644 --- a/feature/src/main/java/com/terning/feature/intern/InternRoute.kt +++ b/feature/src/main/java/com/terning/feature/intern/InternRoute.kt @@ -2,7 +2,6 @@ package com.terning.feature.intern import android.view.ViewGroup import android.webkit.WebView -import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -35,7 +34,6 @@ import com.terning.core.designsystem.theme.Black import com.terning.core.designsystem.theme.Grey200 import com.terning.core.designsystem.theme.Grey400 import com.terning.core.designsystem.theme.TerningMain -import com.terning.core.designsystem.theme.TerningSub3 import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.extension.customShadow import com.terning.core.extension.toast @@ -46,6 +44,7 @@ import com.terning.feature.intern.component.InternBottomBar import com.terning.feature.intern.component.InternCompanyInfo import com.terning.feature.intern.component.InternInfoRow import com.terning.feature.intern.component.InternPageTitle +import com.terning.feature.intern.component.InternTitle import com.terning.feature.intern.model.InternUiState import java.text.DecimalFormat @@ -164,37 +163,11 @@ fun InternScreen( Spacer(modifier = modifier.padding(top = 20.dp)) - Row( - modifier = modifier - .background( - color = TerningSub3, - shape = RoundedCornerShape(size = 5.dp) - ), - horizontalArrangement = Arrangement.spacedBy( - 0.dp, - Alignment.CenterHorizontally - ), - verticalAlignment = Alignment.CenterVertically - ) { - Text( - text = internInfoModel.dDay, - style = TerningTheme.typography.title3, - color = TerningMain, - modifier = Modifier.padding( - horizontal = 19.5.dp, - vertical = 1.5.dp - ) - ) - } - - Text( - text = internInfoModel.title, - style = TerningTheme.typography.heading2, - color = Black, - modifier = modifier.padding( - top = 4.dp, - bottom = 16.dp - ) + InternTitle( + modifier = modifier, + dDay = internInfoModel.dDay, + title = internInfoModel.title, + viewCount = decimal.format(internInfoModel.viewCount) ) Column( @@ -216,21 +189,6 @@ fun InternScreen( InternInfoRow(title, value) } } - Row( - horizontalArrangement = Arrangement.spacedBy(3.dp, Alignment.End), - verticalAlignment = Alignment.CenterVertically, - modifier = modifier - .fillMaxWidth() - .padding( - top = 9.dp, - ) - ) { - Text( - text = "${decimal.format(internInfoModel.viewCount)}회", - style = TerningTheme.typography.button4, - color = Grey400, - ) - } } Column( diff --git a/feature/src/main/java/com/terning/feature/intern/component/InternTitle.kt b/feature/src/main/java/com/terning/feature/intern/component/InternTitle.kt new file mode 100644 index 000000000..30acbd9bd --- /dev/null +++ b/feature/src/main/java/com/terning/feature/intern/component/InternTitle.kt @@ -0,0 +1,85 @@ +package com.terning.feature.intern.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +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.res.stringResource +import androidx.compose.ui.unit.dp +import com.terning.core.designsystem.component.image.TerningImage +import com.terning.core.designsystem.theme.Black +import com.terning.core.designsystem.theme.Grey400 +import com.terning.core.designsystem.theme.TerningMain +import com.terning.core.designsystem.theme.TerningSub3 +import com.terning.core.designsystem.theme.TerningTheme +import com.terning.feature.R + + +@Composable +fun InternTitle( + modifier: Modifier, + dDay: String, + title: String, + viewCount: String, +) { + Column( + modifier = Modifier + .fillMaxWidth(), + ) { + Row( + modifier = modifier + .background( + color = TerningSub3, + shape = RoundedCornerShape(size = 5.dp) + ), + horizontalArrangement = Arrangement.spacedBy( + 0.dp, + Alignment.CenterHorizontally + ), + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = dDay, + style = TerningTheme.typography.title3, + color = TerningMain, + modifier = Modifier.padding( + horizontal = 19.5.dp, + vertical = 1.5.dp + ) + ) + } + + Text( + text = title, + style = TerningTheme.typography.heading2, + color = Black, + modifier = modifier.padding( + top = 8.dp, + bottom = 4.dp + ) + ) + + Row( + horizontalArrangement = Arrangement.spacedBy(3.dp, Alignment.Start), + verticalAlignment = Alignment.CenterVertically, + modifier = modifier + .fillMaxWidth() + ) { + TerningImage( + painter = R.drawable.ic_view_14 + ) + Text( + text = stringResource(id = R.string.intern_view_count_detail, viewCount), + style = TerningTheme.typography.button4, + color = Grey400, + ) + } + } +} \ No newline at end of file diff --git a/feature/src/main/res/drawable/ic_view_14.xml b/feature/src/main/res/drawable/ic_view_14.xml new file mode 100644 index 000000000..3f6e68ef5 --- /dev/null +++ b/feature/src/main/res/drawable/ic_view_14.xml @@ -0,0 +1,20 @@ + + + +