Skip to content

Commit

Permalink
[chore/#10] UI를 개선합니다.
Browse files Browse the repository at this point in the history
  • Loading branch information
SYAAINN committed Dec 4, 2024
1 parent 189f674 commit e298d38
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ fun NavGraphBuilder.mainNavGraph(
)
}
composable(route = WavveRoute.SETTING) {
SettingRoute()
SettingRoute(
navigateToMyPage = { navController.navigateToMy() }
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fun SearchScreen(
.fillMaxWidth()
.wrapContentHeight()
.clip(shape = RoundedCornerShape(20.dp))
.background(color = Color(0xFF1352F9))
.background(color = if(isInputAvailable) Color(0xFF1352F9) else Color.Gray)
.clickable(
enabled = isInputAvailable,
onClick = { onSearchClick(inputSearch) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,25 @@ import org.sopt.and.ui.theme.ANDANDROIDTheme

@Composable
fun SettingRoute(
mainViewModel: MainViewModel = hiltViewModel()
mainViewModel: MainViewModel = hiltViewModel(),
navigateToMyPage: () -> Unit
) {
val userInfoUpdateState by mainViewModel.userInfoUpdateState.collectAsState()

SettingScreen(
userInfoUpdateState = userInfoUpdateState,
resetUserInfoUpdateState = { mainViewModel.resetUserInfoUpdateState() },
onUserInfoChangeClick = { password, hobby -> mainViewModel.updateUserInfo(password, hobby) }
onUserInfoChangeClick = { password, hobby -> mainViewModel.updateUserInfo(password, hobby) },
navigateToMyPage = navigateToMyPage
)
}

@Composable
fun SettingScreen(
userInfoUpdateState: UserInfoUpdateState,
resetUserInfoUpdateState: () -> Unit,
onUserInfoChangeClick: (String?, String?) -> Unit
onUserInfoChangeClick: (String?, String?) -> Unit,
navigateToMyPage: () -> Unit
) {
val context = LocalContext.current
var inputPassword by remember { mutableStateOf("") }
Expand Down Expand Up @@ -118,6 +121,7 @@ fun SettingScreen(
message = "회원정보 변경에 성공했습니다."
)
resetUserInfoUpdateState()
navigateToMyPage()
}

is UserInfoUpdateState.Failure -> {
Expand All @@ -140,7 +144,8 @@ fun ShowSettingScreen() {
SettingScreen(
userInfoUpdateState = UserInfoUpdateState.Idle,
resetUserInfoUpdateState = {},
onUserInfoChangeClick = { _, _ -> }
onUserInfoChangeClick = { _, _ -> },
navigateToMyPage = {}
)
}
}

0 comments on commit e298d38

Please sign in to comment.