From 9f9d5eec84e801d8cecf328b038e7608aed9230a Mon Sep 17 00:00:00 2001 From: Heon Date: Fri, 16 Aug 2024 12:07:10 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9D=98=EA=B2=AC=20=EC=A0=9C=EC=95=88?= =?UTF-8?q?=20=ED=81=B4=EB=A6=AD=20=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feature/agency/search/AgencySearchScreen.kt | 17 ++++++++++++++--- .../agency/search/AgencySearchSideEffect.kt | 1 + .../agency/search/AgencySearchViewModel.kt | 2 ++ .../feature/mymong/main/MyMongScreen.kt | 5 +++++ .../mymong/main/view/MyMongFeedbackView.kt | 3 ++- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchScreen.kt b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchScreen.kt index 17578a28..8e7b1d0b 100644 --- a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchScreen.kt +++ b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchScreen.kt @@ -1,5 +1,7 @@ package com.moneymong.moneymong.feature.agency.search +import android.content.Intent +import android.net.Uri import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -18,6 +20,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp @@ -55,6 +58,7 @@ fun AgencySearchScreen( navigateAgencyJoin: (agencyId: Long) -> Unit ) { val state by viewModel.collectAsState() + val context = LocalContext.current val pagingItems = viewModel.agencies.collectAsLazyPagingItems() viewModel.collectSideEffect { @@ -66,6 +70,11 @@ fun AgencySearchScreen( is AgencySearchSideEffect.NavigateToAgencyJoin -> { navigateAgencyJoin(it.agencyId) } + + is AgencySearchSideEffect.FollowAsk -> { + val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://asked.kr/moneymong")) + context.startActivity(intent) + } } } @@ -100,6 +109,7 @@ fun AgencySearchScreen( viewModel.navigateToJoin(agencyId) } }, + onClickFeedbackItem = viewModel::onClickAskFeedback, isLoading = state.isLoading, isError = state.isError, errorMessage = state.errorMessage, @@ -133,6 +143,7 @@ private fun AgencySearchContentView( modifier: Modifier = Modifier, pagingItems: LazyPagingItems, onClickItem: (agencyId: Long) -> Unit, + onClickFeedbackItem: () -> Unit, isLoading: Boolean, isError: Boolean, errorMessage: String, @@ -157,18 +168,18 @@ private fun AgencySearchContentView( }, ) } else { - if (pagingItems.itemCount != 0) { + if (pagingItems.itemCount == 0) { ContentViewWithoutAgencies( modifier = modifier, pagingItems = pagingItems, - onClickFeedbackItem = {} + onClickFeedbackItem = onClickFeedbackItem ) } else { ContentViewWithAgencies( modifier = modifier, pagingItems = pagingItems, onClickItem = onClickItem, - onClickFeedbackItem = {} + onClickFeedbackItem = onClickFeedbackItem ) } } diff --git a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchSideEffect.kt b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchSideEffect.kt index 4934e6e8..84fd3c20 100644 --- a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchSideEffect.kt +++ b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchSideEffect.kt @@ -5,4 +5,5 @@ import com.moneymong.moneymong.common.base.SideEffect sealed interface AgencySearchSideEffect : SideEffect { data class NavigateToRegister(val isUniversityStudent: Boolean) : AgencySearchSideEffect data class NavigateToAgencyJoin(val agencyId: Long) : AgencySearchSideEffect + data object FollowAsk : AgencySearchSideEffect } \ No newline at end of file diff --git a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchViewModel.kt b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchViewModel.kt index c27bcd1e..0f7ff711 100644 --- a/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchViewModel.kt +++ b/feature/agency/src/main/java/com/moneymong/moneymong/feature/agency/search/AgencySearchViewModel.kt @@ -87,4 +87,6 @@ class AgencySearchViewModel @Inject constructor( state.copy(visibleWarningDialog = visible) } } + + fun onClickAskFeedback() = eventEmit(AgencySearchSideEffect.FollowAsk) } \ No newline at end of file diff --git a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongScreen.kt b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongScreen.kt index 648fc61b..74d1a373 100644 --- a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongScreen.kt +++ b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/MyMongScreen.kt @@ -1,5 +1,7 @@ package com.moneymong.moneymong.feature.mymong.main +import android.content.Intent +import android.net.Uri import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -37,6 +39,7 @@ fun MyMongScreen( navigateToLogin: () -> Unit, ) { val state by viewModel.collectAsState() + val context = LocalContext.current viewModel.collectSideEffect { when (it) { @@ -57,6 +60,8 @@ fun MyMongScreen( } is MyMongSideEffect.FollowKakaoChannel -> { + val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://pf.kakao.com/_zDsyG")) + context.startActivity(intent) } } } diff --git a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/view/MyMongFeedbackView.kt b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/view/MyMongFeedbackView.kt index 8954fffa..79611e96 100644 --- a/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/view/MyMongFeedbackView.kt +++ b/feature/mymong/src/main/java/com/moneymong/moneymong/feature/mymong/main/view/MyMongFeedbackView.kt @@ -17,6 +17,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.moneymong.moneymong.design_system.component.button.MDSButton @@ -48,7 +49,7 @@ fun MyMongFeedbackView( Column { Text( text = "머니몽에게 자유롭게\n문의 해보세요!", - style = Body4, + style = Body4.copy(fontWeight = FontWeight.Bold), color = Gray08 ) Spacer(modifier = Modifier.height(8.dp))