Updated on 2026-08-14

This commit is contained in:
Tangem 2022-12-15 14:16:22 +04:00
parent 25b396f08f
commit 795877a53d
7 changed files with 50 additions and 32 deletions

View file

@ -38,13 +38,23 @@ import com.valentinilk.shimmer.shimmer
* >Figma component</a>
*/
@Composable
fun SmallInfoCard(startText: String, endText: String, isLoading: Boolean = false) {
fun SmallInfoCard(
modifier: Modifier = Modifier,
startText: String,
endText: String,
isLoading: Boolean = false,
) {
Surface(
shape = RoundedCornerShape(TangemTheme.dimens.radius12),
color = TangemTheme.colors.background.primary,
elevation = TangemTheme.dimens.elevation2,
) {
CardInfoBox(startText = startText, endText = endText, isLoading = isLoading)
CardInfoBox(
modifier = modifier,
startText = startText,
endText = endText,
isLoading = isLoading,
)
}
}
@ -60,6 +70,7 @@ fun SmallInfoCard(startText: String, endText: String, isLoading: Boolean = false
*/
@Composable
fun SmallInfoCardWithWarning(
modifier: Modifier = Modifier,
startText: String,
endText: String,
warningText: String,
@ -70,7 +81,7 @@ fun SmallInfoCardWithWarning(
elevation = TangemTheme.dimens.elevation2,
) {
Column(
modifier = Modifier
modifier = modifier
.fillMaxWidth(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
@ -136,6 +147,7 @@ fun SmallInfoCardWithWarning(
*/
@Composable
fun CardWithIcon(
modifier: Modifier = Modifier,
title: String,
description: String,
icon: @Composable () -> Unit,
@ -147,6 +159,7 @@ fun CardWithIcon(
elevation = TangemTheme.dimens.elevation2,
) {
IconWithTitleAndDescription(
modifier = modifier,
title = title,
description = description,
icon = icon,
@ -228,9 +241,14 @@ fun IconWithTitleAndDescription(
// region elements
@Composable
private fun CardInfoBox(startText: String, endText: String, isLoading: Boolean = false) {
private fun CardInfoBox(
modifier: Modifier = Modifier,
startText: String,
endText: String,
isLoading: Boolean = false,
) {
Row(
modifier = Modifier
modifier = modifier
.fillMaxWidth()
.height(TangemTheme.dimens.size48)
.padding(

View file

@ -1,5 +1,6 @@
package com.tangem.core.ui.components.appbar
import androidx.annotation.DrawableRes
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
@ -13,7 +14,6 @@ import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
@ -32,7 +32,7 @@ import com.tangem.core.ui.res.TangemTheme
@Composable
fun AppBarWithBackButton(
text: String? = null,
navigationIcon: Painter? = null,
@DrawableRes iconRes: Int? = null,
onBackClick: () -> Unit,
) {
Row(
@ -44,7 +44,7 @@ fun AppBarWithBackButton(
verticalAlignment = Alignment.CenterVertically,
) {
Icon(
painter = navigationIcon ?: painterResource(R.drawable.ic_back_24),
painter = painterResource(iconRes ?: R.drawable.ic_back_24),
contentDescription = null,
modifier = Modifier
.size(size = dimensionResource(R.dimen.size24))

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#000000"
android:pathData="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" />
</vector>

View file

@ -1,10 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:autoMirrored="true"
android:viewportWidth="40"
android:viewportHeight="40">
<path
android:fillColor="#000000"
android:pathData="M35,11.667L15,31.667L5.833,22.5L8.183,20.15L15,26.95L32.65,9.317L35,11.667Z" />
</vector>

View file

@ -5,6 +5,6 @@
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#1E1E1E"
android:fillColor="#000000"
android:pathData="M9,3L5,7H8V14H10V7H13M16,17V10H14V17H11L15,21L19,17H16Z" />
</vector>

View file

@ -0,0 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="22dp"
android:height="22dp"
android:autoMirrored="true"
android:viewportWidth="22"
android:viewportHeight="22">
<path
android:fillColor="#8247E5"
android:pathData="M11,0L11,0A11,11 0,0 1,22 11L22,11A11,11 0,0 1,11 22L11,22A11,11 0,0 1,0 11L0,11A11,11 0,0 1,11 0z" />
<path
android:fillColor="#ffffff"
android:pathData="M14.614,8.791C14.352,8.647 14.012,8.647 13.724,8.791L11.681,9.896L10.293,10.616L8.25,11.72C7.988,11.864 7.648,11.864 7.36,11.72L5.736,10.856C5.475,10.712 5.291,10.448 5.291,10.16V8.455C5.291,8.167 5.448,7.903 5.736,7.759L7.334,6.919C7.596,6.775 7.936,6.775 8.224,6.919L9.822,7.759C10.083,7.903 10.267,8.167 10.267,8.455V9.56L11.655,8.815V7.711C11.655,7.423 11.498,7.159 11.21,7.015L8.25,5.431C7.988,5.287 7.648,5.287 7.36,5.431L4.348,7.015C4.06,7.159 3.903,7.423 3.903,7.711V10.904C3.903,11.192 4.06,11.456 4.348,11.6L7.36,13.184C7.622,13.328 7.962,13.328 8.25,13.184L10.293,12.104L11.681,11.36L13.724,10.28C13.985,10.136 14.326,10.136 14.614,10.28L16.211,11.12C16.473,11.264 16.656,11.528 16.656,11.816V13.521C16.656,13.809 16.499,14.073 16.211,14.217L14.614,15.081C14.352,15.225 14.012,15.225 13.724,15.081L12.126,14.241C11.864,14.097 11.681,13.833 11.681,13.545V12.44L10.293,13.184V14.289C10.293,14.577 10.45,14.841 10.738,14.985L13.75,16.569C14.012,16.713 14.352,16.713 14.64,16.569L17.652,14.985C17.913,14.841 18.097,14.577 18.097,14.289V11.096C18.097,10.808 17.94,10.544 17.652,10.4L14.614,8.791Z" />
</vector>

View file

@ -1,13 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:autoMirrored="true"
android:viewportWidth="16"
android:viewportHeight="16">
<path
android:fillColor="#8247E5"
android:pathData="M8,16C12.4183,16 16,12.4183 16,8C16,3.5817 12.4183,0 8,0C3.5817,0 0,3.5817 0,8C0,12.4183 3.5817,16 8,16Z" />
<path
android:fillColor="#ffffff"
android:pathData="M10.6283,6.3937C10.4378,6.2889 10.1902,6.2889 9.9808,6.3937L8.4952,7.1968L7.4858,7.7205L6.0003,8.5237C5.8098,8.6284 5.5622,8.6284 5.3527,8.5237L4.1719,7.8951C3.9815,7.7904 3.8482,7.5983 3.8482,7.3888V6.1492C3.8482,5.9397 3.9624,5.7477 4.1719,5.6429L5.3337,5.0319C5.5241,4.9271 5.7717,4.9271 5.9812,5.0319L7.143,5.6429C7.3335,5.7477 7.4668,5.9397 7.4668,6.1492V6.9524L8.4762,6.4111V5.608C8.4762,5.3985 8.3619,5.2064 8.1524,5.1017L6.0003,3.9494C5.8098,3.8447 5.5622,3.8447 5.3527,3.9494L3.1625,5.1017C2.953,5.2064 2.8387,5.3985 2.8387,5.608V7.93C2.8387,8.1395 2.953,8.3316 3.1625,8.4363L5.3527,9.5886C5.5432,9.6934 5.7908,9.6934 6.0003,9.5886L7.4858,8.803L8.4952,8.2618L9.9808,7.4761C10.1712,7.3714 10.4188,7.3714 10.6283,7.4761L11.7901,8.0872C11.9805,8.1919 12.1138,8.384 12.1138,8.5935V9.8331C12.1138,10.0426 11.9996,10.2346 11.7901,10.3394L10.6283,10.9679C10.4378,11.0727 10.1902,11.0727 9.9808,10.9679L8.819,10.3568C8.6285,10.2521 8.4952,10.06 8.4952,9.8505V9.0474L7.4858,9.5886V10.3917C7.4858,10.6013 7.6001,10.7933 7.8096,10.8981L9.9998,12.0504C10.1902,12.1551 10.4378,12.1551 10.6473,12.0504L12.8376,10.8981C13.028,10.7933 13.1613,10.6013 13.1613,10.3917V8.0697C13.1613,7.8602 13.0471,7.6682 12.8376,7.5634L10.6283,6.3937Z" />
</vector>