diff --git a/scripts/deleteLocalizations.js b/scripts/deleteLocalizations.js new file mode 100644 index 000000000..e7ff83bff --- /dev/null +++ b/scripts/deleteLocalizations.js @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: ice License 1.0 + +const fs = require('fs'); +const path = require('path'); + +function deletePropertyPath(obj, propPath) { + if (!propPath) { + return; + } + + const props = propPath.split('.'); + for (let i = 0; i < props.length - 1; i++) { + obj = obj[props[i]]; + if (typeof obj === 'undefined') { + return; + } + } + delete obj[props.pop()]; +} + +function deleteFromJsonFiles(propPath, jsonFilesDirectory) { + if ( + !fs.existsSync(jsonFilesDirectory) || + !fs.statSync(jsonFilesDirectory).isDirectory() + ) { + console.error(`Error: Directory does not exist at ${jsonFilesDirectory}`); + return; + } + + fs.readdirSync(jsonFilesDirectory).forEach(file => { + if (file.endsWith('.json')) { + const jsonFilePath = path.join(jsonFilesDirectory, file); + let jsonData = JSON.parse(fs.readFileSync(jsonFilePath, 'utf8') || '{}'); + deletePropertyPath(jsonData, propPath); + + fs.writeFileSync(jsonFilePath, JSON.stringify(jsonData, null, 2) + '\n'); + console.log(`Updated ${file}`); + } + }); + + console.log('JSON files updated successfully.'); +} + +// Example usage: node deleteLocalizations.js 'bsc_address.walletAction' +const args = process.argv.slice(2); + +if (args.length !== 2) { + console.log( + 'Usage: node deleteLocalizations.js ', + ); +} else { + const propPath = args[0]; + const jsonFilesDirectory = args[1]; + deleteFromJsonFiles(propPath, jsonFilesDirectory); +} diff --git a/src/assets/images/card/okxWallet.png b/src/assets/images/card/okxWallet.png deleted file mode 100755 index c53092173..000000000 Binary files a/src/assets/images/card/okxWallet.png and /dev/null differ diff --git a/src/assets/images/card/okxWallet@2x.png b/src/assets/images/card/okxWallet@2x.png deleted file mode 100755 index 2d9a9c265..000000000 Binary files a/src/assets/images/card/okxWallet@2x.png and /dev/null differ diff --git a/src/assets/images/card/okxWallet@3x.png b/src/assets/images/card/okxWallet@3x.png deleted file mode 100755 index 12cf850ff..000000000 Binary files a/src/assets/images/card/okxWallet@3x.png and /dev/null differ diff --git a/src/assets/images/card/wallet.png b/src/assets/images/card/wallet.png new file mode 100644 index 000000000..0223a6ef7 Binary files /dev/null and b/src/assets/images/card/wallet.png differ diff --git a/src/assets/images/card/wallet@2x.png b/src/assets/images/card/wallet@2x.png new file mode 100644 index 000000000..fc8d8ca46 Binary files /dev/null and b/src/assets/images/card/wallet@2x.png differ diff --git a/src/assets/images/card/wallet@3x.png b/src/assets/images/card/wallet@3x.png new file mode 100644 index 000000000..3d868977f Binary files /dev/null and b/src/assets/images/card/wallet@3x.png differ diff --git a/src/assets/images/index.ts b/src/assets/images/index.ts index 898475680..c827e29d2 100644 --- a/src/assets/images/index.ts +++ b/src/assets/images/index.ts @@ -190,7 +190,7 @@ export const Images = { }, card: { joinMainnet: require('./card/joinMainnet.png'), - okxWallet: require('./card/okxWallet.png'), + wallet: require('./card/wallet.png'), }, quiz: { quizFailed: require('./quiz/quiz_failed.png'), diff --git a/src/assets/svg/DownloadIcon.tsx b/src/assets/svg/DownloadIcon.tsx deleted file mode 100644 index 22942d07c..000000000 --- a/src/assets/svg/DownloadIcon.tsx +++ /dev/null @@ -1,25 +0,0 @@ -// SPDX-License-Identifier: ice License 1.0 - -import {COLORS} from '@constants/colors'; -import * as React from 'react'; -import Svg, {Path, SvgProps} from 'react-native-svg'; -import {rem} from 'rn-units'; - -export const DownloadIcon = ({color = COLORS.white, ...props}: SvgProps) => { - return ( - - - - ); -}; diff --git a/src/constants/links.ts b/src/constants/links.ts index 23a428391..d0ac5cc84 100644 --- a/src/constants/links.ts +++ b/src/constants/links.ts @@ -57,6 +57,5 @@ export const LINKS = { DIST_REPOST_EXAMPLE: 'https://ice-production.b-cdn.net/assets/dist-post.jpg', X_REPOST_LINK_EXAMPLE: 'https://twitter.com/ice_z3us/status/1732445405806477625?t=HgtbOUEVIxMENcUuRKIsQQ&s=19', - OKX_WALLET: 'https://www.okx.com/join', BSCSCAN: 'https://bscscan.com/address', }; diff --git a/src/screens/HomeFlow/BscAddress/components/OkxWalletCard/index.tsx b/src/screens/HomeFlow/BscAddress/components/WalletCard/index.tsx similarity index 59% rename from src/screens/HomeFlow/BscAddress/components/OkxWalletCard/index.tsx rename to src/screens/HomeFlow/BscAddress/components/WalletCard/index.tsx index 83942ab0e..615761323 100644 --- a/src/screens/HomeFlow/BscAddress/components/OkxWalletCard/index.tsx +++ b/src/screens/HomeFlow/BscAddress/components/WalletCard/index.tsx @@ -1,12 +1,8 @@ // SPDX-License-Identifier: ice License 1.0 -import {Touchable} from '@components/Touchable'; -import {LINKS} from '@constants/links'; import {commonStyles} from '@constants/styles'; import {Images} from '@images'; -import {DownloadIcon} from '@svg/DownloadIcon'; import {replaceString, t, tagRegex} from '@translations/i18n'; -import {openLinkWithInAppBrowser} from '@utils/device'; import {font} from '@utils/styles'; import React from 'react'; import { @@ -23,21 +19,19 @@ type Props = { style?: StyleProp; }; -export const OkxWalletCard = ({style}: Props) => { +export const WalletCard = ({style}: Props) => { return ( - openLinkWithInAppBrowser({url: LINKS.OKX_WALLET})}> + - + {replaceString( - t('bsc_address.okxWalletDescription'), + t('bsc_address.walletDescription'), tagRegex('bold', false), (match, index) => ( @@ -46,13 +40,7 @@ export const OkxWalletCard = ({style}: Props) => { ), )} - - - - {t('bsc_address.okxWalletAction')} - - - + ); }; @@ -60,7 +48,7 @@ export const OkxWalletCard = ({style}: Props) => { const styles = StyleSheet.create({ card: { borderRadius: rem(16), - paddingVertical: rem(14), + paddingVertical: rem(26), overflow: 'hidden', alignItems: 'center', }, @@ -69,24 +57,14 @@ const styles = StyleSheet.create({ height: undefined, }, logoImage: { - width: rem(126), - height: rem(38), + width: rem(264), }, descriptionText: { - marginTop: rem(12), + marginTop: rem(20), marginHorizontal: rem(26), ...font(12, 18, 'regular', 'white', 'center'), }, boldDescriptionText: { ...font(12, 18, 'bold', 'white', 'center'), }, - action: { - marginTop: rem(12), - flexDirection: 'row', - alignItems: 'center', - }, - actionText: { - ...font(12, 18, 'bold'), - marginStart: rem(6), - }, }); diff --git a/src/screens/HomeFlow/BscAddress/index.tsx b/src/screens/HomeFlow/BscAddress/index.tsx index fc0c01987..6d207ab41 100644 --- a/src/screens/HomeFlow/BscAddress/index.tsx +++ b/src/screens/HomeFlow/BscAddress/index.tsx @@ -10,7 +10,7 @@ import {useScrollEndOnKeyboardShown} from '@hooks/useScrollEndOnKeyboardShown'; import {Header} from '@navigation/components/Header'; import {useFocusStatusBar} from '@navigation/hooks/useFocusStatusBar'; import {AddressActionButton} from '@screens/HomeFlow/BscAddress/components/AddressActionButton'; -import {OkxWalletCard} from '@screens/HomeFlow/BscAddress/components/OkxWalletCard'; +import {WalletCard} from '@screens/HomeFlow/BscAddress/components/WalletCard'; import {useSetBscAddress} from '@screens/HomeFlow/BscAddress/hooks/useSetBscAddress'; import {useValidatorsWarning} from '@screens/HomeFlow/BscAddress/hooks/useValidatorsWarning'; import {BscBookIcon} from '@svg/BscBookIcon'; @@ -59,7 +59,7 @@ export const BscAddress = memo(() => { onChange={needToShowWarning ? showWarning : undefined} showChangeLabel={false} /> - {!isKeyboardShown && } + {!isKeyboardShown && }