Skip to content

Commit

Permalink
Boolti-227 feat: 다이얼로그 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
mangbaam committed May 1, 2024
1 parent 45c4944 commit 9ce7afc
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package com.nexters.boolti.presentation.screen.ticketing

import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
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.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.nexters.boolti.presentation.R
import com.nexters.boolti.presentation.component.BTDialog
import com.nexters.boolti.presentation.theme.BooltiTheme
import com.nexters.boolti.presentation.theme.Grey50

@Composable
fun PaymentFailureDialog(modifier: Modifier = Modifier, onClickButton: () -> Unit) {
BTDialog(
modifier = modifier,
enableDismiss = false,
showCloseButton = false,
positiveButtonLabel = stringResource(R.string.ticketing_again),
onClickPositiveButton = onClickButton,
) {
Text(
text = stringResource(R.string.payment_failed),
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.onSurfaceVariant,
)
Text(
modifier = Modifier.padding(top = 4.dp),
text = stringResource(R.string.payment_failed_description),
textAlign = TextAlign.Center,
style = MaterialTheme.typography.bodySmall,
color = Grey50,
)
}
}

@Preview
@Composable
private fun PaymentFailureDialogPreview() {
BooltiTheme {
Surface {
PaymentFailureDialog {}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ fun TicketingScreen(
val snackbarHostState = remember { SnackbarHostState() }
val uiState by viewModel.uiState.collectAsStateWithLifecycle()
var showConfirmDialog by remember { mutableStateOf(false) }
var showPaymentFailureDialog by remember { mutableStateOf(false) }
val context = LocalContext.current
val uriHandler = LocalUriHandler.current

Expand All @@ -120,7 +121,7 @@ fun TicketingScreen(
}

Activity.RESULT_CANCELED -> {
onBackClicked()
showPaymentFailureDialog = true
}
}
}
Expand Down Expand Up @@ -306,6 +307,12 @@ fun TicketingScreen(
onDismiss = { showConfirmDialog = false },
)
}
if (showPaymentFailureDialog) {
PaymentFailureDialog {
showPaymentFailureDialog = false
onBackClicked()
}
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
<string name="ticketing_confirm_dialog_title">결제 정보를 확인해주세요</string>
<string name="ticketing_address_copied_message">공연장 주소가 복사되었어요</string>
<string name="ticketing_host_format">%s (%s)</string>
<string name="ticketing_again">다시 예매하기</string>
<string name="order_agreement_label">주문내용 확인 및 결제 동의</string>
<string name="order_agreement_privacy_collection">[필수] 개인정보 수집・이용 동의</string>
<string name="order_agreement_privacy_offer">[필수] 개인정보 제 3자 정보 제공 동의</string>
Expand All @@ -181,6 +182,8 @@
<string name="account_transfer_due_date">입금 마감일</string>
<string name="invite_ticket_complete_title">결제를 완료했어요</string>
<string name="invite_ticket_complete_description">예매자 정보 확인 후 티켓이 발권됩니다.</string>
<string name="payment_failed">결제에 실패했어요</string>
<string name="payment_failed_description">예매 진행 중 오류가 발생하였습니다.\n다시 시도해 주세요</string>

<!-- 마이 -->
<string name="my_login">불티 로그인 하러가기</string>
Expand Down

0 comments on commit 9ce7afc

Please sign in to comment.