Skip to content

Commit fddd5fa

Browse files
committed
refactor: replace section headers with SectionHeader component in About.kt and Others.kt
1 parent d4ae624 commit fddd5fa

3 files changed

Lines changed: 22 additions & 13 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ fun ProfileScreen(
161161
)
162162

163163
item {
164-
Spacer(Modifier.height(16.dp))
164+
Spacer(Modifier.height(32.dp))
165165
}
166166

167167
settings(
@@ -170,7 +170,7 @@ fun ProfileScreen(
170170
)
171171

172172
item {
173-
Spacer(Modifier.height(16.dp))
173+
Spacer(Modifier.height(32.dp))
174174
}
175175

176176
networkSection(
@@ -179,7 +179,7 @@ fun ProfileScreen(
179179
)
180180

181181
item {
182-
Spacer(Modifier.height(16.dp))
182+
Spacer(Modifier.height(32.dp))
183183
}
184184

185185
othersSection(
@@ -188,7 +188,7 @@ fun ProfileScreen(
188188
)
189189

190190
item {
191-
Spacer(Modifier.height(16.dp))
191+
Spacer(Modifier.height(32.dp))
192192
}
193193

194194
about(
@@ -197,7 +197,7 @@ fun ProfileScreen(
197197
)
198198

199199
item {
200-
Spacer(Modifier.height(16.dp))
200+
Spacer(Modifier.height(32.dp))
201201
}
202202

203203
if (state.isUserLoggedIn) {

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,16 @@ import androidx.compose.ui.unit.dp
3131
import zed.rainxch.githubstore.core.presentation.res.*
3232
import org.jetbrains.compose.resources.stringResource
3333
import zed.rainxch.profile.presentation.ProfileAction
34+
import zed.rainxch.profile.presentation.components.SectionHeader
3435

3536
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
3637
fun LazyListScope.about(
3738
versionName: String,
3839
onAction: (ProfileAction) -> Unit,
3940
) {
4041
item {
41-
Text(
42-
text = stringResource(Res.string.section_about),
43-
style = MaterialTheme.typography.titleSmall,
44-
color = MaterialTheme.colorScheme.outline,
45-
fontWeight = FontWeight.Bold,
46-
modifier = Modifier.padding(start = 8.dp)
42+
SectionHeader(
43+
text = stringResource(Res.string.section_about)
4744
)
4845

4946
Spacer(Modifier.height(8.dp))

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import androidx.compose.foundation.background
44
import androidx.compose.foundation.layout.Arrangement
55
import androidx.compose.foundation.layout.Column
66
import androidx.compose.foundation.layout.Row
7+
import androidx.compose.foundation.layout.Spacer
78
import androidx.compose.foundation.layout.fillMaxWidth
9+
import androidx.compose.foundation.layout.height
810
import androidx.compose.foundation.layout.padding
911
import androidx.compose.foundation.layout.size
1012
import androidx.compose.foundation.lazy.LazyListScope
@@ -22,16 +24,26 @@ import androidx.compose.ui.Modifier
2224
import androidx.compose.ui.draw.clip
2325
import androidx.compose.ui.text.font.FontWeight
2426
import androidx.compose.ui.unit.dp
27+
import org.jetbrains.compose.resources.stringResource
2528
import zed.rainxch.core.presentation.components.ExpressiveCard
29+
import zed.rainxch.githubstore.core.presentation.res.Res
30+
import zed.rainxch.githubstore.core.presentation.res.section_network
2631
import zed.rainxch.profile.presentation.ProfileAction
2732
import zed.rainxch.profile.presentation.ProfileState
33+
import zed.rainxch.profile.presentation.components.SectionHeader
2834

2935
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
3036
fun LazyListScope.othersSection(
3137
state: ProfileState,
3238
onAction: (ProfileAction) -> Unit
3339
) {
3440
item {
41+
SectionHeader(
42+
text = "Storage".uppercase()
43+
)
44+
45+
Spacer(Modifier.height(8.dp))
46+
3547
ExpressiveCard {
3648
Row(
3749
modifier = Modifier
@@ -44,8 +56,8 @@ fun LazyListScope.othersSection(
4456
imageVector = Icons.Outlined.Storage,
4557
contentDescription = null,
4658
modifier = Modifier
47-
.size(48.dp)
48-
.clip(RoundedCornerShape(44.dp))
59+
.size(44.dp)
60+
.clip(RoundedCornerShape(36.dp))
4961
.background(MaterialTheme.colorScheme.surfaceContainerLow)
5062
.padding(8.dp)
5163
)

0 commit comments

Comments
 (0)