@@ -13,11 +13,17 @@ import androidx.compose.foundation.layout.requiredWidth
1313import androidx.compose.foundation.layout.size
1414import androidx.compose.foundation.rememberScrollState
1515import androidx.compose.foundation.verticalScroll
16+ import androidx.compose.material3.AlertDialog
1617import androidx.compose.material3.Icon
1718import androidx.compose.material3.IconButton
1819import androidx.compose.material3.Text
20+ import androidx.compose.material3.TextButton
1921import androidx.compose.runtime.Composable
22+ import androidx.compose.runtime.LaunchedEffect
2023import androidx.compose.runtime.getValue
24+ import androidx.compose.runtime.mutableStateOf
25+ import androidx.compose.runtime.remember
26+ import androidx.compose.runtime.setValue
2127import androidx.compose.ui.Alignment
2228import androidx.compose.ui.Modifier
2329import androidx.compose.ui.graphics.vector.ImageVector
@@ -31,14 +37,18 @@ import androidx.compose.ui.unit.dp
3137import androidx.hilt.navigation.compose.hiltViewModel
3238import com.plottwist.core.designsystem.R
3339import com.plottwist.core.designsystem.component.TukTopAppBar
40+ import com.plottwist.core.designsystem.foundation.TukColorTokens.CoralRed500
3441import com.plottwist.core.designsystem.foundation.TukColorTokens.Gray800
42+ import com.plottwist.core.designsystem.foundation.type.TukPretendardTypography
3543import com.plottwist.core.designsystem.foundation.type.TukSerifTypography
3644import com.plottwist.core.domain.model.Gatherings
3745import com.plottwist.core.ui.component.StableImage
3846import com.plottwist.feature.home.component.HomeBottomSheet
47+ import com.plottwist.feature.home.component.HomeBottomSheetAction
3948import com.plottwist.feature.home.component.HomeBottomSheetState
4049import com.plottwist.feature.home.component.HomeContent
4150import com.plottwist.feature.home.component.HomeCreateGatheringPreview
51+ import kotlinx.coroutines.delay
4252import org.orbitmvi.orbit.compose.collectAsState
4353import org.orbitmvi.orbit.compose.collectSideEffect
4454
@@ -55,6 +65,15 @@ fun HomeScreen(
5565) {
5666 val context = LocalContext .current
5767 val state by viewModel.collectAsState()
68+ var isShownNoGatheringsPopup by remember { mutableStateOf(false ) }
69+ var homeBottomSheetAction: HomeBottomSheetAction by remember {
70+ mutableStateOf(HomeBottomSheetAction .IDLE )
71+ }
72+
73+ LaunchedEffect (homeBottomSheetAction) {
74+ delay(200 )
75+ homeBottomSheetAction = HomeBottomSheetAction .IDLE
76+ }
5877
5978 viewModel.collectSideEffect { sideEffect ->
6079 when (sideEffect) {
@@ -84,6 +103,10 @@ fun HomeScreen(
84103 is HomeSideEffect .NavigateToWebViewScreen -> {
85104 navigateToWebView(sideEffect.encodedUrl)
86105 }
106+
107+ HomeSideEffect .ShowNoGatheringsPopup -> {
108+ isShownNoGatheringsPopup = ! isShownNoGatheringsPopup
109+ }
87110 }
88111 }
89112
@@ -94,6 +117,7 @@ fun HomeScreen(
94117 whatLabel = state.whatLabel,
95118 loginState = state.loginState,
96119 gatherings = state.gatherings,
120+ homeBottomSheetAction = homeBottomSheetAction,
97121 onMyPageClick = {
98122 viewModel.handleAction(HomeAction .ClickMyPage )
99123 },
@@ -122,6 +146,35 @@ fun HomeScreen(
122146 viewModel.handleAction(HomeAction .ClickProposals )
123147 }
124148 )
149+
150+ if (isShownNoGatheringsPopup) {
151+ AlertDialog (
152+ text = {
153+ Text (
154+ text = " 아직 만들어진 모임이 없어요.\n " +
155+ " 우리, 먼저 모임부터 만들어볼까요?" ,
156+ style = TukPretendardTypography .body14R
157+ )
158+ },
159+ onDismissRequest = {
160+ isShownNoGatheringsPopup = false
161+ },
162+ confirmButton = {
163+ TextButton (
164+ onClick = {
165+ isShownNoGatheringsPopup = false
166+ homeBottomSheetAction = HomeBottomSheetAction .COLLAPSE
167+ }
168+ ) {
169+ Text (
170+ text = " 확인" ,
171+ style = TukPretendardTypography .body14M,
172+ color = CoralRed500
173+ )
174+ }
175+ },
176+ )
177+ }
125178}
126179
127180@Composable
@@ -131,6 +184,7 @@ private fun HomeScreen(
131184 whenLabel : String ,
132185 whereLabel : String ,
133186 whatLabel : String ,
187+ homeBottomSheetAction : HomeBottomSheetAction ,
134188 onWhenRefreshClick : () -> Unit ,
135189 onWhereRefreshClick : () -> Unit ,
136190 onWhatRefreshClick : () -> Unit ,
@@ -192,6 +246,7 @@ private fun HomeScreen(
192246 whatLabel = whatLabel,
193247 sheetPeekHeight = BOTTOM_SHEET_PEEK_HEIGHT .dp,
194248 sheetFullHeight = BOTTOM_SHEET_FULL_HEIGHT .dp,
249+ homeBottomSheetAction = homeBottomSheetAction,
195250 onWhenRefreshClick = onWhenRefreshClick,
196251 onWhereRefreshClick = onWhereRefreshClick,
197252 onWhatRefreshClick = onWhatRefreshClick,
@@ -303,6 +358,7 @@ fun HomeScreenPreview(modifier: Modifier = Modifier) {
303358 whenLabel = " " ,
304359 whereLabel = " " ,
305360 whatLabel = " " ,
361+ homeBottomSheetAction = HomeBottomSheetAction .IDLE ,
306362 onWhenRefreshClick = { },
307363 onWhereRefreshClick = { },
308364 onWhatRefreshClick = { },
0 commit comments