Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ internal fun InstructorMainNavHost(
navigateToMatching = {
navController.navigate(route = InstructorMatching())
},
navigateToHome = {
navController.navigate(
route = InstructorHome,
navOptions = navController.clearBackStackNavOptions(),
)
}
)
instructorProfileNavGraph(
paddingValues = paddingValues,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class PushNotificationService : FirebaseMessagingService() {
)
}
val notification = NotificationCompat.Builder(this, DEFAULT_CHANNEL_ID)
.setSmallIcon(android.R.drawable.ic_dialog_info)
.setSmallIcon(R.drawable.ic_stat_name)
.setContentTitle(title)
.setContentText(body)
.apply { pendingIntent?.let { setContentIntent(it) } }
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
Expand Down Expand Up @@ -99,10 +100,6 @@ private fun SsingBottomBarItem(

Column(
modifier = modifier
.background(
color = if (isPressed) SSINGTheme.colors.borderDisabled else Color.Transparent,
shape = RoundedCornerShape(12.dp),
)
.clickable(
interactionSource = interactionSource,
indication = null,
Expand All @@ -111,15 +108,25 @@ private fun SsingBottomBarItem(
.padding(top = 8.dp, bottom = 12.dp),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Icon(
imageVector = ImageVector.vectorResource(iconRes),
contentDescription = stringResource(tab.titleRes),
tint = textColor,
)
Text(
text = stringResource(tab.titleRes),
style = SSINGTheme.typography.caption.md11,
color = textColor,
)
Column(
modifier = Modifier
.widthIn(min = 40.dp)
.background(
color = if (isPressed) SSINGTheme.colors.borderDisabled else Color.Transparent,
shape = RoundedCornerShape(12.dp),
),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Icon(
imageVector = ImageVector.vectorResource(iconRes),
contentDescription = stringResource(tab.titleRes),
tint = textColor,
)
Text(
text = stringResource(tab.titleRes),
style = SSINGTheme.typography.caption.md11,
color = textColor,
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ internal fun ConsumerMatchingPendingScreen(
tags = state.tags,
location = state.location,
duration = state.duration,
price = state.price,
equipmentStatus = "착용 완료",
borderColor = SSINGTheme.colors.borderAlternative,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,20 @@ import com.ssing.presentation.instructorlessondetail.model.LessonDetailBeforeUiM
import com.ssing.presentation.instructorlessondetail.model.LessonDetailCanceledUiModel
import com.ssing.presentation.instructorlessondetail.model.LessonDetailCompletedUiModel
import com.ssing.presentation.instructorlessondetail.model.LessonDetailOngoingUiModel
import com.ssing.presentation.instructorlessondetail.model.TeamParticipantsInfo
import com.ssing.presentation.instructorlessondetail.screen.CancelReasonState
import kotlinx.collections.immutable.persistentListOf

internal interface LessonDetailContract {

@Immutable
data class State(
val phase: LessonDetailPhase = LessonDetailPhase.LessonDetailBefore(
before = LessonDetailBeforeUiModel(
isInstructorReady = false,
participantReadyCount = 2,
participantTotalCount = 5,
tags = persistentListOf("스노보드", "자격증이 있어요"),
classTitle = "김OO님 팀, 홍지민님 팀 총 5명",
location = "OOO 리조트",
duration = "0시간",
price = 0,
teams = persistentListOf(
TeamParticipantsInfo(
teamNickname = "김OO",
teamCount = 0,
participants = persistentListOf("38세 남", "12세 여", "9세 남"),
price = 0,
isReady = true,
),
TeamParticipantsInfo(
teamNickname = "김OO",
teamCount = 0,
participants = persistentListOf("38세 남", "12세 여", "9세 남"),
price = 0,
isReady = false,
),
),
),
),
val phase: LessonDetailPhase = LessonDetailPhase.LessonDetailInit,
val showReadyDialog: Boolean = false,
val showLessonEndDialog: Boolean = false,
val cancelReasonState: CancelReasonState = CancelReasonState(),
)

sealed interface LessonDetailPhase {
data object Loading : LessonDetailPhase
data object LessonDetailInit : LessonDetailPhase
data class LessonDetailBefore(val before: LessonDetailBeforeUiModel) : LessonDetailPhase
data class LessonDetailOngoing(val ongoing: LessonDetailOngoingUiModel) : LessonDetailPhase
data class LessonDetailCompleted(val completed: LessonDetailCompletedUiModel) :
Expand All @@ -62,7 +33,7 @@ internal interface LessonDetailContract {
}

sealed interface Effect {
data object NavigateBack : Effect
data object NavigateToHome : Effect
data object NavigateToMatching : Effect
data class ShowToast(val message: String) : Effect
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ internal class LessonDetailViewModel @Inject constructor(
}

private fun loadLessonDetail() {
updateState { copy(phase = LessonDetailContract.LessonDetailPhase.Loading) }

viewModelScope.launch {
instructorLessonDetailRepository.fetchInstructorLessonDetail(lessonId)
.onSuccess { result ->
Expand Down Expand Up @@ -117,12 +115,12 @@ internal class LessonDetailViewModel @Inject constructor(
if (it is ApiException) {
sendEffect(LessonDetailContract.Effect.ShowToast(it.uiMessage))
}
sendEffect(LessonDetailContract.Effect.NavigateBack)
sendEffect(LessonDetailContract.Effect.NavigateToHome)
}
}
}

fun onBackClick() = sendEffect(LessonDetailContract.Effect.NavigateBack)
fun onBackClick() = sendEffect(LessonDetailContract.Effect.NavigateToHome)

fun onMatchingClick() = sendEffect(LessonDetailContract.Effect.NavigateToMatching)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import com.ssing.presentation.instructorlessondetail.screen.LessonDetailRoute
import kotlinx.serialization.Serializable

@Serializable
data class InstructorLesson(val lessonId :Long): Route
data class InstructorLesson(val lessonId: Long) : Route

fun NavGraphBuilder.instructorLessonNavGraph(
paddingValues: PaddingValues,
navController: NavController,
navigateToMatching: () -> Unit,
navigateToHome: () -> Unit,
) {
composable<InstructorLesson>(
deepLinks = listOf(
Expand All @@ -24,6 +25,7 @@ fun NavGraphBuilder.instructorLessonNavGraph(
) {
LessonDetailRoute(
navigateBack = navController::popBackStack,
navigateToHome = navigateToHome,
navigateToMatching = navigateToMatching,
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ssing.presentation.instructorlessondetail.screen

import androidx.activity.compose.BackHandler
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
Expand All @@ -19,6 +20,7 @@ import com.ssing.presentation.instructorlessondetail.LessonDetailViewModel
internal fun LessonDetailRoute(
navigateBack: () -> Unit,
navigateToMatching: () -> Unit,
navigateToHome: () -> Unit,
modifier: Modifier = Modifier,
viewModel: LessonDetailViewModel = hiltViewModel(),
) {
Expand All @@ -28,11 +30,19 @@ internal fun LessonDetailRoute(
HandleUiEffects(viewModel.uiEffect) { effect ->
when (effect) {
is LessonDetailContract.Effect.ShowToast -> context.toast(effect.message)
LessonDetailContract.Effect.NavigateBack -> navigateBack()
LessonDetailContract.Effect.NavigateToHome -> navigateToHome()
LessonDetailContract.Effect.NavigateToMatching -> navigateToMatching()
}
}

BackHandler {
when {
state.showReadyDialog -> viewModel.onReadyDialogDismiss()
state.showLessonEndDialog -> viewModel.onLessonEndDialogDismiss()
else -> navigateToHome()
}
}

LessonDetailScreen(
state = state,
onBackClick = viewModel::onBackClick,
Expand Down Expand Up @@ -76,7 +86,7 @@ private fun LessonDetailScreen(
modifier: Modifier = Modifier,
) {
when (val phase = state.phase) {
is LessonDetailPhase.Loading -> {}
is LessonDetailPhase.LessonDetailInit -> {}

is LessonDetailPhase.LessonDetailBefore -> LessonDetailBeforeScreen(
before = phase.before,
Expand Down
Loading