Skip to content

Commit

Permalink
[feat]: navigate
Browse files Browse the repository at this point in the history
  • Loading branch information
lsakee committed Oct 20, 2024
1 parent bd92e53 commit e1ebc05
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun TopNavigationBar(
)
} else {
modifier
.background(Background)
.background(RecordyTheme.colors.background)
.fillMaxWidth()
.padding(
top = 45.dp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fun MypageRoute(
navigateToFollower: () -> Unit,
navigateToFollowing: () -> Unit,
navigateToUplaod: () -> Unit,
navigateToHome: () -> Unit,
navigateVideoHome: () -> Unit,
navigateToVideo: (VideoType, Long) -> Unit,
) {
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
Expand Down Expand Up @@ -109,7 +109,7 @@ fun MypageRoute(
onLoadMoreRecords = viewModel::loadMoreUserVideos,
onBookmarkClick = viewModel::bookmark,
navigateToUpload = navigateToUplaod,
navigateToHome = navigateToHome,
navigateVideoHome = navigateVideoHome,
)
}
}
Expand All @@ -124,9 +124,9 @@ fun MypageScreen(
onFollowingClick: () -> Unit,
navigateToVideo: (VideoType, Long) -> Unit,
navigateToUpload: () -> Unit,
navigateToHome: () -> Unit,
onLoadMoreRecords: () -> Unit,
onLoadMoreBookmarks: () -> Unit,
navigateVideoHome: () -> Unit,
onBookmarkClick: (Long) -> Unit,
) {
val pagerState = rememberPagerState(
Expand Down Expand Up @@ -229,7 +229,7 @@ fun MypageScreen(
onItemClick = navigateToVideo,
onLoadMore = onLoadMoreBookmarks,
onBookmarkClick = onBookmarkClick,
navigateToHome = navigateToHome,
navigateToVideo = navigateVideoHome,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fun NavGraphBuilder.mypageNavGraph(
navigateToUpload: () -> Unit,
navigateToHome: () -> Unit,
navigateToProfile: (Long) -> Unit,
navigateVideoHome: () -> Unit,
navigateToVideo: (VideoType, Long) -> Unit,
) {
composable(route = MypageRoute.route) {
Expand All @@ -43,7 +44,7 @@ fun NavGraphBuilder.mypageNavGraph(
navigateToFollower = navigateToFollower,
navigateToVideo = navigateToVideo,
navigateToUplaod = navigateToUpload,
navigateToHome = navigateToHome,
navigateVideoHome = navigateVideoHome,
)
}
composable(route = MypageRoute.followingRoute) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fun BookmarkScreen(
onItemClick: (VideoType, Long) -> Unit,
onLoadMore: () -> Unit,
onBookmarkClick: (Long) -> Unit,
navigateToHome: () -> Unit,
navigateToVideo: () -> Unit,
) {
val lazyGridState = rememberLazyGridState()
lazyGridState.OnBottomReached(2) {
Expand Down Expand Up @@ -63,7 +63,7 @@ fun BookmarkScreen(
showButton = true,
selectedTab = MypageTab.BOOKMARK,
onButtonClick = {
navigateToHome()
navigateToVideo()
},
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ internal class MainNavigator(
fun navigateMypage() {
navController.navigateMypage(navOptions { })
}

fun navigateToVideo() {
navController.navigateVideo(null)
}
fun navigateVideoDetail(videoType: VideoType, videoId: Long, keyword: String? = "all", userId: Long = 0) {
navController.navigateVideoDetail(
videoType = videoType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ internal fun MainScreen(
navigateToProfile = navigator::navigateProfile,
navigateToUpload = navigator::navigateToUpload,
navigateToHome = navigator::navigateHome,
navigateVideoHome = navigator::navigateToVideo,
)

settingNavGraph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.record.model.VideoType
import com.record.video.VideoRoute
import com.record.video.videodetail.VideoDetailRoute

fun NavController.navigateVideo(navOptions: NavOptions) {
fun NavController.navigateVideo(navOptions: NavOptions?) {
navigate(VideoRoute.route, navOptions)
}

Expand Down

0 comments on commit e1ebc05

Please sign in to comment.