Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into fix/#167-second-qa
  • Loading branch information
leeeyubin committed Jul 19, 2024
2 parents 9f7d73d + 074396d commit 49c9424
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.terning.feature.home.home
import androidx.compose.ui.graphics.Color
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.terning.core.designsystem.theme.CalRed
import com.terning.core.state.UiState
import com.terning.domain.entity.request.ChangeFilteringRequestModel
import com.terning.domain.entity.request.ScrapRequestModel
Expand Down Expand Up @@ -135,7 +136,9 @@ class HomeViewModel @Inject constructor(
).onSuccess {
updateScrapDialogVisible(visible = false)
updateScrapped(scrapped = true)
updateSelectColor(CalRed)
getHomeTodayInternList()
getFilteringInfo()
_homeSideEffect.emit(HomeSideEffect.ShowToast(R.string.intern_scrap_add_toast_message))
}.onFailure {
_homeSideEffect.emit(HomeSideEffect.ShowToast(R.string.server_failure))
Expand All @@ -151,6 +154,7 @@ class HomeViewModel @Inject constructor(
updateScrapDialogVisible(visible = false)
updateScrapped(scrapped = true)
getHomeTodayInternList()
getFilteringInfo()
_homeSideEffect.emit(HomeSideEffect.ShowToast(R.string.intern_scrap_delete_toast_message))
}.onFailure {
_homeSideEffect.emit(HomeSideEffect.ShowToast(R.string.server_failure))
Expand All @@ -171,6 +175,7 @@ class HomeViewModel @Inject constructor(
).onSuccess {
updateScrapDialogVisible(visible = false)
updateScrapped(scrapped = true)
updateSelectColor(CalRed)
getHomeTodayInternList()
}.onFailure {
_homeSideEffect.emit(HomeSideEffect.ShowToast(R.string.server_failure))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -36,16 +35,7 @@ import coil.request.ImageRequest
import com.terning.core.R
import com.terning.core.designsystem.component.button.RoundButton
import com.terning.core.designsystem.component.item.ColorPalette
import com.terning.core.designsystem.theme.CalBlue1
import com.terning.core.designsystem.theme.CalBlue2
import com.terning.core.designsystem.theme.CalGreen1
import com.terning.core.designsystem.theme.CalGreen2
import com.terning.core.designsystem.theme.CalOrange1
import com.terning.core.designsystem.theme.CalOrange2
import com.terning.core.designsystem.theme.CalPink
import com.terning.core.designsystem.theme.CalPurple
import com.terning.core.designsystem.theme.CalRed
import com.terning.core.designsystem.theme.CalYellow
import com.terning.core.designsystem.theme.Grey200
import com.terning.core.designsystem.theme.Grey350
import com.terning.core.designsystem.theme.Grey500
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
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.res.painterResource
Expand Down Expand Up @@ -184,7 +185,7 @@ fun HomeTodayInternDialog(
contentAlignment = Alignment.Center
) {
ColorPalette(
initialColor = CalRed,
initialColor = Color(android.graphics.Color.parseColor(homeTodayInternModel.color)),
onColorSelected = { newColor ->
viewModel.updateSelectColor(newColor)
}
Expand Down

0 comments on commit 49c9424

Please sign in to comment.