Skip to content

Commit

Permalink
Made some changes in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
aritra-tech committed May 5, 2024
1 parent 86ec0e0 commit 1ae4136
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,9 @@ fun LoginContent(
) {

val context = LocalContext.current
var email by remember {
mutableStateOf("")
}

var password by remember {
mutableStateOf("")
}

var passwordVisibility by remember {
mutableStateOf(false)
}
var email by remember { mutableStateOf("") }
var password by remember { mutableStateOf("") }
var passwordVisibility by remember { mutableStateOf(false) }

Scaffold(
modifier = modifier.fillMaxSize()
Expand All @@ -126,7 +118,7 @@ fun LoginContent(
) {

Text(
text = "Log In",
text = stringResource(R.string.log_in),
fontSize = 40.sp,
fontWeight = FontWeight.Bold,
fontFamily = DMSansFontFamily,
Expand Down Expand Up @@ -193,7 +185,7 @@ fun LoginContent(
// enabled = false
)

Spacer(modifier = Modifier.height(15.dp))
Spacer(modifier = Modifier.weight(1f))

Row(
modifier = Modifier.fillMaxWidth(),
Expand All @@ -205,6 +197,7 @@ fun LoginContent(
)

Spacer(modifier = Modifier.width(8.dp))

Text(
modifier = Modifier.onClick {
context.findActivity()?.apply {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package com.geekymusketeers.uncrack.presentation.auth.signup

import android.app.Activity
import android.content.Intent
import android.os.Bundle
import android.widget.Space
import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
Expand All @@ -13,6 +17,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
Expand All @@ -25,6 +30,7 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
Expand All @@ -37,11 +43,14 @@ import com.geekymusketeers.uncrack.R
import com.geekymusketeers.uncrack.components.UCButton
import com.geekymusketeers.uncrack.components.UCTextField
import com.geekymusketeers.uncrack.presentation.auth.AuthViewModel
import com.geekymusketeers.uncrack.presentation.auth.login.LoginScreens
import com.geekymusketeers.uncrack.ui.theme.DMSansFontFamily
import com.geekymusketeers.uncrack.ui.theme.OnPrimaryContainerLight
import com.geekymusketeers.uncrack.ui.theme.PrimaryLight
import com.geekymusketeers.uncrack.ui.theme.UnCrackTheme
import com.geekymusketeers.uncrack.ui.theme.medium16
import com.geekymusketeers.uncrack.util.UtilsKt.findActivity
import com.geekymusketeers.uncrack.util.onClick
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.FirebaseUser
import com.google.firebase.auth.ktx.auth
Expand Down Expand Up @@ -70,6 +79,7 @@ class SignupScreen : ComponentActivity() {
var newUser by remember { mutableStateOf(auth.currentUser) }
authViewModel = hiltViewModel()
SignupContent(
this@SignupScreen,
authViewModel,
onSignUp = { signUpUser ->
newUser = signUpUser
Expand All @@ -82,11 +92,13 @@ class SignupScreen : ComponentActivity() {

@Composable
fun SignupContent(
activity: Activity,
authViewModel: AuthViewModel,
modifier: Modifier = Modifier,
onSignUp: (FirebaseUser) -> Unit
) {

val context = LocalContext.current
var name by remember { mutableStateOf("") }
var email by remember { mutableStateOf("") }
var password by remember { mutableStateOf("") }
Expand All @@ -103,7 +115,7 @@ fun SignupContent(
) {

Text(
text = "Sign Up",
text = stringResource(R.string.sign_up),
fontSize = 40.sp,
fontWeight = FontWeight.Bold,
fontFamily = DMSansFontFamily,
Expand Down Expand Up @@ -179,15 +191,25 @@ fun SignupContent(
// enabled = false
)

Spacer(modifier = Modifier.height(10.dp))
Spacer(modifier = Modifier.weight(1f))

Row {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.Center
) {
Text(
text = stringResource(id = R.string.already_have_an_account),
style = medium16.copy(color = OnPrimaryContainerLight)
)

Spacer(modifier = Modifier.width(8.dp))

Text(
modifier = Modifier.onClick {
context.findActivity()?.apply {
startActivity(Intent(activity, LoginScreens::class.java))
}
},
text = stringResource(id = R.string.login),
style = medium16.copy(color = PrimaryLight)
)
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@
<string name="portfolio">Portfolio</string>
<string name="communication">Communication</string>
<string name="crowdsourcing">Crowdsourcing</string>
<string name="log_in">Log In</string>
<string name="sign_up">Sign Up</string>
<string-array name="accounts">
<item>Others</item>
<item>PayPal</item>
Expand Down

0 comments on commit 1ae4136

Please sign in to comment.