Skip to content

Commit

Permalink
[FEAT/#191] InternTitle 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
arinming committed Aug 30, 2024
1 parent 8913d5e commit 883a1dc
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 48 deletions.
54 changes: 6 additions & 48 deletions feature/src/main/java/com/terning/feature/intern/InternRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
)
}
}
}
20 changes: 20 additions & 0 deletions feature/src/main/res/drawable/ic_view_14.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="14dp"
android:height="14dp"
android:viewportWidth="14"
android:viewportHeight="14">
<path
android:pathData="M0.583,7.001C0.583,7.001 2.917,2.334 7,2.334C11.083,2.334 13.417,7.001 13.417,7.001C13.417,7.001 11.083,11.667 7,11.667C2.917,11.667 0.583,7.001 0.583,7.001Z"
android:strokeLineJoin="round"
android:strokeWidth="1.16667"
android:fillColor="#00000000"
android:strokeColor="#898989"
android:strokeLineCap="round"/>
<path
android:pathData="M7,8.751C7.966,8.751 8.75,7.967 8.75,7.001C8.75,6.034 7.966,5.251 7,5.251C6.033,5.251 5.25,6.034 5.25,7.001C5.25,7.967 6.033,8.751 7,8.751Z"
android:strokeLineJoin="round"
android:strokeWidth="1.16667"
android:fillColor="#00000000"
android:strokeColor="#898989"
android:strokeLineCap="round"/>
</vector>

0 comments on commit 883a1dc

Please sign in to comment.