Skip to content

Commit 6d11f67

Browse files
committed
[Feat/#23] ProfileScreen 뒤로가기 기능
1 parent 29ed280 commit 6d11f67

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

app/src/main/java/com/poti/android/presentation/main/PotiNavHost.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ fun PotiNavHost(
4242
)
4343
profileNavGraph(
4444
paddingValues = paddingValues,
45+
onBackClick = { navigator.navController.popBackStack() },
4546
)
4647
}
4748
}

app/src/main/java/com/poti/android/presentation/user/profile/ProfileScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ data class HistorySummaryUiModel(
3030
)
3131

3232
@Composable
33-
fun ProfileRoute(
33+
fun ProfileScreenRoute(
3434
onBackClick: () -> Unit,
3535
modifier: Modifier = Modifier,
3636
) {

app/src/main/java/com/poti/android/presentation/user/profile/navigation/ProfileNavigation.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
package com.poti.android.presentation.user.profile.navigation
22

33
import androidx.compose.foundation.layout.PaddingValues
4+
import androidx.compose.foundation.layout.padding
5+
import androidx.compose.ui.Modifier
46
import androidx.navigation.NavController
57
import androidx.navigation.NavGraphBuilder
68
import androidx.navigation.compose.composable
79
import com.poti.android.core.navigation.Route
10+
import com.poti.android.presentation.user.profile.ProfileScreenRoute
811
import kotlinx.serialization.Serializable
912

1013
sealed interface ProfileRoute : Route {
@@ -18,6 +21,12 @@ fun NavController.navigateToProfile() {
1821

1922
fun NavGraphBuilder.profileNavGraph(
2023
paddingValues: PaddingValues,
24+
onBackClick: () -> Unit,
2125
) {
22-
composable<ProfileRoute.Profile> { }
26+
composable<ProfileRoute.Profile> {
27+
ProfileScreenRoute(
28+
onBackClick = onBackClick,
29+
modifier = Modifier.padding(paddingValues),
30+
)
31+
}
2332
}

0 commit comments

Comments
 (0)