Skip to content

Commit

Permalink
FEAT: nav 경로 설정 (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
arinming committed Feb 7, 2024
1 parent e76ec04 commit e14d74f
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import com.kusitms.presentation.ui.notice.NoticeScreen
import com.kusitms.presentation.ui.notice.detail.NoticeDetailScreen
import com.kusitms.presentation.ui.notice.search.NoticeSearchScreen
import com.kusitms.presentation.ui.profile.ProfileScreen
import com.kusitms.presentation.ui.profile.edit.ProfileEditScreen
import com.kusitms.presentation.ui.profile.search.ProfileSearchScreen
import com.kusitms.presentation.ui.setting.SettingMember
import com.kusitms.presentation.ui.setting.SettingNonMember
Expand Down Expand Up @@ -271,7 +272,10 @@ fun MainNavigation() {
arguments = NavRoutes.MyProfileDetail.navArguments
) {
MyProfileScreen(
onBack = { navController.navigateUp() }
onBack = { navController.navigateUp() },
onClickModify = {
navController.navigate(NavRoutes.ProfileEdit.route)
}
)
}

Expand Down Expand Up @@ -362,7 +366,10 @@ fun MainNavigation() {
arguments = NavRoutes.ProfileDetail.navArguments
) {
ProfileDetailScreen(
onBack = { navController.navigateUp() }
onBack = { navController.navigateUp() },
onClickModify = {
navController.navigate(NavRoutes.ProfileEdit.route)
}
)
}

Expand All @@ -381,6 +388,9 @@ fun MainNavigation() {
)
}

kusitmsComposableWithAnimation(NavRoutes.ProfileEdit.route) {
ProfileEditScreen()
}


kusitmsComposableWithAnimation(NavRoutes.ImageViewer.route) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,7 @@ sealed class NavRoutes(
fun createRoute(memberId: Int) = "ProfileDetail/${memberId}"
}

object ProfileEdit : NavRoutes(route = "ProfileEdit")

object ImageViewer : NavRoutes("ImageViewer")
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
fun MyProfileScreen(
viewModel: MyProfileViewModel = hiltViewModel(),
onBack: () -> Unit,
onClickModify: () -> Unit
) {
val infoUser = viewModel.infoProfile
val detailMemberInfo by viewModel.detailMemberInfo.collectAsStateWithLifecycle()
Expand All @@ -44,7 +45,9 @@ fun MyProfileScreen(
text = stringResource(id = R.string.profile_detail_edit),
style = KusitmsTypo.current.Text_Medium,
color = KusitmsColorPalette.current.Main400,
modifier = Modifier.clickable { /* 수정 */ }
modifier = Modifier.clickable {
onClickModify()
}
)
}
LazyColumn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
fun ProfileDetailScreen(
viewModel: ProfileDetailViewModel = hiltViewModel(),
onBack: () -> Unit,
onClickModify: () -> Unit
) {
val profile by viewModel.profile.collectAsStateWithLifecycle()
val isMember = viewModel.infoProfile
Expand All @@ -47,14 +48,9 @@ fun ProfileDetailScreen(
text = stringResource(id = R.string.profile_detail_edit),
style = KusitmsTypo.current.Text_Medium,
color = KusitmsColorPalette.current.Main400,
modifier = Modifier.clickable { /* 수정 */ }
)
} else {
Text(
text = stringResource(id = R.string.profile_detail_block),
style = KusitmsTypo.current.Text_Medium,
color = KusitmsColorPalette.current.Grey400,
modifier = Modifier.clickable { /* 차단 */ }
modifier = Modifier.clickable {
onClickModify()
}
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package com.kusitms.presentation.ui.profile.edit

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import com.kusitms.presentation.R
import com.kusitms.presentation.common.ui.KusitsmTopBarBackTextWithIcon
import com.kusitms.presentation.common.ui.theme.KusitmsColorPalette
import com.kusitms.presentation.common.ui.theme.KusitmsTypo

@Composable
fun ProfileEditScreen(
) {
Column {
KusitsmTopBarBackTextWithIcon(
text = stringResource(id = R.string.profile_edit_toolbar),
onBackClick = {},
) {
Text(
text = stringResource(id = R.string.profile_edit_modify),
style = KusitmsTypo.current.Text_Medium,
color = KusitmsColorPalette.current.Main400,
modifier = Modifier.clickable {

}
)
}
LazyColumn(
modifier = Modifier
.fillMaxSize()
.background(KusitmsColorPalette.current.Grey900)
) {

}
}

}

@Preview(showBackground = true, showSystemUi = true)
@Composable
fun ProfileEditScreenPreview() {
ProfileEditScreen()
}
7 changes: 7 additions & 0 deletions presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@
<string name="profile_search_none">궁금한 학회원 프로필을\n검색해보세요</string>


<!-- ProfileEdit-->
<string name="profile_edit_toolbar">프로필 설정</string>
<string name="profile_edit_modify">수정</string>




<string name="bottom_nav_home">홈</string>
<string name="bottom_nav_attendance">출석</string>
<string name="bottom_nav_notice">공지</string>
Expand Down

0 comments on commit e14d74f

Please sign in to comment.