Skip to content

Commit 6ecbe25

Browse files
committed
chore(tokens/discovery): update empty states
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 147a5f8 commit 6ecbe25

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

apps/flipcash/core/src/main/res/values/strings.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,10 @@
449449
<string name="label_holdersWithCount">%1$s Holders</string>
450450
<string name="title_discoverFailedToLoad">Couldn\'t Load Currencies</string>
451451
<string name="subtitle_discoverFailedToLoad">Check your connection and try again</string>
452-
<string name="title_discoverEmpty">No currencies found</string>
452+
<string name="title_discoverEmptyPopular">No Popular Currencies</string>
453+
<string name="title_discoverEmptyNew">No New Currencies</string>
453454
<string name="error_discoverFailedToLoad">Check your connection and try again</string>
454-
<string name="subtitle_discoverEmptyNew">Check back soon for new currencies</string>
455+
<string name="subtitle_discoverEmptyNew">No currencies have been created in the last week</string>
455456
<string name="subtitle_discoverEmptyPopular">No popular currencies right now</string>
456457
<string name="action_createYourOwnCurrency">Create Your Own Currency</string>
457458
<string name="prompt_title_notYetAvailable">Not Yet Available</string>

apps/flipcash/features/discovery/src/main/kotlin/com/flipcash/app/discovery/internal/components/TokenLeaderboard.kt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import androidx.compose.runtime.Composable
1616
import androidx.compose.ui.Alignment
1717
import androidx.compose.ui.Modifier
1818
import androidx.compose.ui.res.stringResource
19+
import androidx.compose.ui.text.style.TextAlign
1920
import androidx.compose.ui.unit.coerceAtLeast
2021
import androidx.compose.ui.unit.dp
2122
import com.flipcash.app.core.data.Loadable
@@ -74,8 +75,14 @@ internal fun TokenLeaderboard(
7475
text = stringResource(R.string.title_discoverFailedToLoad),
7576
style = CodeTheme.typography.textLarge,
7677
color = CodeTheme.colors.textMain,
78+
textAlign = TextAlign.Center,
79+
)
80+
Text(
81+
text = tokens.message.orEmpty(),
82+
style = CodeTheme.typography.textSmall,
83+
color = CodeTheme.colors.textSecondary,
84+
textAlign = TextAlign.Center,
7785
)
78-
Text(text = tokens.message.orEmpty())
7986

8087
CodeButton(
8188
onClick = {
@@ -104,16 +111,23 @@ internal fun TokenLeaderboard(
104111
) {
105112
Column(horizontalAlignment = Alignment.CenterHorizontally) {
106113
Text(
107-
text = stringResource(R.string.title_discoverEmpty),
114+
text = when (category) {
115+
DiscoverCategory.Popular -> stringResource(R.string.title_discoverEmptyPopular)
116+
DiscoverCategory.New -> stringResource(R.string.title_discoverEmptyNew)
117+
else -> ""
118+
},
108119
style = CodeTheme.typography.textLarge,
109120
color = CodeTheme.colors.textMain,
121+
textAlign = TextAlign.Center,
110122
)
111123
Text(
124+
modifier = Modifier.fillMaxWidth(0.6f),
112125
text = when (category) {
113126
DiscoverCategory.Popular -> stringResource(R.string.subtitle_discoverEmptyPopular)
114127
DiscoverCategory.New -> stringResource(R.string.subtitle_discoverEmptyNew)
115128
else -> ""
116129
},
130+
textAlign = TextAlign.Center,
117131
style = CodeTheme.typography.textSmall,
118132
color = CodeTheme.colors.textSecondary,
119133
)

0 commit comments

Comments
 (0)