Skip to content

Commit

Permalink
[MERGE] #117 -> develop
Browse files Browse the repository at this point in the history
[HOTFIX/#117] 공고 뷰 / 공고 상세 페이지 API 수정
  • Loading branch information
arinming authored Jul 17, 2024
2 parents 473f11e + ccd3083 commit 146b756
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ data class InternResponseDto(
val detail: String,
@SerialName("url")
val url: String,
@SerialName("isScrapped")
val isScrapped: Boolean,
@SerialName("scrapId")
val scrapId: Long? = null,
) {
fun toInternEntity(): InternInfoModel {
return InternInfoModel(
Expand All @@ -53,7 +53,7 @@ data class InternResponseDto(
jobType = jobType,
detail = detail,
url = url,
isScrapped = isScrapped
scrapId = scrapId
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ data class InternInfoModel(
val jobType: String,
val detail: String,
val url: String,
val isScrapped: Boolean,
val scrapId: Long? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ fun InternScreen(
InternBottomBar(
modifier = modifier,
scrapCount = decimal.format(internInfoModel.scrapCount),
url = internInfoModel.url,
isScrappedState = state.isScrappedState,
scrapId = internInfoModel.scrapId,
onScrapClick = {
viewModel.updateScrapDialogVisible(true)
}
Expand Down Expand Up @@ -369,7 +368,7 @@ fun InternScreen(
viewModel.updateScrapDialogVisible(false)
},
content = {
when (state.isScrappedState) {
when (internInfoModel.scrapId != null) {
true -> ScrapCancelDialogContent()
else -> ScrapDialogContent(
internInfoList = internInfoList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.terning.domain.entity.response.InternInfoModel

data class InternViewState(
var internInfo: UiState<InternInfoModel> = UiState.Loading,
val isScrap: Boolean = false,
val isColorChange: Boolean = false,
val selectedColor: Color = CalRed,
val isScrapDialogVisible: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ import com.terning.feature.intern.InternViewModel
fun InternBottomBar(
modifier: Modifier,
scrapCount: String,
url: String,
isScrappedState: Boolean,
scrapId: Long? = null,
onScrapClick: () -> Unit,
viewModel: InternViewModel = hiltViewModel(),
) {
Expand Down Expand Up @@ -68,7 +67,7 @@ fun InternBottomBar(
Icon(
painter = painterResource(
id =
if (isScrappedState) R.drawable.ic_scrap_true_24
if (scrapId != null) R.drawable.ic_scrap_true_24
else R.drawable.ic_scrap_false_24,
),
contentDescription = null,
Expand All @@ -79,7 +78,7 @@ fun InternBottomBar(
.noRippleClickable {
onScrapClick()
},
tint = if (state.isScrappedState) TerningMain
tint = if (scrapId != null) TerningMain
else Grey350
)
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ fun ScrapCancelDialogContent(
cornerRadius = 8.dp,
text = R.string.dialog_scrap_cancel_button,
onButtonClick = {
viewModel.updateScrapped(!state.isScrappedState)
viewModel.updateScrapDialogVisible(false)
},
modifier = Modifier.padding(bottom = 8.dp)
Expand Down

0 comments on commit 146b756

Please sign in to comment.