Updated on 2026-08-14

This commit is contained in:
Tangem 2023-10-10 12:07:39 +05:00
parent 519f5332f1
commit 8962f8d333
27 changed files with 87 additions and 76 deletions

View file

@ -22,7 +22,6 @@ import com.tangem.core.ui.components.SpacerH4
import com.tangem.core.ui.extensions.resolveReference
import com.tangem.core.ui.res.TangemColorPalette
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemTypography
import com.tangem.feature.learn2earn.impl.R
import com.tangem.feature.learn2earn.presentation.ui.component.GradientCircle
import com.tangem.feature.learn2earn.presentation.ui.state.MainScreenState
@ -70,13 +69,13 @@ internal fun GetBonusView(state: MainScreenState, modifier: Modifier = Modifier)
) {
Text(
text = state.description.title.resolveReference(),
style = TangemTypography.body1,
style = TangemTheme.typography.body1,
color = TangemTheme.colors.text.primary2,
)
SpacerH4()
Text(
text = state.description.subtitle.resolveReference(),
style = TangemTypography.caption,
style = TangemTheme.typography.caption2,
color = TangemTheme.colors.text.tertiary,
)
}

View file

@ -17,7 +17,6 @@ import com.tangem.core.ui.components.SecondaryButton
import com.tangem.core.ui.components.SpacerH16
import com.tangem.core.ui.components.SpacerH32
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemTypography
import com.tangem.feature.learn2earn.impl.R
import com.tangem.feature.learn2earn.presentation.ui.component.GradientCircle
@ -106,7 +105,7 @@ private fun StoryDescription(headerText: String, bodyText: String, modifier: Mod
Text(
text = bodyText,
textAlign = TextAlign.Center,
style = TangemTypography.subtitle1,
style = TangemTheme.typography.subtitle1,
color = TangemTheme.colors.text.tertiary,
)
}

View file

