Skip to content

Commit 70e81cf

Browse files
committed
feat: fix verification issue
1 parent 85980cf commit 70e81cf

File tree

6 files changed

+63
-18
lines changed

6 files changed

+63
-18
lines changed
-5.41 KB
Loading
-127 KB
Loading
23.7 KB
Loading

composeApp/src/commonMain/kotlin/com/rexosphere/leoconnect/presentation/auth/LoginScreen.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.rexosphere.leoconnect.presentation.auth
22

33
import androidx.compose.animation.core.animateDpAsState
4+
import androidx.compose.foundation.Image
45
import androidx.compose.foundation.background
56
import androidx.compose.foundation.isSystemInDarkTheme
67
import androidx.compose.foundation.layout.*
@@ -23,6 +24,7 @@ import com.rexosphere.leoconnect.presentation.MainScreen
2324
import org.jetbrains.compose.resources.painterResource
2425
import leoconnect.composeapp.generated.resources.Res
2526
import leoconnect.composeapp.generated.resources.ic_google_logo
27+
import leoconnect.composeapp.generated.resources.leo_gold
2628
import org.jetbrains.compose.resources.*
2729

2830
class LoginScreen : Screen {
@@ -63,11 +65,10 @@ private fun LoginScreenContent(
6365
verticalArrangement = Arrangement.Center
6466
) {
6567
// App Icon + Name
66-
Text(
67-
text = "\uD83E\uDD81",
68-
fontSize = 82.sp,
69-
fontWeight = FontWeight.ExtraBold,
70-
color = MaterialTheme.colorScheme.primary
68+
Image(
69+
painter = painterResource(Res.drawable.leo_gold),
70+
contentDescription = "Leo Connect Logo",
71+
modifier = Modifier.size(82.dp)
7172
)
7273

7374
Text(

composeApp/src/commonMain/kotlin/com/rexosphere/leoconnect/presentation/home/HomeScreen.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,14 @@ class HomeScreen : Screen {
118118
)
119119

120120
// Tab Row
121-
TabRow(
121+
PrimaryTabRow(
122+
modifier = Modifier
123+
.hazeChild(
124+
state = hazeState,
125+
style = HazeMaterials.thin(MaterialTheme.colorScheme.surface)
126+
),
122127
selectedTabIndex = currentTab.ordinal,
123-
containerColor = MaterialTheme.colorScheme.surface,
128+
containerColor = MaterialTheme.colorScheme.surface.copy(alpha = 0.2f),
124129
contentColor = MaterialTheme.colorScheme.primary
125130
) {
126131
Tab(

composeApp/src/commonMain/kotlin/com/rexosphere/leoconnect/presentation/tabs/ProfileTab.kt

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,56 @@ class ProfileScreen : Screen {
9696
item { ProfileHeader(profile, onSettingsClick = { navigator.push(SettingsScreen()) }) }
9797
item { Spacer(Modifier.height(32.dp)) }
9898

99-
// Menu Items
100-
if (profile.leoId.isNullOrEmpty()) {
99+
// Unverified Warning
100+
if (!profile.isVerified) {
101101
item {
102-
ProfileMenuItem(
103-
icon = CheckBadge,
104-
title = "Verify Leo ID",
105-
subtitle = "Prove you're a real Leo member",
106-
badge = "New",
107-
onClick = { navigator.push(com.rexosphere.leoconnect.presentation.verifyleoid.VerifyLeoIdScreen()) }
108-
)
102+
Surface(
103+
modifier = Modifier
104+
.fillMaxWidth()
105+
.padding(horizontal = 24.dp, vertical = 8.dp),
106+
color = MaterialTheme.colorScheme.errorContainer,
107+
shape = RoundedCornerShape(12.dp)
108+
) {
109+
Row(
110+
modifier = Modifier.padding(16.dp),
111+
verticalAlignment = Alignment.CenterVertically
112+
) {
113+
Icon(
114+
ExclamationTriangle,
115+
contentDescription = null,
116+
tint = MaterialTheme.colorScheme.error,
117+
modifier = Modifier.size(24.dp)
118+
)
119+
Spacer(Modifier.width(12.dp))
120+
Column(modifier = Modifier.weight(1f)) {
121+
Text(
122+
text = "Account Not Verified",
123+
style = MaterialTheme.typography.titleSmall,
124+
fontWeight = FontWeight.Bold,
125+
color = MaterialTheme.colorScheme.error
126+
)
127+
Spacer(Modifier.height(4.dp))
128+
Text(
129+
text = "You cannot create posts until your Leo ID is verified.",
130+
style = MaterialTheme.typography.bodySmall,
131+
color = MaterialTheme.colorScheme.onErrorContainer
132+
)
133+
}
134+
}
135+
}
109136
}
137+
item { Spacer(Modifier.height(8.dp)) }
138+
}
139+
140+
// Menu Items
141+
item {
142+
ProfileMenuItem(
143+
icon = CheckBadge,
144+
title = "Verify Leo ID",
145+
subtitle = "Prove you're a real Leo member",
146+
badge = if (!profile.isVerified) "Required" else null,
147+
onClick = { navigator.push(com.rexosphere.leoconnect.presentation.verifyleoid.VerifyLeoIdScreen()) }
148+
)
110149
}
111150

112151

@@ -190,7 +229,7 @@ private fun ProfileHeader(profile: UserProfile, onSettingsClick: () -> Unit) {
190229
fontSize = 28.sp
191230
)
192231
)
193-
if (!profile.leoId.isNullOrEmpty()) {
232+
if (profile.isVerified) {
194233
Spacer(Modifier.width(8.dp))
195234
Icon(
196235
CheckBadge,
@@ -210,7 +249,7 @@ private fun ProfileHeader(profile: UserProfile, onSettingsClick: () -> Unit) {
210249
Spacer(Modifier.height(12.dp))
211250

212251
// Leo ID Badge
213-
if (!profile.leoId.isNullOrEmpty()) {
252+
if (!profile.leoId.isNullOrEmpty() && profile.isVerified) {
214253
Surface(
215254
color = MaterialTheme.colorScheme.primary.copy(alpha = 0.1f),
216255
shape = RoundedCornerShape(20.dp)

0 commit comments

Comments
 (0)