Skip to content

Commit

Permalink
[FEAT/#204] 버튼 캘린더로 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyobeen-Park committed Sep 9, 2024
1 parent f103667 commit ec25157
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 8 additions & 3 deletions feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.flowWithLifecycle
import androidx.navigation.NavHostController
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.terning.feature.home.home.component.HomeFilteringBottomSheet
import com.terning.core.designsystem.component.bottomsheet.SortingBottomSheet
import com.terning.core.designsystem.component.button.SortingButton
import com.terning.core.designsystem.component.image.TerningImage
Expand All @@ -52,8 +51,10 @@ import com.terning.domain.entity.home.HomeFilteringInfo
import com.terning.domain.entity.home.HomeRecommendIntern
import com.terning.domain.entity.home.HomeUpcomingIntern
import com.terning.feature.R
import com.terning.feature.calendar.calendar.navigation.navigateCalendar
import com.terning.feature.dialog.cancel.ScrapCancelDialog
import com.terning.feature.dialog.detail.ScrapDialog
import com.terning.feature.home.home.component.HomeFilteringBottomSheet
import com.terning.feature.home.home.component.HomeFilteringScreen
import com.terning.feature.home.home.component.HomeRecommendEmptyIntern
import com.terning.feature.home.home.component.HomeUpcomingEmptyFilter
Expand Down Expand Up @@ -101,6 +102,7 @@ fun HomeRoute(
HomeScreen(
paddingValues = paddingValues,
navigateToIntern = { navController.navigateIntern(announcementId = it) },
navigateToCalendar = { navController.navigateCalendar() },
viewModel = viewModel,
)
}
Expand All @@ -110,6 +112,7 @@ fun HomeRoute(
fun HomeScreen(
paddingValues: PaddingValues,
navigateToIntern: (Long) -> Unit,
navigateToCalendar: () -> Unit,
viewModel: HomeViewModel,
) {
val homeState by viewModel.homeState.collectAsStateWithLifecycle()
Expand Down Expand Up @@ -221,7 +224,8 @@ fun HomeScreen(
ShowUpcomingIntern(
homeUpcomingInternState = homeState.homeUpcomingInternState,
homeState = homeState,
navigateToIntern = { navigateToIntern(it) }
navigateToIntern = { navigateToIntern(it) },
navigateToCalendar = navigateToCalendar,
)
}
}
Expand Down Expand Up @@ -390,11 +394,12 @@ private fun ShowUpcomingIntern(
homeUpcomingInternState: UiState<List<HomeUpcomingIntern>>,
homeState: HomeState,
navigateToIntern: (Long) -> Unit,
navigateToCalendar: () -> Unit,
) {
when (homeUpcomingInternState) {
is UiState.Success -> {
if (homeUpcomingInternState.data.isEmpty()) {
HomeUpcomingEmptyIntern()
HomeUpcomingEmptyIntern(navigateToCalendar = navigateToCalendar)
} else {
HomeUpcomingInternScreen(
internList = homeUpcomingInternState.data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ import com.terning.core.designsystem.theme.TerningMain
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.theme.White
import com.terning.core.extension.customShadow
import com.terning.core.extension.noRippleClickable
import com.terning.feature.R

@Composable
fun HomeUpcomingEmptyIntern(
modifier: Modifier = Modifier,
navigateToCalendar: () -> Unit,
) {
Column(
modifier = modifier
Expand Down Expand Up @@ -64,7 +66,8 @@ fun HomeUpcomingEmptyIntern(
width = 1.dp,
color = TerningMain,
shape = RoundedCornerShape(12.dp),
),
)
.noRippleClickable(navigateToCalendar),
) {
Text(
text = stringResource(id = R.string.home_upcoming_check_schedule),
Expand Down

0 comments on commit ec25157

Please sign in to comment.