@ -112,7 +112,7 @@ private fun PhraseBlock(state: ImportSeedPhraseState, modifier: Modifier = Modif
Text(
modifier = Modifier.fillMaxSize(),
text = message,
style = TangemTheme.typography.caption.copy(
style = TangemTheme.typography.caption2.copy(
color = TangemTheme.colors.text.warning,
),
)

View file

@ -26,7 +26,7 @@ internal fun AgreementText(@StringRes firstPartResId: Int, onClick: () -> Unit)
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = TangemTheme.dimens.spacing54),
style = TangemTheme.typography.caption.copy(textAlign = TextAlign.Center),
style = TangemTheme.typography.caption2.copy(textAlign = TextAlign.Center),
maxLines = 2,
onClick = {
val clickableSpanStyle = requireNotNull(agreementText.spanStyles.getOrNull(1))

View file

@ -150,7 +150,7 @@ private fun TokenItem(token: TokenToSelect, network: Network, onTokenClick: () -
SpacerW2()
Text(
text = token.symbol,
style = TangemTheme.typography.caption,
style = TangemTheme.typography.caption2,
color = TangemTheme.colors.text.tertiary,
)
}
@ -160,7 +160,7 @@ private fun TokenItem(token: TokenToSelect, network: Network, onTokenClick: () -
if (!token.available) {
Text(
text = stringResource(id = R.string.swapping_token_not_available),
style = TangemTheme.typography.caption,
style = TangemTheme.typography.caption2,
color = TangemTheme.colors.text.tertiary,
)
} else if (token.addedTokenBalanceData != null) {
@ -177,7 +177,7 @@ private fun TokenItem(token: TokenToSelect, network: Network, onTokenClick: () -
SpacerW2()
Text(
text = token.addedTokenBalanceData.amount.orEmpty(),
style = TangemTheme.typography.caption,
style = TangemTheme.typography.caption2,
color = TangemTheme.colors.text.tertiary,
)
}

View file

@ -59,24 +59,22 @@ internal class TokenDetailsLoadedBalanceConverter(
return when (status.value) {
is CryptoCurrencyStatus.NoQuote,
is CryptoCurrencyStatus.Loaded,
-> {
TokenDetailsBalanceBlockState.Content(
actionButtons = currentState.actionButtons,
fiatBalance = formatFiatAmount(status.value, appCurrencyProvider()),
cryptoBalance = formatCryptoAmount(status),
)
}
is CryptoCurrencyStatus.Loading -> {
TokenDetailsBalanceBlockState.Loading(currentState.actionButtons)
}
-> TokenDetailsBalanceBlockState.Content(
actionButtons = currentState.actionButtons,
fiatBalance = formatFiatAmount(status.value, appCurrencyProvider()),
cryptoBalance = formatCryptoAmount(status),
)
is CryptoCurrencyStatus.NoAccount -> TokenDetailsBalanceBlockState.Content(
actionButtons = currentState.actionButtons,
fiatBalance = formatFiatAmount(status.value, appCurrencyProvider()),
cryptoBalance = formatCryptoAmount(status),
)
is CryptoCurrencyStatus.Loading -> TokenDetailsBalanceBlockState.Loading(currentState.actionButtons)
is CryptoCurrencyStatus.MissedDerivation,
is CryptoCurrencyStatus.NoAccount,
is CryptoCurrencyStatus.Custom,
is CryptoCurrencyStatus.NoAmount,
is CryptoCurrencyStatus.Unreachable,
-> {
TokenDetailsBalanceBlockState.Error(currentState.actionButtons)
}
-> TokenDetailsBalanceBlockState.Error(currentState.actionButtons)
}
}

View file

@ -112,13 +112,13 @@ private fun CryptoBalance(
is TokenDetailsBalanceBlockState.Content -> Text(
modifier = modifier,
text = if (isBalanceHidden) STARS else state.cryptoBalance,
style = TangemTheme.typography.caption,
style = TangemTheme.typography.caption2,
color = TangemTheme.colors.text.tertiary,
)
is TokenDetailsBalanceBlockState.Error -> Text(
modifier = modifier,
text = BigDecimalFormatter.EMPTY_BALANCE_SIGN,
style = TangemTheme.typography.caption,
style = TangemTheme.typography.caption2,
color = TangemTheme.colors.text.tertiary,
)
}

View file

@ -34,7 +34,7 @@ internal fun TokenInfoBlock(state: TokenInfoBlockState, modifier: Modifier = Mod
) {
Text(
text = state.name,
style = TangemTheme.typography.h1,
style = TangemTheme.typography.head,
color = TangemTheme.colors.text.primary1,
)
NetworkInfoText(state.currency)
@ -63,7 +63,7 @@ private fun NetworkInfoText(currency: TokenInfoBlockState.Currency) {
Text(
text = stringResource(id = R.string.common_main_network),
color = TangemTheme.colors.text.tertiary,
style = TangemTheme.typography.caption,
style = TangemTheme.typography.caption2,
)
}
is TokenInfoBlockState.Currency.Token -> {
@ -74,7 +74,7 @@ private fun NetworkInfoText(currency: TokenInfoBlockState.Currency) {
val state = extractNetwork(tokenCurrency = currency)
Text(
text = state.normalText,
style = TangemTheme.typography.caption,
style = TangemTheme.typography.caption2,
color = TangemTheme.colors.text.tertiary,
)
Icon(
@ -85,7 +85,7 @@ private fun NetworkInfoText(currency: TokenInfoBlockState.Currency) {
)
Text(
text = state.boldText,
style = TangemTheme.typography.caption.copy(fontWeight = FontWeight.Medium),
style = TangemTheme.typography.caption2.copy(fontWeight = FontWeight.Medium),
color = TangemTheme.colors.text.primary1,
)
}

View file

@ -14,7 +14,6 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemTypography
import com.tangem.feature.wallet.impl.R
import com.tangem.feature.wallet.presentation.common.state.TokenItemState
import org.burnoutcrew.reorderable.ReorderableLazyListState
@ -73,6 +72,6 @@ private fun NonFiatContentText(@StringRes text: Int) {
color = TangemTheme.colors.text.tertiary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = TangemTypography.body2,
style = TangemTheme.typography.body2,
)
}

View file

@ -11,7 +11,6 @@ import androidx.compose.ui.text.style.TextOverflow
import com.tangem.common.Strings
import com.tangem.core.ui.components.RectangleShimmer
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemTypography
import com.tangem.feature.wallet.impl.R
import com.tangem.feature.wallet.presentation.common.state.TokenItemState.CryptoAmountState as TokenCryptoAmountState
@ -49,7 +48,7 @@ private fun CryptoAmountText(amount: String, modifier: Modifier = Modifier) {
color = TangemTheme.colors.text.tertiary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = TangemTypography.body2,
style = TangemTheme.typography.body2,
)
}

View file

@ -10,7 +10,6 @@ import androidx.compose.ui.text.style.TextOverflow
import com.tangem.common.Strings
import com.tangem.core.ui.components.RectangleShimmer
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemTypography
import com.tangem.feature.wallet.presentation.common.state.TokenItemState.FiatAmountState as TokenFiatAmountState
@Composable
@ -40,7 +39,7 @@ private fun FiatAmountText(text: String, modifier: Modifier = Modifier) {
color = TangemTheme.colors.text.primary1,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = TangemTypography.body2,
style = TangemTheme.typography.body2,
)
}

View file

@ -15,7 +15,6 @@ import com.tangem.core.ui.components.RectangleShimmer
import com.tangem.core.ui.components.SpacerW4
import com.tangem.core.ui.components.marketprice.PriceChangeType
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemTypography
import com.tangem.feature.wallet.impl.R
import com.tangem.feature.wallet.presentation.common.state.TokenItemState
import com.tangem.feature.wallet.presentation.common.state.TokenItemState.PriceChangeState as TokenPriceChangeState
@ -87,7 +86,7 @@ private fun PriceChangeText(type: PriceChangeType?, text: String?) {
},
overflow = TextOverflow.Ellipsis,
maxLines = 1,
style = TangemTypography.body2,
style = TangemTheme.typography.body2,
)
}
}

View file

@ -15,7 +15,6 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextOverflow
import com.tangem.core.ui.components.RectangleShimmer
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemTypography
import com.tangem.feature.wallet.impl.R
import com.tangem.feature.wallet.presentation.common.state.TokenItemState.TitleState as TokenTitleState
@ -63,7 +62,7 @@ private fun CurrencyNameText(name: String, modifier: Modifier = Modifier) {
color = TangemTheme.colors.text.primary1,
overflow = TextOverflow.Ellipsis,
maxLines = 1,
style = TangemTypography.subtitle2,
style = TangemTheme.typography.subtitle2,
)
}

View file

@ -361,7 +361,7 @@ private fun AdditionalInfoText(text: TextReference) {
color = TangemTheme.colors.text.tertiary,
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = TangemTheme.typography.caption,
style = TangemTheme.typography.caption2,
)
}

View file

@ -82,7 +82,7 @@ private fun LazyListScope.nonContentItem(modifier: Modifier = Modifier) {
modifier = Modifier.padding(horizontal = TangemTheme.dimens.spacing48),
color = TangemTheme.colors.text.tertiary,
textAlign = TextAlign.Center,
style = TangemTheme.typography.caption,
style = TangemTheme.typography.caption2,
)
}
}