diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index 0acd668c6e..9bfec2938a 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -357,6 +357,8 @@ Встречайте\nTangem Обменивайте, покупайте NFT, получайте займы и делайте вклады в более чем 100 различных децентрализованных сервисах Поддержка DeFi + Подтверждения считаются отраслевым стандартом для всех децентрализованных бирж и защищают ваш кошелек от доступа со стороны смарт-контракта без вашего разрешения. По замыслу смарт-контракты не могут получить доступ к вашим токенам, если вы не одобрите доступ со своей стороны. «Разблокируя» свои токены, вы даете смарт-контракту 1inch разрешение тратить ваши активы. Майнеры сети получают компенсацию за газ (оплачиваемый вами) за запись этого действия в блокчейне. Как только разрешение будет предоставлено, вы сможете обменять свой токен. + Подтвердить Ошибка: %s Произошла ошибка. Пожалуйста, попробуйте еще раз. Дать разрешение diff --git a/core/res/src/main/res/values-zh-rTW/strings.xml b/core/res/src/main/res/values-zh-rTW/strings.xml index c56ed145f3..d53dd02d89 100644 --- a/core/res/src/main/res/values-zh-rTW/strings.xml +++ b/core/res/src/main/res/values-zh-rTW/strings.xml @@ -350,6 +350,8 @@ 認識Tangem 交易、購買NFT、自由穿梭於100+去中心化服務 兼容DeFi + 批准被視為所有去中心化交易所的行業標準,並保護您的錢包在未經您許可的情況下不被智能合約訪問。按照設計,智能合約無法訪問您的代幣,除非您從您的終端批准訪問。通過“解鎖”您的代幣,您將獲得 1inch 智能合約使用您的資產的權限。網絡的礦工將獲得Gas Fee(由您支付)作為補償,以在區塊鏈上記錄此操作。一旦獲得許可,您就可以交易您的代幣。 + 批准 錯誤: %s 有錯誤。請再試一遍 賦予權限 diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 28ca02b737..66205cf391 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -353,6 +353,8 @@ Meet\nTangem Exchange, buy NFT\'s, make loans and deposits in more than 100 different decentralized services DeFi Compatible + Approvals are considered an industry standard across all decentralized exchanges and protect your wallet from being accessed by a smart contract without your permission. By design, smart contracts can\'t access your tokens unless you approve access from your end. By \"unlocking\" your tokens, you are give permission to the 1inch smart contract to spend your assets. The miners of the network are compensated with a gas fee (paid by you) to record this action on the blockchain. Once permission has been granted you will be able to swap your token. + Approve Error: %s There was an error. Please try again. Give Permission diff --git a/core/ui/src/main/res/drawable/ic_question_24.xml b/core/ui/src/main/res/drawable/ic_question_24.xml new file mode 100644 index 0000000000..1a496d0831 --- /dev/null +++ b/core/ui/src/main/res/drawable/ic_question_24.xml @@ -0,0 +1,9 @@ + + + diff --git a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapPermissionBottomSheetContent.kt b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapPermissionBottomSheetContent.kt index 14933c3004..2e268e7bf0 100644 --- a/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapPermissionBottomSheetContent.kt +++ b/features/swap/presentation/src/main/java/com/tangem/feature/swap/ui/SwapPermissionBottomSheetContent.kt @@ -1,27 +1,19 @@ package com.tangem.feature.swap.ui import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.* import androidx.compose.material.Divider +import androidx.compose.material.Icon +import androidx.compose.material.IconButton import androidx.compose.material.Text -import androidx.compose.runtime.Composable +import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview -import com.tangem.core.ui.components.MiddleEllipsisText -import com.tangem.core.ui.components.PrimaryButtonIconRight -import com.tangem.core.ui.components.SecondaryButton -import com.tangem.core.ui.components.SpacerH10 -import com.tangem.core.ui.components.SpacerH12 -import com.tangem.core.ui.components.SpacerH16 -import com.tangem.core.ui.components.SpacerH28 +import com.tangem.core.ui.components.* import com.tangem.core.ui.components.atoms.Hand import com.tangem.core.ui.res.TangemTheme import com.tangem.feature.swap.models.ApprovePermissionButton @@ -31,6 +23,7 @@ import com.tangem.feature.swap.presentation.R @Composable fun SwapPermissionBottomSheetContent(data: SwapPermissionState.ReadyForRequest, onCancel: () -> Unit) { + var isPermissionAlertShow by remember { mutableStateOf(false) } Column( modifier = Modifier .background(color = TangemTheme.colors.background.primary) @@ -42,11 +35,23 @@ fun SwapPermissionBottomSheetContent(data: SwapPermissionState.ReadyForRequest, SpacerH10() - Text( - text = stringResource(id = R.string.swapping_permission_header), - color = TangemTheme.colors.text.primary1, - style = TangemTheme.typography.subtitle1, - ) + Box(modifier = Modifier.fillMaxWidth()) { + Text( + modifier = Modifier.align(Alignment.Center), + text = stringResource(id = R.string.swapping_permission_header), + color = TangemTheme.colors.text.primary1, + style = TangemTheme.typography.subtitle1, + ) + IconButton( + modifier = Modifier.align(Alignment.CenterEnd), + onClick = { isPermissionAlertShow = true }, + ) { + Icon( + painter = painterResource(id = R.drawable.ic_question_24), + contentDescription = null, + ) + } + } SpacerH10() @@ -85,6 +90,16 @@ fun SwapPermissionBottomSheetContent(data: SwapPermissionState.ReadyForRequest, ) SpacerH16() + + // region dialog + if (isPermissionAlertShow) { + BasicDialog( + message = stringResource(id = R.string.swapping_approve_information_text), + title = stringResource(id = R.string.swapping_approve_information_title), + confirmButton = DialogButton { isPermissionAlertShow = false }, + onDismissDialog = {}, + ) + } } }