From b7ae40a60d5d7efee7eae607b3a45054f3f570b6 Mon Sep 17 00:00:00 2001 From: boiledegg Date: Sat, 20 Jul 2024 00:53:59 +0900 Subject: [PATCH] =?UTF-8?q?[FIX/#171]=20=EC=8A=A4=ED=81=AC=EB=9E=A9=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/home/component/HomeRecommendInternDialog.kt | 3 +++ .../feature/search/searchprocess/SearchProcessRoute.kt | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/home/home/component/HomeRecommendInternDialog.kt b/feature/src/main/java/com/terning/feature/home/home/component/HomeRecommendInternDialog.kt index 7813c5323..9738753e9 100644 --- a/feature/src/main/java/com/terning/feature/home/home/component/HomeRecommendInternDialog.kt +++ b/feature/src/main/java/com/terning/feature/home/home/component/HomeRecommendInternDialog.kt @@ -21,6 +21,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 @@ -52,6 +53,7 @@ import com.terning.feature.intern.component.InternInfoRow fun HomeRecommendInternDialog( internInfoList: List>, clickAction: () -> Unit, + onColorSelected:(Color) -> Unit = {}, homeRecommendInternModel: HomeRecommendInternModel, viewModel: HomeViewModel = hiltViewModel(), ) { @@ -171,6 +173,7 @@ fun HomeRecommendInternDialog( initialColor = CalRed, onColorSelected = { newColor -> viewModel.updateSelectColor(newColor) + onColorSelected(newColor) } ) } diff --git a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt index d8dab4e8a..cd804faa6 100644 --- a/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt +++ b/feature/src/main/java/com/terning/feature/search/searchprocess/SearchProcessRoute.kt @@ -1,5 +1,6 @@ package com.terning.feature.search.searchprocess +import android.util.Log import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -352,12 +353,14 @@ fun SearchProcessScreen( ) viewModel.updateColorChange(false) } else { - viewModel.postScrap(internshipAnnouncementId, 0) - + viewModel.postScrap(internshipAnnouncementId, colorList.indexOf(dialogState.selectedColor)) } viewModel.updateScrapDialogVisible(false) } }, + onColorSelected = { newColor -> + viewModel.updateSelectColor(newColor) + }, homeRecommendInternModel = HomeRecommendInternModel( scrapId = scrapId, internshipAnnouncementId = internshipAnnouncementId,