Skip to content

Commit 754831b

Browse files
committed
style(ui): Refine UI components and layout in profile screen
This commit updates various UI components in the profile feature to improve visual consistency and spacing. It standardizes corner radii, adjusts paddings for better layout flow, and refines the logout dialog's appearance and behavior. - **style(ui)**: Standardized `RoundedCornerShape` to 32.dp across `Account`, `About`, `Network`, and `Options` sections. - **style(ui)**: Increased `SnackbarHost` bottom padding to prevent overlap with navigation. - **style(ui)**: Adjusted `ProfileRoot` list spacing and bottom padding to account for the bottom navigation height. - **style(ui)**: Refined `LogoutDialog` with bold headers, increased spacing, and disabled click-outside dismissal. - **style(ui)**: Improved layout of `AboutItem` and `OptionsItem` with adjusted horizontal padding and spacing. - **fix(ui)**: Removed redundant `shapes` parameter from `IconButton` in the `Account` section.
1 parent 1a5d9ed commit 754831b

6 files changed

Lines changed: 30 additions & 20 deletions

File tree

feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/ProfileRoot.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ fun ProfileRoot(
108108
ProfileAction.OnStarredReposClick -> {
109109
onNavigateToStarredRepos()
110110
}
111-
111+
112112
is ProfileAction.OnRepositoriesClick -> {
113113
onNavigateToDevProfile(action.username)
114114
}
@@ -146,7 +146,7 @@ fun ProfileScreen(
146146
snackbarHost = {
147147
SnackbarHost(
148148
hostState = snackbarState,
149-
modifier = Modifier.padding(bottom = bottomNavHeight)
149+
modifier = Modifier.padding(bottom = bottomNavHeight + 16.dp)
150150
)
151151
},
152152
topBar = {
@@ -193,18 +193,18 @@ fun ProfileScreen(
193193
onAction = onAction
194194
)
195195

196-
if (state.isUserLoggedIn) {
197-
item {
198-
Spacer(Modifier.height(16.dp))
199-
}
196+
item {
197+
Spacer(Modifier.height(16.dp))
198+
}
200199

200+
if (state.isUserLoggedIn) {
201201
logout(
202202
onAction = onAction
203203
)
204204
}
205205

206206
item {
207-
Spacer(Modifier.height(64.dp))
207+
Spacer(Modifier.height(bottomNavHeight + 32.dp))
208208
}
209209
}
210210
}

feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/LogoutDialog.kt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ import androidx.compose.runtime.Composable
1818
import androidx.compose.ui.Alignment
1919
import androidx.compose.ui.Modifier
2020
import androidx.compose.ui.draw.clip
21+
import androidx.compose.ui.text.font.FontWeight
2122
import androidx.compose.ui.unit.dp
23+
import androidx.compose.ui.window.DialogProperties
2224
import zed.rainxch.githubstore.core.presentation.res.*
2325
import org.jetbrains.compose.resources.stringResource
2426

@@ -31,18 +33,24 @@ fun LogoutDialog(
3133
) {
3234
BasicAlertDialog(
3335
onDismissRequest = onDismissRequest,
36+
properties = DialogProperties(
37+
dismissOnClickOutside = false,
38+
usePlatformDefaultWidth = false
39+
),
3440
modifier = modifier
41+
.padding(16.dp)
3542
.clip(RoundedCornerShape(24.dp))
3643
.background(MaterialTheme.colorScheme.surfaceContainerHigh)
3744
.padding(16.dp)
3845
) {
3946
Column (
40-
verticalArrangement = Arrangement.spacedBy(6.dp)
47+
verticalArrangement = Arrangement.spacedBy(8.dp)
4148
) {
4249
Text(
4350
text = stringResource(Res.string.warning),
4451
style = MaterialTheme.typography.titleLarge,
45-
color = MaterialTheme.colorScheme.onSurface
52+
color = MaterialTheme.colorScheme.onSurface,
53+
fontWeight = FontWeight.Bold
4654
)
4755

4856
Text(
@@ -54,7 +62,7 @@ fun LogoutDialog(
5462
Row(
5563
modifier = Modifier.fillMaxWidth(),
5664
verticalAlignment = Alignment.CenterVertically,
57-
horizontalArrangement = Arrangement.End
65+
horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.End)
5866
) {
5967
TextButton(
6068
onClick = {

feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/About.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,13 @@ fun LazyListScope.about(
4949
Spacer(Modifier.height(8.dp))
5050

5151
ElevatedCard(
52-
modifier = Modifier.fillMaxWidth(),
52+
modifier = Modifier
53+
.fillMaxWidth()
54+
.padding(4.dp),
5355
colors = CardDefaults.elevatedCardColors(
5456
containerColor = MaterialTheme.colorScheme.surfaceContainerHigh
5557
),
56-
shape = RoundedCornerShape(16.dp)
58+
shape = RoundedCornerShape(32.dp)
5759
) {
5860
AboutItem(
5961
icon = Icons.Filled.Info,
@@ -63,6 +65,7 @@ fun LazyListScope.about(
6365
text = versionName,
6466
style = MaterialTheme.typography.titleSmall,
6567
color = MaterialTheme.colorScheme.outline,
68+
modifier = Modifier.padding(horizontal = 8.dp)
6669
)
6770
}
6871
)

feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Account.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fun LazyListScope.logout(
4242
colors = CardDefaults.elevatedCardColors(
4343
containerColor = MaterialTheme.colorScheme.errorContainer
4444
),
45-
shape = RoundedCornerShape(16.dp),
45+
shape = RoundedCornerShape(32.dp),
4646
onClick = {
4747
onAction(ProfileAction.OnLogoutClick)
4848
}
@@ -52,7 +52,6 @@ fun LazyListScope.logout(
5252
title = stringResource(Res.string.logout),
5353
actions = {
5454
IconButton(
55-
shapes = IconButtonDefaults.shapes(),
5655
onClick = {
5756
onAction(ProfileAction.OnLogoutClick)
5857
},

feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Network.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private fun ProxyTypeCard(
111111
colors = CardDefaults.elevatedCardColors(
112112
containerColor = MaterialTheme.colorScheme.surfaceContainer
113113
),
114-
shape = RoundedCornerShape(20.dp)
114+
shape = RoundedCornerShape(32.dp)
115115
) {
116116
Column(
117117
modifier = Modifier.padding(16.dp)
@@ -123,7 +123,7 @@ private fun ProxyTypeCard(
123123
fontWeight = FontWeight.SemiBold
124124
)
125125

126-
Spacer(Modifier.height(12.dp))
126+
Spacer(Modifier.height(8.dp))
127127

128128
LazyRow(
129129
modifier = Modifier.fillMaxWidth(),
@@ -173,7 +173,7 @@ private fun ProxyDetailsCard(
173173
colors = CardDefaults.elevatedCardColors(
174174
containerColor = MaterialTheme.colorScheme.surfaceContainer
175175
),
176-
shape = RoundedCornerShape(20.dp)
176+
shape = RoundedCornerShape(32.dp)
177177
) {
178178
Column(
179179
modifier = Modifier.padding(16.dp),

feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation/components/sections/Options.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ private fun OptionCard(
8080
disabledContentColor = MaterialTheme.colorScheme.onSurface.copy(alpha = .7f),
8181
),
8282
onClick = onClick,
83-
shape = RoundedCornerShape(36.dp),
83+
shape = RoundedCornerShape(32.dp),
8484
border = BorderStroke(
8585
width = .5.dp,
8686
color = MaterialTheme.colorScheme.surface
8787
),
8888
enabled = enabled
8989
) {
9090
Row(
91-
modifier = Modifier.padding(horizontal = 12.dp),
91+
modifier = Modifier.padding(horizontal = 16.dp),
9292
verticalAlignment = Alignment.CenterVertically,
93-
horizontalArrangement = Arrangement.spacedBy(8.dp)
93+
horizontalArrangement = Arrangement.spacedBy(4.dp)
9494
) {
9595
Icon(
9696
imageVector = icon,

0 commit comments

Comments
 (0)