Skip to content

Commit

Permalink
chore: bsc screen updates (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-hades authored Jan 25, 2024
1 parent 4911dbe commit 8b453d6
Show file tree
Hide file tree
Showing 57 changed files with 112 additions and 150 deletions.
55 changes: 55 additions & 0 deletions scripts/deleteLocalizations.js
Original file line number Diff line number Diff line change
@@ -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' <path_to_json_files_directory>
const args = process.argv.slice(2);

if (args.length !== 2) {
console.log(
'Usage: node deleteLocalizations.js <path_to_delete> <path_to_json_files_directory>',
);
} else {
const propPath = args[0];
const jsonFilesDirectory = args[1];
deleteFromJsonFiles(propPath, jsonFilesDirectory);
}
Binary file removed src/assets/images/card/okxWallet.png
Binary file not shown.
Binary file removed src/assets/images/card/[email protected]
Binary file not shown.
Binary file removed src/assets/images/card/[email protected]
Binary file not shown.
Binary file added src/assets/images/card/wallet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/card/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/card/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/images/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
25 changes: 0 additions & 25 deletions src/assets/svg/DownloadIcon.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/constants/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -23,21 +19,19 @@ type Props = {
style?: StyleProp<ViewStyle>;
};

export const OkxWalletCard = ({style}: Props) => {
export const WalletCard = ({style}: Props) => {
return (
<View style={[commonStyles.flexOne, style]}>
<Touchable
style={styles.card}
onPress={() => openLinkWithInAppBrowser({url: LINKS.OKX_WALLET})}>
<View style={styles.card}>
<Image
source={Images.backgrounds.blueSquaresBg}
style={[StyleSheet.absoluteFill, styles.backgroundImage]}
resizeMode={'repeat'}
/>
<Image source={Images.card.okxWallet} style={styles.logoImage} />
<Image source={Images.card.wallet} style={styles.logoImage} />
<Text style={styles.descriptionText}>
{replaceString(
t('bsc_address.okxWalletDescription'),
t('bsc_address.walletDescription'),
tagRegex('bold', false),
(match, index) => (
<Text key={match + index} style={styles.boldDescriptionText}>
Expand All @@ -46,21 +40,15 @@ export const OkxWalletCard = ({style}: Props) => {
),
)}
</Text>
<View style={styles.action}>
<DownloadIcon />
<Text style={styles.actionText}>
{t('bsc_address.okxWalletAction')}
</Text>
</View>
</Touchable>
</View>
</View>
);
};

const styles = StyleSheet.create({
card: {
borderRadius: rem(16),
paddingVertical: rem(14),
paddingVertical: rem(26),
overflow: 'hidden',
alignItems: 'center',
},
Expand All @@ -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),
},
});
6 changes: 3 additions & 3 deletions src/screens/HomeFlow/BscAddress/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -59,7 +59,7 @@ export const BscAddress = memo(() => {
onChange={needToShowWarning ? showWarning : undefined}
showChangeLabel={false}
/>
{!isKeyboardShown && <OkxWalletCard style={styles.walletCard} />}
{!isKeyboardShown && <WalletCard style={styles.walletCard} />}
<AddressActionButton
style={styles.button}
onPress={onSubmit}
Expand Down Expand Up @@ -90,7 +90,7 @@ const styles = StyleSheet.create({
...font(14, 20, 'medium', 'secondary', 'center'),
},
input: {
marginTop: rem(74),
marginTop: rem(50),
},
walletCard: {
marginTop: rem(24),
Expand Down
3 changes: 1 addition & 2 deletions src/translations/locales/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -1239,8 +1239,7 @@
"enter_address_confirmation": "Is jy seker dat die BNB Smart Chain-adres korrek is?",
"validators_warning_title": "Bevestig Adres",
"validators_warning_text": "Let daarop dat individue wat 'n BNB Smart Chain-adres bygevoeg het tot hul rekening, nie in aanmerking kom om een van die top 300-valideerders te word nie, soos uiteengesit in ons whitepaper vir die hoofnet-lansering nie.",
"okxWalletDescription": "Ons beveel aan om jou [[:bold]]OKX-beurs[[/:bold]] BNB Slim Kettingadres te gebruik om enige gasgelde te vermy.\n\nAs OKX nie in jou land beskikbaar is nie, kan jy 'n selfsorgende beurs soos MetaMask of Trust Wallet gebruik.",
"okxWalletAction": "SKEP REKENING OP OKX"
"walletDescription": "Ons adviseer om 'n self-bestuurde beursie soos [[:bold]]Metamask[[/:bold]] of [[:bold]]Trust Wallet[[/:bold]] te gebruik.\n\nMaak asseblief seker dat jy jou beursie-adres dubbelkontroleer om seker te maak dat jy die verspreiding ontvang."
},
"social_kyc": {
"header": "Verifikasie",
Expand Down
3 changes: 1 addition & 2 deletions src/translations/locales/am.json
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,7 @@
"enter_address_confirmation": "እርስዎ የ BNB Smart Chain አድራሻ ነው የሚያመለክተው ነውም፣ በማለት ይጎብኛልን?",
"validators_warning_title": "አድራሻ አረጋግጥ",
"validators_warning_text": "እባክዎን ባንዳርነት በህክም አድራሻ አድርገዋል ከእኛው አይምሰልሽም፣ ብኛው የምርምርን ቅርጸ ከከባድ የተመለከተውን አግባብ በማድረግ ልክ ልንሄድ ትችላላችሁ።",
"okxWalletDescription": "እኛን ለማሳደግ የምትፈልጉ ለስራችሁ [[:bold]]OKX ቅጥፋት[[/:bold]] BNB ስልም አዘጋጅልን።\n\nያሁኑት አንዳንድ ሜትራማስካንድ ወለት በሰርቨርማስካንድ የሚገመግመውን ስልም በመጠቀም እዚህ ይግቡ።",
"okxWalletAction": "አካውንት ይፍጠሩ ከ OKX"
"walletDescription": "እኛንኳ ምርት-ሜርሳክ ወይም ትሪስት ዋልት እንዲሁም ለራስ-ቡቦውን የሚሰጥ ወደ [[:bold]]Metamask[[/:bold]] ወይም [[:bold]]Trust Wallet[[/:bold]] መግባት ይፈልጋሉ።\n\nእባክዎት ትንሽት አስተያየታችሁን ደፍና ስልኩን ማስቀመጥ አይፈልጉም።"
},
"social_kyc": {
"header": "ማረጋገጫ",
Expand Down
3 changes: 1 addition & 2 deletions src/translations/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,7 @@
"enter_address_confirmation": "هل أنت متأكد من صحة عنوان سلسلة BNB الذكية؟",
"validators_warning_title": "تأكيد العنوان",
"validators_warning_text": "يرجى ملاحظة أن الأفراد الذين قاموا بإضافة عنوان سلسلة BNB Smart Chain إلى حساباتهم غير مؤهلين ليكونوا واحدًا من أفضل 300 مصادق حسب كتابنا الأبيض لإطلاق الشبكة الرئيسية.",
"okxWalletDescription": "نوصي باستخدام عنوان [[:bold]]BNB Smart Chain لمنصة OKX التبادلية[[/:bold]] لتجنب أي رسوم غاز.\n\nإذا لم تكن منصة OKX متاحة في بلدك، يمكنك استخدام محفظة ذاتية الاستضافة مثل MetaMask أو Trust Wallet.",
"okxWalletAction": "إنشاء حساب على OKX"
"walletDescription": "ننصح باستخدام محفظة ذاتية الحراسة مثل [[:bold]]Metamask[[/:bold]] أو [[:bold]]Trust Wallet[[/:bold]].\n\nيرجى التأكد من مراجعة عنوان محفظتك مرتين للتأكد من أنك ستتلقى التوزيع."
},
"social_kyc": {
"header": "التحقق",
Expand Down
3 changes: 1 addition & 2 deletions src/translations/locales/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,7 @@
"enter_address_confirmation": "BNB Smart Chain ünvanının düzgün olduğundan əminsinizmi?",
"validators_warning_title": "Ünvanı Təsdiq Et",
"validators_warning_text": "Xüsusiylə öz hesabına BNB Smart Chain ünvanını əlavə edən şəxslər, əsas şəbəkə işə salınmasına görə ağın ən yaxşı 300 təsdiqləyicisindən biri olmağa layiq deyillər.",
"okxWalletDescription": "[[:bold]]OKX Exchange[[/:bold]] BNB Smart Chain ünvanınızı istifadə etmənizi təklif edirik, hər hansı bir qaz haqqından qaçmaq üçün.\n\nƏgər OKX ölkənizdə mövcud deyilsə, MetaMask və ya Trust Wallet kimi özünüzün qeydiyyatlı cib qutularından istifadə edə bilərsiniz.",
"okxWalletAction": "OKX-DƏ HESAB AÇIN"
"walletDescription": "[[:bold]]Metamask[[/:bold]] və ya [[:bold]]Trust Wallet[[/:bold]] kimi özünün nəzarətində olan bir cüzdan istifadə etməyinizi tövsiyə edirik.\n\nXahiş edirik, cüzdan ünvanınızı qəbul edəcəyinizdən əmin olmaq üçün iki dəfə yoxlayasınız."
},
"social_kyc": {
"header": "Doğrulama",
Expand Down
3 changes: 1 addition & 2 deletions src/translations/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,7 @@
"enter_address_confirmation": "Сигурни ли сте, че адресът на BNB Smart Chain е правилен?",
"validators_warning_title": "Потвърдете адреса",
"validators_warning_text": "Моля, обърнете внимание, че лицата, които са добавили адрес на BNB Smart Chain към своя акаунт, нямат право да станат един от първите 300 валидатори, съгласно нашата бели книги за пускане на основна мрежа.",
"okxWalletDescription": "Препоръчваме ви да използвате вашия адрес на [[:bold]]BNB Smart Chain на OKX Exchange[[/:bold]] , за да избегнете каквито и да е такси за газ.\n\nАко OKX не е достъпен вашията страна, можете да използвате собствена портфейл като MetaMask или Trust Wallet.",
"okxWalletAction": "СЪЗДАЙТЕ АКАУНТ В OKX"
"walletDescription": "Препоръчваме използването на самостоятелен портфейл като [[:bold]]Metamask[[/:bold]] или [[:bold]]Trust Wallet[[/:bold]].\n\nМоля, уверете се, че два пъти проверявате вашия портфейл адрес, за да сте сигурни, че ще получите разпределението."
},
"social_kyc": {
"header": "Потвърждение",
Expand Down
3 changes: 1 addition & 2 deletions src/translations/locales/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,7 @@
"enter_address_confirmation": "আপনি কি নিশ্চিত যে BNB স্মার্ট চেইন ঠিকানাটি সঠিক?",
"validators_warning_title": "ঠিক করা ঠিকানা",
"validators_warning_text": "দয়া করে লক্ষ্য করুন যে, যারা তাদের অ্যাকাউন্টে BNB স্মার্ট চেইন ঠিকানা যোগ করেছেন, তারা প্রধান নেটওয়ার্ক লঞ্চের জন্য আমাদের উইটপেপার অনুসারে শীর্ষ 300 ভ্যালিডেটর হতে সম্মত নয়।",
"okxWalletDescription": "আমরা আপনাকে যেন [[:bold]]OKX এক্সচেঞ্জের[[/:bold]] BNB স্মার্ট চেন ঠিকানা ব্যবহার করতে সুপরিচিত করি, গ্যাস ফি থেকে বিরত থাকার জন্য।\n\nআপনার দেশে OKX উপলব্ধ না হলে, আপনি MetaMask বা Trust Wallet সেলফ কাস্টোডিয়াল ওয়ালেট ব্যবহার করতে পারেন।",
"okxWalletAction": "OKX-এ অ্যাকাউন্ট তৈরি করুন"
"walletDescription": "আমরা [[:bold]]Metamask[[/:bold]] বা [[:bold]]Trust Wallet[[/:bold]] সহানুভব করা একটি স্ব-সংরক্ষণী মানপর জনপ্রিয় ওয়ালেট ব্যবহার করার সুপরাহনা করি।\n\nদয়া করে নিশ্চিত হোন যে আপনার ওয়ালেট ঠিকমত পরিক্ষাপণ করে আপনি বন্টন পেতে যাচ্ছেন তা।"
},
"social_kyc": {
"header": "যাচাই",
Expand Down
3 changes: 1 addition & 2 deletions src/translations/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,7 @@
"enter_address_confirmation": "Jste si jisti, že adresa BNB Smart Chain je správná?",
"validators_warning_title": "Potvrďte Adresu",
"validators_warning_text": "Upozorňujeme, že osoby, které přidaly adresu BNB Smart Chain do svého účtu, nemají nárok stát se jedním z prvních 300 validátorů podle naší bílé knihy pro spuštění hlavní sítě.",
"okxWalletDescription": "Doporučujeme použít svou adresu [[:bold]]BNB Smart Chain na burze OKX[[/:bold]], abyste se vyhnuli jakýmkoli poplatkům za plyn.\n\nPokud není OKX k dispozici ve vaší zemi, můžete použít samostatnou peněženku, jako je MetaMask nebo Trust Wallet.",
"okxWalletAction": "VYTVOŘIT ÚČET NA OKX"
"walletDescription": "Doporučujeme používat samostatnou peněženku, jako je [[:bold]]Metamask[[/:bold]] nebo [[:bold]]Trust Wallet[[/:bold]].\n\nProsím, ujistěte se, že dvakrát zkontrolujete svoji peněženku, abyste byli jisti, že dostanete distribuci."
},
"social_kyc": {
"header": "Ověření",
Expand Down
3 changes: 1 addition & 2 deletions src/translations/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,7 @@
"enter_address_confirmation": "Sind Sie sicher, dass die BNB Smart Chain Adresse korrekt ist?",
"validators_warning_title": "Adresse bestätigen",
"validators_warning_text": "Bitte beachten Sie, dass Personen, die ihrer Konto eine BNB Smart Chain Adresse hinzugefügt haben, gemäß unserem Whitepaper für den Start des Mainnets nicht berechtigt sind, einer der Top 300 Validatoren zu werden.",
"okxWalletDescription": "Wir empfehlen die Verwendung Ihrer [[:bold]]BNB Smart Chain-Adresse von OKX Exchange[[/:bold]], um Gebühren zu vermeiden.\n\nWenn OKX in Ihrem Land nicht verfügbar ist, können Sie eine selbstverwaltete Wallet wie MetaMask oder Trust Wallet verwenden.",
"okxWalletAction": "KONTO BEI OKX ERSTELLEN"
"walletDescription": "Wir empfehlen die Verwendung einer selbstverwalteten Geldbörse wie [[:bold]]Metamask[[/:bold]] oder [[:bold]]Trust Wallet[[/:bold]].\n\nBitte stellen Sie sicher, dass Sie Ihre Geldbörsenadresse zweimal überprüfen, um sicherzustellen, dass Sie die Verteilung erhalten."
},
"social_kyc": {
"header": "Verifizierung",
Expand Down
3 changes: 1 addition & 2 deletions src/translations/locales/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -1236,8 +1236,7 @@
"enter_address_confirmation": "Είστε σίγουροι ότι η διεύθυνση BNB Smart Chain είναι σωστή;",
"validators_warning_title": "Επιβεβαίωση Διεύθυνσης",
"validators_warning_text": "Σημειώστε ότι οι άνθρωποι που έχουν προσθέσει μια διεύθυνση BNB Smart Chain στον λογαριασμό τους δεν είναι επιλέξιμοι να γίνουν ένας από τους 300 κορυφαίους επικυρωτές σύμφωνα με το Λευκό μας Βιβλίο για την έναρξη του κύριου δικτύου.",
"okxWalletDescription": "Σας προτείνουμε να χρησιμοποιήσετε τη διεύθυνση BNB Smart Chain του [[:bold]]OKX Exchange[[/:bold]] για να αποφύγετε οποιεσδήποτε χρεώσεις αερίου.\n\nΕάν το OKX δεν είναι διαθέσιμο στη χώρα σας, μπορείτε να χρησιμοποιήσετε μια πορτοφόλι αυτοεξυπηρέτησης, όπως το MetaMask ή το Trust Wallet.",
"okxWalletAction": "ΔΗΜΙΟΥΡΓΗΣΤΕ ΛΟΓΑΡΙΑΣΜΟ ΣΤΟ OKX"
"walletDescription": "Συνιστούμε τη χρήση μιας αυτοδιαχειριζόμενης πορτοφόλι όπως το [[:bold]]Metamask[[/:bold]] ή το [[:bold]]Trust Wallet[[/:bold]].\n\nΒεβαιωθείτε ότι ελέγχετε δύο φορές τη διεύθυνση του πορτοφολιού σας για να εξασφαλίσετε ότι θα λάβετε τη διανομή."
},
"social_kyc": {
"header": "Επαλήθευση",
Expand Down
3 changes: 1 addition & 2 deletions src/translations/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1233,8 +1233,7 @@
"enter_address_confirmation": "Are you sure that the BNB Smart Chain address is correct?",
"validators_warning_title": "Confirm Address",
"validators_warning_text": "Please note that individuals who have added a BNB Smart Chain address to their account are not eligible to become one of the top 300 validators as per our whitepaper for the mainnet launch.",
"okxWalletDescription": "We recommend using your [[:bold]]OKX Exchange[[/:bold]] BNB Smart Chain address to avoid any gas fees.\n\nIf OKX isn't available in your country, you can use a self-custodial wallet such as MetaMask or Trust Wallet.",
"okxWalletAction": "CREATE ACCOUNT ON OKX"
"walletDescription": "We advise using a self-custodial wallet such as [[:bold]]Metamask[[/:bold]] or [[:bold]]Trust Wallet[[/:bold]].\n\nPlease ensure that you double-check your wallet address to make sure you will receive the distribution."
},
"social_kyc": {
"header": "Verification",
Expand Down
Loading

0 comments on commit 8b453d6

Please sign in to comment.