Skip to content

Commit

Permalink
Merge pull request #262 from Team-B1ND/feature/t/261-fix-double-click…
Browse files Browse the repository at this point in the history
…-to-double-request

[Teacher] Fix Double Click to Double Request
  • Loading branch information
8954sood authored Nov 24, 2024
2 parents f6cccd7 + b0263c4 commit ecef903
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,21 @@ private fun AllCard(image: ImageVector, text: String, onClick: () -> Unit) {
Row(
modifier = Modifier
.fillMaxWidth()
.height(40.dp)
.clickable(
interactionSource = remember { MutableInteractionSource() },
indication = rememberBounceIndication(),
onClick = onClick,
)
.padding(8.dp),
.padding(
horizontal = 8.dp,
vertical = 4.dp,
),
verticalAlignment = Alignment.CenterVertically,
) {
Box(
modifier = Modifier
.padding(
start = 8.dp,
top = 4.dp,
bottom = 4.dp,
)
.size(32.dp)
.background(
color = DodamTheme.colors.fillAlternative,
shape = DodamTheme.shapes.extraSmall,
Expand Down Expand Up @@ -222,6 +222,5 @@ private fun AllCard(image: ImageVector, text: String, onClick: () -> Unit) {
contentDescription = null,
colorFilter = ColorFilter.tint(DodamTheme.colors.labelAssistive),
)
Spacer(modifier = Modifier.width(4.dp))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -256,21 +256,27 @@ fun ApproveNightStudyScreen(
DodamButton(
onClick = {
viewModel.reject(state.detailMember.id)
selectedItemIndex = -1
},
text = "거절하기",
buttonSize = ButtonSize.Large,
buttonRole = ButtonRole.Negative,
modifier = Modifier.weight(1f),
buttonRole = ButtonRole.Assistive,
modifier = Modifier.weight(2f),
enabled = state.nightStudyUiState != NightStudyUiState.Loading,
loading = state.nightStudyUiState == NightStudyUiState.Loading,
)
Spacer(modifier = Modifier.width(8.dp))
DodamButton(
onClick = {
viewModel.allow(state.detailMember.id)
selectedItemIndex = -1
},
text = "승인하기",
buttonSize = ButtonSize.Large,
buttonRole = ButtonRole.Primary,
modifier = Modifier.weight(1f),
modifier = Modifier.weight(3f),
enabled = state.nightStudyUiState != NightStudyUiState.Loading,
loading = state.nightStudyUiState == NightStudyUiState.Loading,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ fun ApproveOutScreen(
},
text = "거절하기",
buttonSize = ButtonSize.Large,
buttonRole = ButtonRole.Negative,
modifier = Modifier.weight(1f),
buttonRole = ButtonRole.Assistive,
modifier = Modifier.weight(2f),
enabled = state.outPendingUiState != OutPendingUiState.Loading,
loading = state.outPendingUiState == OutPendingUiState.Loading,
)
Spacer(modifier = Modifier.width(8.dp))
DodamButton(
Expand All @@ -254,7 +256,9 @@ fun ApproveOutScreen(
text = "승인하기",
buttonSize = ButtonSize.Large,
buttonRole = ButtonRole.Primary,
modifier = Modifier.weight(1f),
modifier = Modifier.weight(3f),
enabled = state.outPendingUiState != OutPendingUiState.Loading,
loading = state.outPendingUiState == OutPendingUiState.Loading,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ internal fun PointScreen(viewModel: PointViewModel = koinViewModel(), showSnackb
) {
GiveScreen(
uiState = uiState.uiState,
isNetworkLoading = uiState.isNetworkLoading,
onClickGivePoint = { students, reason ->
viewModel.givePoint(
students = students,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import kotlinx.collections.immutable.toImmutableList
@Composable
internal fun GiveScreen(
uiState: PointLoadingUiState,
isNetworkLoading: Boolean,
onClickGivePoint: (ImmutableList<PointStudentModel>, PointReason) -> Unit,
reload: () -> Unit,
popBackStack: () -> Unit,
Expand Down Expand Up @@ -314,7 +315,7 @@ internal fun GiveScreen(
}
}
}
if (selectReason != null) {
if (selectReason != null && uiState is PointLoadingUiState.Success) {
FakeBottomSheet(
modifier = Modifier.align(Alignment.BottomCenter),
title = {
Expand Down Expand Up @@ -347,13 +348,13 @@ internal fun GiveScreen(
buttonRole = if (nowScoreType == ScoreType.BONUS) ButtonRole.Primary else ButtonRole.Negative,
buttonSize = ButtonSize.Large,
onClick = {
if (uiState is PointLoadingUiState.Success) {
onClickGivePoint(
uiState.students.filter { it.selected }.toImmutableList(),
selectReason!!,
)
}
onClickGivePoint(
uiState.students.filter { it.selected }.toImmutableList(),
selectReason!!,
)
},
enabled = !isNetworkLoading,
loading = isNetworkLoading,
)
},
space = 16.dp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ internal fun SelectScreen(
.fillMaxWidth(),
onClick = onClickNextPage,
text = "${selectUserCount}명 선택하기",
enabled = selectUserCount > 0,
buttonRole = ButtonRole.Primary,
buttonSize = ButtonSize.Large,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,8 @@ fun AuthScreen(
.align(Alignment.BottomCenter),
enabled = idState.value.isNotBlank() &&
passwordState.value.isNotBlank() &&
confirmPasswordState.value.isNotBlank(),
confirmPasswordState.value.isNotBlank() &&
!uiState.isLoading,
onClick = {
viewModel.register(
email = email,
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bottomsheetdialog = "1.3.1"
ktor = "3.0.0-wasm2"
coil = "3.0.0-alpha06"
dds = "0.1.18"
dds-cmm = "1.1.0"
dds-cmm = "1.2.0"
composeinvestigator = "1.5.10-0.2.1"
wheel-picker = "1.1.11"
koin = "3.5.6"
Expand Down

0 comments on commit ecef903

Please sign in to comment.