Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOTFIX/#117] 공고 뷰 / 공고 상세 페이지 API 수정 #123

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading