Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ internal fun LabsScreenContent(viewModel: LabsScreenViewModel) {
).sheetResignmentBehavior(state),
contentPadding = PaddingValues(bottom = CodeTheme.dimens.grid.x3),
) {
item {
item(contentType = "section_header") {
SectionHeader(stringResource(R.string.title_settingsSectionFeatures))
}
items(betaFlags, key = { it.flag.key }) { feature ->
items(betaFlags, key = { it.flag.key }, contentType = { "feature_flag" }) { feature ->
if (feature.flag.isOptionFlag) {
SettingsOptionRow(
title = feature.flag.title,
Expand Down Expand Up @@ -87,7 +87,7 @@ internal fun LabsScreenContent(viewModel: LabsScreenViewModel) {
}

if (betaFlags.isEmpty()) {
item {
item(contentType = "empty_state") {
Box {
Column(
modifier = Modifier.align(Alignment.Center),
Expand All @@ -113,8 +113,8 @@ internal fun LabsScreenContent(viewModel: LabsScreenViewModel) {
}
}

item { SectionHeader(stringResource(R.string.title_settingsSectionHomeScreen)) }
item {
item(contentType = "section_header") { SectionHeader(stringResource(R.string.title_settingsSectionHomeScreen)) }
item(contentType = "list_item") {
ListItem(
headline = stringResource(R.string.title_settingsButtonOrder),
icon = painterResource(R.drawable.ic_bottom_navigation),
Expand All @@ -124,8 +124,8 @@ internal fun LabsScreenContent(viewModel: LabsScreenViewModel) {
}

if (isStaff) {
item { SectionHeader(stringResource(R.string.title_settingsSectionDeveloper)) }
item {
item(contentType = "section_header") { SectionHeader(stringResource(R.string.title_settingsSectionDeveloper)) }
item(contentType = "list_item") {
ListItem(
headline = stringResource(R.string.subtitle_settingsUserFlags),
icon = rememberVectorPainter(Icons.Default.Token),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ internal fun UserProfileScreenContent(
) {
LazyColumn(modifier = Modifier.fillMaxSize()) {
// Display Name section
item { SectionHeader(stringResource(R.string.title_sectionDisplayName)) }
item {
item(contentType = "section_header") { SectionHeader(stringResource(R.string.title_sectionDisplayName)) }
item(contentType = "profile_value") {
val name = state.displayName
if (!name.isNullOrEmpty()) {
ProfileValueRow(value = name)
Expand All @@ -51,8 +51,8 @@ internal fun UserProfileScreenContent(
}

// Phone section
item { SectionHeader(stringResource(R.string.title_sectionPhone)) }
item {
item(contentType = "section_header") { SectionHeader(stringResource(R.string.title_sectionPhone)) }
item(contentType = "contact_method") {
if (state.phoneNumber != null) {
ContactMethodRow(
value = state.phoneNumber,
Expand All @@ -71,8 +71,8 @@ internal fun UserProfileScreenContent(
}

// Email section
item { SectionHeader(stringResource(R.string.title_sectionEmail)) }
item {
item(contentType = "section_header") { SectionHeader(stringResource(R.string.title_sectionEmail)) }
item(contentType = "contact_method") {
if (state.emailAddress != null) {
ContactMethodRow(
value = state.emailAddress,
Expand All @@ -89,9 +89,9 @@ internal fun UserProfileScreenContent(
}

// Social Accounts section
item { SectionHeader(stringResource(R.string.title_sectionSocialAccounts)) }
item(contentType = "section_header") { SectionHeader(stringResource(R.string.title_sectionSocialAccounts)) }
if (state.socialAccounts.isEmpty()) {
item {
item(contentType = "empty_state") {
Text(
text = stringResource(R.string.subtitle_noSocialAccounts),
style = CodeTheme.typography.textMedium,
Expand All @@ -103,7 +103,7 @@ internal fun UserProfileScreenContent(
)
}
} else {
items(state.socialAccounts, key = { (it as? SocialAccount.TwitterX)?.id ?: it }) { account ->
items(state.socialAccounts, key = { (it as? SocialAccount.TwitterX)?.id ?: it }, contentType = { "social_account" }) { account ->
when (account) {
is SocialAccount.TwitterX -> SocialAccountRow(
account = account,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,21 @@ private fun UserFlagsEditor(
contentPadding = PaddingValues(bottom = CodeTheme.dimens.grid.x3),
) {
// Read-only section
item { SectionHeader("Read-Only") }
item(contentType = "section_header") { SectionHeader("Read-Only") }
items(
items = state.readOnlyEntries,
key = { it.label },
contentType = { "read_only_row" },
) { entry ->
ReadOnlyRow(entry)
}

// Editable section
item { SectionHeader("Overridable") }
item(contentType = "section_header") { SectionHeader("Overridable") }
items(
items = state.editableEntries,
key = { it.field.label },
contentType = { "editable_row" },
) { entry ->
EditableRow(
modifier = Modifier.fillMaxWidth(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,19 @@ fun TokenList(
state = listState
) {
if (tokens != null && tokens.isEmpty() && emptyState != null) {
item {
item(contentType = "empty_state") {
emptyState()
}
} else {
header?.let { content ->
item {
item(contentType = "header") {
content()
}
}
items(
items = filteredTokens.orEmpty(),
key = { item -> item.token.address.base58() }) { item ->
key = { item -> item.token.address.base58() },
contentType = { "token_row" }) { item ->
TokenBalanceRow(
modifier = Modifier
.fillParentMaxWidth()
Expand All @@ -113,7 +114,7 @@ fun TokenList(
Fiat(0.0, cashReserves.rate.currency)
)
) {
item {
item(contentType = "reserves") {
it(Mint.usdf, cashReserves)
HorizontalDivider(
modifier = Modifier.padding(bottom = CodeTheme.dimens.inset),
Expand All @@ -124,7 +125,7 @@ fun TokenList(
}

footer?.let {
item {
item(contentType = "footer") {
Box(modifier = Modifier.alpha(if (footerSettled) 1f else 0f)) {
it(false)
}
Expand Down
Loading