|
|
@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.height
|
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
|
import androidx.compose.foundation.layout.padding
|
|
|
|
import androidx.compose.material3.Button
|
|
|
|
import androidx.compose.material3.Button
|
|
|
|
import androidx.compose.material3.OutlinedTextField
|
|
|
|
import androidx.compose.material3.OutlinedTextField
|
|
|
|
|
|
|
|
import androidx.compose.material3.OutlinedTextFieldDefaults
|
|
|
|
import androidx.compose.material3.Surface
|
|
|
|
import androidx.compose.material3.Surface
|
|
|
|
import androidx.compose.material3.Text
|
|
|
|
import androidx.compose.material3.Text
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
|
import androidx.compose.runtime.Composable
|
|
|
@ -56,20 +57,22 @@ fun RegisterPage(
|
|
|
|
color = Color.Black
|
|
|
|
color = Color.Black
|
|
|
|
)
|
|
|
|
)
|
|
|
|
Spacer(modifier = Modifier.height(16.dp))
|
|
|
|
Spacer(modifier = Modifier.height(16.dp))
|
|
|
|
errors?.let { message ->
|
|
|
|
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
text = message,
|
|
|
|
text = errors,
|
|
|
|
color = Color.Red,
|
|
|
|
color = Color.Red,
|
|
|
|
fontSize = 14.sp,
|
|
|
|
fontSize = 14.sp,
|
|
|
|
modifier = Modifier.padding(vertical = 8.dp)
|
|
|
|
modifier = Modifier.padding(vertical = 8.dp)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
Spacer(modifier = Modifier.height(16.dp))
|
|
|
|
Spacer(modifier = Modifier.height(16.dp))
|
|
|
|
OutlinedTextField(
|
|
|
|
OutlinedTextField(
|
|
|
|
value = username,
|
|
|
|
value = username,
|
|
|
|
onValueChange = { username = it },
|
|
|
|
onValueChange = { username = it },
|
|
|
|
label = { Text("Nom d'utilisateur") },
|
|
|
|
label = { Text("Nom d'utilisateur") },
|
|
|
|
modifier = Modifier.fillMaxWidth()
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
|
|
|
|
colors = OutlinedTextFieldDefaults.colors(
|
|
|
|
|
|
|
|
focusedTextColor = Color.Black,
|
|
|
|
|
|
|
|
unfocusedTextColor = Color.Black
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
Spacer(modifier = Modifier.height(16.dp))
|
|
|
|
Spacer(modifier = Modifier.height(16.dp))
|
|
|
|
OutlinedTextField(
|
|
|
|
OutlinedTextField(
|
|
|
@ -77,6 +80,10 @@ fun RegisterPage(
|
|
|
|
onValueChange = { password = it },
|
|
|
|
onValueChange = { password = it },
|
|
|
|
label = { Text("Mot de passe") },
|
|
|
|
label = { Text("Mot de passe") },
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
|
|
|
|
colors = OutlinedTextFieldDefaults.colors(
|
|
|
|
|
|
|
|
focusedTextColor = Color.Black,
|
|
|
|
|
|
|
|
unfocusedTextColor = Color.Black
|
|
|
|
|
|
|
|
),
|
|
|
|
visualTransformation = PasswordVisualTransformation()
|
|
|
|
visualTransformation = PasswordVisualTransformation()
|
|
|
|
)
|
|
|
|
)
|
|
|
|
Spacer(modifier = Modifier.height(16.dp))
|
|
|
|
Spacer(modifier = Modifier.height(16.dp))
|
|
|
@ -84,7 +91,11 @@ fun RegisterPage(
|
|
|
|
value = email,
|
|
|
|
value = email,
|
|
|
|
onValueChange = { email = it },
|
|
|
|
onValueChange = { email = it },
|
|
|
|
label = { Text("Email") },
|
|
|
|
label = { Text("Email") },
|
|
|
|
modifier = Modifier.fillMaxWidth()
|
|
|
|
modifier = Modifier.fillMaxWidth(),
|
|
|
|
|
|
|
|
colors = OutlinedTextFieldDefaults.colors(
|
|
|
|
|
|
|
|
focusedTextColor = Color.Black,
|
|
|
|
|
|
|
|
unfocusedTextColor = Color.Black
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
Button(onClick = {
|
|
|
|
Button(onClick = {
|
|
|
|
runBlocking {
|
|
|
|
runBlocking {
|
|
|
|