Skip to content

Commit

Permalink
[MERGE] #308 -> develop
Browse files Browse the repository at this point in the history
[MOD/#308] 3차 스프린트 홈 뷰 변경사항 반영
  • Loading branch information
Hyobeen-Park authored Dec 23, 2024
2 parents fec7a5c + d4d400a commit 37d01e0
Show file tree
Hide file tree
Showing 19 changed files with 142 additions and 308 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
package com.terning.core.designsystem.component.button

import androidx.compose.foundation.Image
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
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.res.painterResource
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import com.terning.core.designsystem.R
import com.terning.core.designsystem.extension.noRippleClickable
import com.terning.core.designsystem.theme.Black
import com.terning.core.designsystem.theme.Grey350
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.type.SortBy

Expand All @@ -22,31 +27,36 @@ fun SortingButton(
onCLick: () -> Unit,
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
.border(
width = 1.dp,
color = Grey350,
shape = RoundedCornerShape(5.dp)
)
.noRippleClickable(onCLick),
) {
Icon(
imageVector = ImageVector.vectorResource(id = R.drawable.ic_down_18),
contentDescription = stringResource(id = R.string.sort_button_description),
tint = Grey350,
modifier = Modifier
.padding(
start = 7.dp,
end = 6.dp,
top = 5.dp,
bottom = 5.dp,
)
.size(20.dp)
)
Text(
text = stringResource(
id = SortBy.entries[sortBy].sortBy
),
style = TerningTheme.typography.button3,
color = Black,
modifier = Modifier
.padding(
top = 6.dp,
bottom = 6.dp,
)
)
Image(
painter = painterResource(id = R.drawable.ic_down_18),
contentDescription = stringResource(id = R.string.sort_button_description),
color = Grey350,
modifier = Modifier
.padding(
start = 2.dp,
end = 2.dp,
top = 6.dp,
bottom = 4.dp,
)
.padding(end = 11.dp)
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ 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.alpha
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
Expand All @@ -30,7 +32,9 @@ import coil3.compose.AsyncImage
import coil3.request.ImageRequest
import com.terning.core.designsystem.R
import com.terning.core.designsystem.extension.noRippleClickable
import com.terning.core.designsystem.theme.Black
import com.terning.core.designsystem.theme.Grey300
import com.terning.core.designsystem.theme.Grey350
import com.terning.core.designsystem.theme.Grey400
import com.terning.core.designsystem.theme.TerningMain
import com.terning.core.designsystem.theme.TerningPointTheme
Expand Down Expand Up @@ -58,6 +62,7 @@ fun InternItem(
isScraped: Boolean,
modifier: Modifier = Modifier,
scrapId: Long = 0,
isApplyClosed: Boolean = false,
onScrapButtonClicked: (Long) -> Unit = {},
) {
Row(
Expand All @@ -77,6 +82,10 @@ fun InternItem(
.fillMaxHeight()
.aspectRatio(1f)
.clip(RoundedCornerShape(5.dp))
.then(
if (isApplyClosed) Modifier.alpha(0.5f)
else Modifier
)
)

Column(
Expand All @@ -87,11 +96,16 @@ fun InternItem(
Text(
text = dateDeadline,
style = TerningTheme.typography.detail0,
color = if (dateDeadline == stringResource(id = R.string.intern_apply_closed)) Grey300 else TerningMain,
color = when {
isApplyClosed -> Grey350
dateDeadline == stringResource(id = R.string.intern_apply_closed) -> Grey300
else -> TerningMain
},
)
TwoLineHeightText(
text = title,
style = TerningTheme.typography.title5,
color = if (isApplyClosed) Grey350 else Black,
)


Expand All @@ -103,13 +117,13 @@ fun InternItem(
Text(
text = stringResource(R.string.intern_item_working_period),
style = TerningTheme.typography.detail3,
color = Grey400
color = if (isApplyClosed) Grey350 else Grey400,
)

Text(
text = workingPeriod,
style = TerningTheme.typography.detail3,
color = TerningMain,
color = if (isApplyClosed) Grey350 else TerningMain,
modifier = Modifier.padding(start = 4.dp)
)

Expand Down Expand Up @@ -143,6 +157,7 @@ fun InternItem(
fun TwoLineHeightText(
text: String,
style: TextStyle,
color: Color = Black,
) {
val twoLineHeight = with(LocalDensity.current) {
(style.lineHeight.toDp() * 3) - style.fontSize.toDp()
Expand All @@ -151,6 +166,7 @@ fun TwoLineHeightText(
Text(
text = text,
style = style,
color = color,
maxLines = 2,
overflow = TextOverflow.Ellipsis,
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fun InternItemWithShadow(
dateDeadline: String,
workingPeriod: String,
isScrapped: Boolean,
isApplyClosed: Boolean = false,
onScrapButtonClicked: (Long) -> Unit = {}
) {
Box(
Expand All @@ -41,6 +42,7 @@ fun InternItemWithShadow(
dateDeadline = dateDeadline,
workingPeriod = workingPeriod,
isScraped = isScrapped,
isApplyClosed = isApplyClosed,
onScrapButtonClicked = onScrapButtonClicked
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ interface HomeDataSource {

suspend fun getRecommendIntern(
sortBy: String,
startYear: Int,
startMonth: Int
): BaseResponse<HomeRecommendInternResponseDto>

suspend fun getFilteringInfo(): BaseResponse<HomeFilteringInfoResponseDto>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ class HomeDataSourceImpl @Inject constructor(

override suspend fun getRecommendIntern(
sortBy: String,
startYear: Int,
startMonth: Int
): BaseResponse<HomeRecommendInternResponseDto> =
homeService.getRecommendIntern(
sortBy = sortBy,
startYear = startYear,
startMonth = startMonth
)

override suspend fun getFilteringInfo(): BaseResponse<HomeFilteringInfoResponseDto> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@ class HomeRepositoryImpl @Inject constructor(

override suspend fun getRecommendIntern(
sortBy: String,
startYear: Int,
startMonth: Int
): Result<HomeRecommendIntern> =
runCatching {
homeDataSource.getRecommendIntern(
sortBy = sortBy,
startYear = startYear,
startMonth = startMonth
).result.toHomeRecommendInternList()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ interface HomeService {
@GET("api/v1/home")
suspend fun getRecommendIntern(
@Query("sortBy") sortBy: String,
@Query("startYear") startYear: Int,
@Query("startMonth") startMonth: Int,
): BaseResponse<HomeRecommendInternResponseDto>

@GET("api/v1/filters")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ interface HomeRepository {

suspend fun getRecommendIntern(
sortBy: String,
startYear: Int,
startMonth: Int
): Result<HomeRecommendIntern>

suspend fun getFilteringInfo(): Result<HomeFilteringInfo>
Expand Down
Loading

0 comments on commit 37d01e0

Please sign in to comment.