Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into fix/#188-place-det…
Browse files Browse the repository at this point in the history
…ail-dropdown-visible
  • Loading branch information
Roel4990 committed Jan 24, 2025
2 parents 08a7387 + ca00ffc commit fb972a4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.spoony.spoony.presentation.map.navigaion.Map
import com.spoony.spoony.presentation.map.navigaion.navigateToMap
import com.spoony.spoony.presentation.map.search.navigation.navigateToMapSearch
import com.spoony.spoony.presentation.placeDetail.navigation.navigateToPlaceDetail
import com.spoony.spoony.presentation.register.navigation.Register
import com.spoony.spoony.presentation.register.navigation.navigateToRegister
import com.spoony.spoony.presentation.report.navigation.navigateToReport

Expand Down Expand Up @@ -64,12 +65,22 @@ class MainNavigator(
}

fun navigateToExplore(
navOptions: NavOptions? = navOptions {
popUpTo(Explore) {
inclusive = false
fromRegister: Boolean = false,
navOptions: NavOptions? = if (fromRegister) {
navOptions {
popUpTo(Register) {
inclusive = true
}
launchSingleTop = true
}
} else {
navOptions {
popUpTo(Explore) {
inclusive = false
}
restoreState = true
launchSingleTop = true
}
restoreState = true
launchSingleTop = true
}
) {
navController.navigateToExplore(navOptions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fun MainScreen(

registerNavGraph(
paddingValues = paddingValues,
navigateToExplore = navigator::navigateToExplore
navigateToExplore = { navigator.navigateToExplore(fromRegister = true) }
)

placeDetailNavGraph(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ class RegisterViewModel @Inject constructor(
viewModelScope.launch {
_state.update { currentState ->
RegisterState(
categories = currentState.categories
categories = currentState.categories,
showRegisterSnackBar = false
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,23 @@ import com.spoony.spoony.core.designsystem.type.ButtonStyle
@Composable
fun NextButton(
enabled: Boolean,
modifier: Modifier = Modifier,
onClick: () -> Unit
onClick: () -> Unit,
modifier: Modifier = Modifier
) {
var isClicked by remember { mutableStateOf(false) }

SpoonyButton(
text = "다음",
size = ButtonSize.Xlarge,
style = ButtonStyle.Primary,
modifier = modifier.fillMaxWidth(),
enabled = enabled,
onClick = onClick
enabled = enabled && !isClicked,
onClick = {
if (!isClicked) {
isClicked = true
onClick()
}
}
)
}

Expand Down

0 comments on commit fb972a4

Please sign in to comment.