-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #69 from PetJournal/feature/change-to-new-security…
…-code-screen-designer Feature/change to new security code screen designer
- Loading branch information
Showing
13 changed files
with
244 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...ior/petjournal/ui/screens_app/account_manager/awaitingCodeScreen/AwaitingCodeFormEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package com.soujunior.petjournal.ui.screens_app.account_manager.awaitingCodeScreen | ||
|
||
sealed class AwaitingCodeFormEvent { | ||
data class CodeOTPChanged (val code: String) : com.soujunior.petjournal.ui.screens_app.account_manager.awaitingCodeScreen.AwaitingCodeFormEvent() | ||
data class EmailChanged (val email: String) : com.soujunior.petjournal.ui.screens_app.account_manager.awaitingCodeScreen.AwaitingCodeFormEvent() | ||
object Submit : com.soujunior.petjournal.ui.screens_app.account_manager.awaitingCodeScreen.AwaitingCodeFormEvent() | ||
object ResendCode : com.soujunior.petjournal.ui.screens_app.account_manager.awaitingCodeScreen.AwaitingCodeFormEvent() | ||
data class CodeOTPChanged(val code: String) : AwaitingCodeFormEvent() | ||
data class EmailChanged(val email: String) : AwaitingCodeFormEvent() | ||
object Submit : AwaitingCodeFormEvent() | ||
object ResendCode : AwaitingCodeFormEvent() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 35 additions & 25 deletions
60
...ujunior/petjournal/ui/screens_app/account_manager/awaitingCodeScreen/components/Footer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,57 @@ | ||
package com.soujunior.petjournal.ui.screens_app.account_manager.awaitingCodeScreen.components | ||
|
||
import androidx.compose.foundation.isSystemInDarkTheme | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material3.ButtonDefaults | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.collectAsState | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.navigation.NavController | ||
import com.soujunior.petjournal.R | ||
import com.soujunior.petjournal.ui.components.Button2 | ||
import com.soujunior.petjournal.ui.components.Button3 | ||
import com.soujunior.petjournal.ui.screens_app.account_manager.awaitingCodeScreen.AwaitingCodeFormEvent | ||
import com.soujunior.petjournal.ui.screens_app.account_manager.awaitingCodeScreen.AwaitingCodeViewModel | ||
import com.soujunior.petjournal.ui.states.TaskState | ||
import ir.kaaveh.sdpcompose.sdp | ||
|
||
@Composable | ||
fun Footer(navController: NavController, viewModel: AwaitingCodeViewModel) { | ||
val buttonIsEnable by viewModel.buttonIsEnable.collectAsState() | ||
val taskState by viewModel.taskState.collectAsState() | ||
|
||
Spacer(modifier = Modifier.padding(20.dp)) | ||
Button2( | ||
text = "Enviar", | ||
border = null, | ||
submit = { viewModel.onEvent(com.soujunior.petjournal.ui.screens_app.account_manager.awaitingCodeScreen.AwaitingCodeFormEvent.Submit) }, | ||
enableButton = buttonIsEnable, | ||
modifier = Modifier.size(height = 50.dp, width = 240.dp), | ||
buttonColor = ButtonDefaults.buttonColors( | ||
containerColor = MaterialTheme.colorScheme.primary | ||
), | ||
isLoading = taskState is TaskState.Loading | ||
) | ||
Spacer(modifier = Modifier.padding(5.dp)) | ||
//TODO("Extrair string") | ||
Text( | ||
text = "Dica: Caso não encontre o e-mail na sua caixa de entrada, verifique a pasta de Spam!", | ||
style = MaterialTheme.typography.titleLarge, | ||
textAlign = TextAlign.Center, | ||
color = if (isSystemInDarkTheme()) MaterialTheme.colorScheme.primary else Color.Unspecified | ||
) | ||
val isDarkMode = isSystemInDarkTheme() | ||
Spacer(modifier = Modifier.padding(10.sdp)) | ||
Row { | ||
Button3( | ||
submit = { navController.popBackStack() }, | ||
enableButton = true, | ||
modifier = Modifier | ||
.weight(1f) | ||
.padding(end = 5.sdp), | ||
text = stringResource(R.string.back), | ||
buttonColor = ButtonDefaults.buttonColors( | ||
MaterialTheme.colorScheme.surface | ||
), | ||
textColor = MaterialTheme.colorScheme.primary | ||
) | ||
Button2( | ||
buttonColor = if (isDarkMode) ButtonDefaults.buttonColors(MaterialTheme.colorScheme.onPrimary) | ||
else ButtonDefaults.buttonColors(MaterialTheme.colorScheme.primary), | ||
text = stringResource(R.string.send), | ||
border = null, | ||
textColor = if (isDarkMode) MaterialTheme.colorScheme.primary else Color.White, | ||
submit = { viewModel.onEvent(AwaitingCodeFormEvent.Submit) }, | ||
enableButton = buttonIsEnable, | ||
modifier = Modifier | ||
.weight(1f) | ||
.padding(start = 5.sdp), | ||
isLoading = taskState is TaskState.Loading | ||
) | ||
} | ||
} |
33 changes: 9 additions & 24 deletions
33
...ujunior/petjournal/ui/screens_app/account_manager/awaitingCodeScreen/components/Header.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,21 @@ | ||
package com.soujunior.petjournal.ui.screens_app.account_manager.awaitingCodeScreen.components | ||
|
||
import androidx.compose.foundation.isSystemInDarkTheme | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.unit.dp | ||
import com.soujunior.petjournal.ui.components.CreateTitleAndImageLogo | ||
import com.soujunior.petjournal.R | ||
import com.soujunior.petjournal.ui.components.HeaderImageLogoImagePasswordAndTitle | ||
import ir.kaaveh.sdpcompose.sdp | ||
|
||
@Composable | ||
fun Header() { | ||
CreateTitleAndImageLogo( | ||
title = "Acabamos de enviar um código para seu e-mail", | ||
spaceBetween = 16.dp, | ||
textAlign = TextAlign.Center | ||
|
||
) | ||
|
||
Spacer(modifier = Modifier.padding(16.dp)) | ||
|
||
Text( | ||
text = "Insira no campo abaixo o código de verificação de 6 digitos enviado para o seu email.", | ||
style = MaterialTheme.typography.titleLarge, | ||
HeaderImageLogoImagePasswordAndTitle( | ||
title = stringResource(R.string.txt_we_just_sent_a_code_to_your_email), | ||
spaceBetween = 10.sdp, | ||
subText = stringResource(R.string.txt_enter_the_6_digit_verification_code_sent_to_your_email_in_the_field_below), | ||
textAlign = TextAlign.Center, | ||
color = if (isSystemInDarkTheme()) MaterialTheme.colorScheme.primary else Color.Unspecified | ||
styleTitle = MaterialTheme.typography.bodyMedium | ||
) | ||
|
||
Spacer(modifier = Modifier.padding(32.dp)) | ||
|
||
|
||
} |
Oops, something went wrong.