Skip to content

Commit

Permalink
[FEATURE] #141 : CodeValidationDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
tgyuuAn committed Feb 27, 2024
1 parent 01e77a0 commit fe29342
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ import androidx.compose.material3.SnackbarHostState
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -68,6 +71,7 @@ internal fun SignUpScreen(
val snackBarHostState = remember { SnackbarHostState() }
val keyboardController = LocalSoftwareKeyboardController.current
val focusManager = LocalFocusManager.current
var showCodeValidationDialog by remember { mutableStateOf(false) }

LaunchedEffect(true) {
viewModel.signUpEventFlow.collectLatest {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package com.wap.wapp.feature.auth.signup.component

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Card
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.unit.dp
import androidx.compose.ui.window.Dialog
import com.wap.designsystem.WappTheme
import com.wap.designsystem.component.WappButton
import com.wap.designsystem.component.WappTextField
import com.wap.wapp.feature.auth.R

@Composable
internal fun CodeValidationDialog(
code: String,
setValidationCode: (String) -> Unit,
onConfirmRequest: () -> Unit,
onDismissRequest: () -> Unit,
) {
Dialog(
onDismissRequest = onDismissRequest,
) {
Card(shape = RoundedCornerShape(10.dp)) {
Column(
modifier = Modifier
.fillMaxWidth()
.background(color = WappTheme.colors.black25)
.padding(10.dp),
) {
Text(
text = stringResource(R.string.sign_up_dialog_title),
style = WappTheme.typography.titleBold,
color = WappTheme.colors.white,
textAlign = TextAlign.Center,
)

Text(
text = stringResource(R.string.sign_up_dialog_content),
style = WappTheme.typography.captionMedium,
color = WappTheme.colors.white,
textAlign = TextAlign.Center,
)

Spacer(modifier = Modifier.padding(vertical = 8.dp))

WappTextField(
value = code,
onValueChanged = setValidationCode,
label = R.string.code,
isError = false,
supportingText = "",
)

Spacer(modifier = Modifier.padding(vertical = 8.dp))

WappButton(
onClick = onConfirmRequest,
isEnabled = code.isNotBlank(),
modifier = Modifier.padding(horizontal = 32.dp),
)
}
}
}
}
3 changes: 3 additions & 0 deletions feature/auth/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
<string name="sign_up_registered_at_hint">입부년도 입력</string>
<string name="sign_up_registered_at_caption">회원님의 기수 정보를 알려드릴게요!</string>
<string name="sign_up_registered_at_description">Door Icon</string>
<string name="sign_up_dialog_title">회원 코드를 입력하세요</string>
<string name="sign_up_dialog_content">WAP회원만 해당 내용을 확인할 수 있어요.</string>
<string name="first_semester">1학기</string>
<string name="second_semester">2학기</string>
<string name="done">완료</string>
<string name="code">code</string>
</resources>

0 comments on commit fe29342

Please sign in to comment.