Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr: SIMT-112 현재 근무위치 표시 #87

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,19 @@ fun NavGraphBuilder.myPageNavigation(
}

composable(
route = SimTongScreen.MyPage.FIX_WORKPLACE,
route = SimTongScreen.MyPage.FIX_WORKPLACE + MyPageDeepLinkKeyUtil.WORK_PLACE + "{work place}",
arguments = listOf(
navArgument(MyPageDeepLinkKeyUtil.WORK_PLACE) {
type = NavType.StringType
defaultValue = ""
}
),
) {
val currentWorkPlace = it.arguments?.getString(MyPageDeepLinkKeyUtil.WORK_PLACE) ?: ""

FixWorkPlaceScreen(
navController = navController,
currentWorkPlace = currentWorkPlace,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import com.comit.core_design_system.modifier.simClickable
import com.comit.core_design_system.typography.Body5
import com.comit.feature_mypage.R
import com.comit.feature_mypage.mvi.MyPageSideEffect
import com.comit.feature_mypage.utils.MyPageDeepLinkKeyUtil
import com.comit.feature_mypage.vm.ImageLimitSizeInKB
import com.comit.feature_mypage.vm.MyPageViewModel
import com.comit.navigator.SimTongScreen
Expand Down Expand Up @@ -154,7 +155,7 @@ fun MyPageScreen(
content = myPageInState.spot,
onClick = {
navController.navigate(
route = SimTongScreen.MyPage.FIX_WORKPLACE,
route = SimTongScreen.MyPage.FIX_WORKPLACE + MyPageDeepLinkKeyUtil.WORK_PLACE + myPageInState.spot,
)
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ private const val CannotChangePlaceTooMuch = "근무지점은 90일 동안 3회
@Composable
fun FixWorkPlaceScreen(
navController: NavController,
currentWorkPlace: String = "",
vm: FixWorkPlaceViewModel = hiltViewModel(),
) {
val toast = rememberToast()
Expand Down Expand Up @@ -109,20 +110,27 @@ fun FixWorkPlaceScreen(

Spacer(modifier = Modifier.height(15.dp))

LazyColumn() {
LazyColumn {
itemsIndexed(fixWorkPlaceState.spotList) { index, item ->
val checkCurrentWorkPlace = item.name == currentWorkPlace
Box(
modifier = Modifier
.height(FixWorkPlaceHeight)
.simSelectable(
selected = isSelect(index),
onClick = {
selectedValue = index
vm.inPutSpotId(UUID.fromString(item.id))
if (!checkCurrentWorkPlace) {
selectedValue = index
vm.inPutSpotId(msg = UUID.fromString(item.id))
}
},
role = Role.RadioButton,
)
) {
val textColor =
if (checkCurrentWorkPlace) SimTongColor.Gray500
else SimTongColor.Gray800

Column(
modifier = Modifier
.padding(
Expand All @@ -133,15 +141,16 @@ fun FixWorkPlaceScreen(

Body4(
text = item.name,
color = SimTongColor.Gray800,
color = textColor,
)

Spacer(modifier = Modifier.height(3.dp))

Body8(
text = item.location,
color = SimTongColor.Gray800,
color = textColor,
)

Canvas(
modifier = Modifier
.fillMaxWidth()
Expand All @@ -165,21 +174,24 @@ fun FixWorkPlaceScreen(
)
}
}
SimRadioButton(
modifier = Modifier
.fillMaxWidth()
.wrapContentWidth(Alignment.End)
.fillMaxHeight()
.wrapContentHeight(Alignment.CenterVertically)
.padding(
end = 33.dp,
),
checked = isSelect(index),
onCheckedChange = {
selectedValue = index
vm.inPutSpotId(UUID.fromString(item.id))
},
)

if (!checkCurrentWorkPlace) {
SimRadioButton(
modifier = Modifier
.fillMaxWidth()
.wrapContentWidth(Alignment.End)
.fillMaxHeight()
.wrapContentHeight(Alignment.CenterVertically)
.padding(
end = 33.dp,
),
checked = isSelect(index),
onCheckedChange = {
selectedValue = index
vm.inPutSpotId(msg = UUID.fromString(item.id))
},
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ package com.comit.feature_mypage.utils

object MyPageDeepLinkKeyUtil {
const val EMAIL = "email"

const val WORK_PLACE = "work place"
}