Skip to content

Commit

Permalink
[FEAT/#239] 스크랩 아이콘 업데이트
Browse files Browse the repository at this point in the history
  • Loading branch information
arinming committed Sep 12, 2024
1 parent e177872 commit 6e17227
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
13 changes: 10 additions & 3 deletions feature/src/main/java/com/terning/feature/intern/InternRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,22 @@ fun InternRoute(
internInfo = (internState.loadState as UiState.Success).data,
navController = navController,
onDismissCancelDialog = {
viewModel.updateScrapCancelDialogVisibility(false)
with(viewModel) {
updateScrapCancelDialogVisibility(false)
getInternInfo(announcementId)
}
},
onDismissScrapDialog = {
with(viewModel) {
updateInternDialogVisibility(false)
getInternInfo(announcementId)
}
},
onDismissScrapDialog = { viewModel.updateInternDialogVisibility(false) },
onClickCancelButton = {
viewModel.updateScrapCancelDialogVisibility(true)
},
onClickScrapButton = {
with(viewModel) {
updateInternshipModel(it)
if (internState.isScrappedState)
updateScrapCancelDialogVisibility(true)
else updateInternDialogVisibility(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class InternViewModel @Inject constructor(
_internUiState.update { currentState ->
currentState.copy(
scrapCancelDialogVisibility = visibility,
isScrappedState = visibility
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ fun InternBottomBar(
onScrapClick: (InternInfo) -> Unit,
viewModel: InternViewModel = hiltViewModel(),
) {

Row(
modifier = modifier
.fillMaxWidth()
Expand Down Expand Up @@ -65,20 +64,19 @@ fun InternBottomBar(
) {
Icon(
painter = painterResource(
id =
if (internUiState.isScrappedState) R.drawable.ic_scrap_true_24
else R.drawable.ic_scrap_false_24,
id = if (internUiState.isScrappedState) {
R.drawable.ic_scrap_true_24
} else {
R.drawable.ic_scrap_false_24
}
),
contentDescription = null,
modifier = modifier
.padding(
bottom = 6.dp
)
.padding(bottom = 6.dp)
.noRippleClickable {
onScrapClick(internInfo)
},
tint = if (internInfo.scrapId != null) TerningMain
else Grey350
tint = if (internInfo.scrapId != null) TerningMain else Grey350
)
Text(
text = stringResource(
Expand All @@ -101,4 +99,4 @@ fun InternBottomBar(
}
}
}
}
}

0 comments on commit 6e17227

Please sign in to comment.