Skip to content

Commit

Permalink
chore: eth to bnb (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-hades authored Dec 29, 2023
1 parent fe2fa11 commit 66c3bf9
Show file tree
Hide file tree
Showing 73 changed files with 911 additions and 892 deletions.
Binary file modified src/assets/images/card/okxWallet.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/card/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/assets/images/card/[email protected]
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions src/assets/svg/BscBookIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: ice License 1.0

import {COLORS} from '@constants/colors';
import * as React from 'react';
import Svg, {G, Path, SvgProps} from 'react-native-svg';
import {rem} from 'rn-units';

export const BscBookIcon = ({color = COLORS.secondary, ...props}: SvgProps) => (
<Svg
width={rem(24)}
height={rem(24)}
viewBox="0 0 24 24"
fill="none"
{...props}>
<G id="bnbscaddress">
<Path
stroke={color}
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={1.5}
d="M3 8H6M3 12H6M3 16H6M19 6V18C19 18.5304 18.7893 19.0391 18.4142 19.4142C18.0391 19.7893 17.5304 20 17 20H7C6.46957 20 5.96086 19.7893 5.58579 19.4142C5.21071 19.0391 5 18.5304 5 18V6C5 5.46957 5.21071 4.96086 5.58579 4.58579C5.96086 4.21071 6.46957 4 7 4H17C17.5304 4 18.0391 4.21071 18.4142 4.58579C18.7893 4.96086 19 5.46957 19 6Z"
/>
<Path
fill={color}
d="M10.4404 12.7079L11.8581 14.1253C11.8957 14.1628 11.9467 14.1839 11.9998 14.1839C12.053 14.1839 12.104 14.1628 12.1416 14.1253L13.5593 12.7079C13.5969 12.6703 13.6479 12.6492 13.701 12.6492C13.7542 12.6492 13.8052 12.6703 13.8428 12.7079L14.4666 13.3314C14.5042 13.369 14.5253 13.42 14.5253 13.4731C14.5253 13.5263 14.5042 13.5773 14.4666 13.6149L12.1416 15.9399C12.104 15.9775 12.053 15.9986 11.9998 15.9986C11.9467 15.9986 11.8957 15.9775 11.8581 15.9399L9.53345 13.6149C9.49587 13.5773 9.47475 13.5263 9.47475 13.4731C9.47475 13.42 9.49587 13.369 9.53345 13.3314L10.1573 12.7079C10.1949 12.6703 10.2459 12.6492 10.299 12.6492C10.3522 12.6492 10.4028 12.6703 10.4404 12.7079ZM15.2898 11.2104L15.3174 11.2337L15.9413 11.8571C15.9745 11.8903 15.995 11.9341 15.9993 11.9808C16.0035 12.0276 15.9912 12.0743 15.9645 12.1129L15.9413 12.141L15.3174 12.7645C15.2843 12.7977 15.2405 12.8182 15.1937 12.8224C15.147 12.8267 15.1002 12.8144 15.0616 12.7877L15.034 12.7645L14.4101 12.1406C14.3771 12.1074 14.3567 12.0637 14.3525 12.017C14.3483 11.9704 14.3606 11.9237 14.3872 11.8852L14.4101 11.8571L15.034 11.2337C15.0629 11.2047 15.1 11.1853 15.1403 11.1781C15.1806 11.1708 15.2221 11.1761 15.2593 11.1932L15.2898 11.2104ZM8.96692 11.2337L9.59078 11.8571C9.62837 11.8947 9.64948 11.9457 9.64948 11.9989C9.64948 12.052 9.62837 12.103 9.59078 12.1406L8.96652 12.7649C8.92892 12.8024 8.87794 12.8236 8.82478 12.8236C8.77163 12.8236 8.72065 12.8024 8.68305 12.7649L8.05879 12.1406C8.0212 12.103 8.00009 12.052 8.00009 11.9989C8.00009 11.9457 8.0212 11.8947 8.05879 11.8571L8.68265 11.2337C8.72025 11.1961 8.77123 11.175 8.82438 11.175C8.87754 11.175 8.92932 11.1961 8.96692 11.2337ZM12.1135 11.2104L12.1416 11.2337L12.765 11.8571C12.7982 11.8903 12.8188 11.9341 12.823 11.9808C12.8273 12.0276 12.815 12.0743 12.7883 12.1129L12.765 12.141L12.1416 12.7645C12.1084 12.7977 12.0646 12.8182 12.0179 12.8224C11.9711 12.8267 11.9244 12.8144 11.8858 12.7877L11.8577 12.7645L11.2342 12.1406C11.2011 12.1074 11.1807 12.0638 11.1764 12.0171C11.1722 11.9704 11.1844 11.9238 11.211 11.8852L11.2342 11.8571L11.8577 11.2337C11.8866 11.2047 11.9237 11.1853 11.964 11.1781C12.0043 11.1708 12.0458 11.1761 12.083 11.1932L12.1135 11.2104ZM12.1416 8.05821L14.4662 10.3829C14.5038 10.4205 14.5249 10.4714 14.5249 10.5246C14.5249 10.5778 14.5038 10.6287 14.4662 10.6663L13.8424 11.2902C13.8048 11.3278 13.7538 11.3489 13.7006 11.3489C13.6475 11.3489 13.5965 11.3278 13.5589 11.2902L12.1416 9.87287C12.123 9.8542 12.1008 9.83939 12.0765 9.82928C12.0521 9.81917 12.026 9.81397 11.9996 9.81397C11.9733 9.81397 11.9472 9.81917 11.9228 9.82928C11.8984 9.83939 11.8763 9.8542 11.8577 9.87287L10.4404 11.2902C10.4028 11.3278 10.3518 11.3489 10.2986 11.3489C10.2455 11.3489 10.1945 11.3278 10.1569 11.2902L9.53345 10.6663C9.49587 10.6287 9.47475 10.5778 9.47475 10.5246C9.47475 10.4714 9.49587 10.4205 9.53345 10.3829L11.8581 8.05821C11.8957 8.02062 11.9467 7.99951 11.9998 7.99951C12.053 7.99951 12.104 8.02062 12.1416 8.05821Z"
/>
</G>
</Svg>
);
22 changes: 22 additions & 0 deletions src/assets/svg/BscIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: ice License 1.0

import {COLORS} from '@constants/colors';
import * as React from 'react';
import Svg, {G, Path, SvgProps} from 'react-native-svg';
import {rem} from 'rn-units';

export const BscIcon = ({color = COLORS.white, ...props}: SvgProps) => (
<Svg
width={rem(36)}
height={rem(36)}
viewBox="0 0 36 36"
fill="none"
{...props}>
<G id="cryptocurrency-color:bnb">
<Path
fill={color}
d="M12.1615 20.6505L17.4659 25.9534C17.6065 26.094 17.7973 26.173 17.9962 26.173C18.1951 26.173 18.3858 26.094 18.5265 25.9534L23.8308 20.6505C23.9715 20.5099 24.1622 20.4309 24.3611 20.4309C24.56 20.4309 24.7508 20.5099 24.8914 20.6505L27.2256 22.9832C27.3662 23.1239 27.4452 23.3146 27.4452 23.5135C27.4452 23.7124 27.3662 23.9031 27.2256 24.0438L18.5265 32.7429C18.3858 32.8835 18.1951 32.9625 17.9962 32.9625C17.7973 32.9625 17.6065 32.8835 17.4659 32.7429L8.76825 24.0438C8.62764 23.9031 8.54865 23.7124 8.54865 23.5135C8.54865 23.3146 8.62764 23.1239 8.76825 22.9832L11.1024 20.6505C11.2431 20.5099 11.4338 20.4309 11.6327 20.4309C11.8316 20.4309 12.0223 20.5099 12.163 20.6505M30.3053 15.0476L30.4088 15.1346L32.743 17.4673C32.8672 17.5914 32.944 17.7552 32.9599 17.9301C32.9758 18.105 32.9298 18.2799 32.83 18.4244L32.743 18.5294L30.4088 20.8621C30.2847 20.9863 30.1209 21.0631 29.946 21.079C29.7712 21.0949 29.5962 21.0489 29.4517 20.9491L29.3482 20.8621L27.0141 18.5279C26.8904 18.4037 26.8142 18.2401 26.7986 18.0656C26.7829 17.891 26.8289 17.7165 26.9286 17.5723L27.0141 17.4673L29.3482 15.1346C29.4565 15.0264 29.5953 14.9538 29.746 14.9267C29.8967 14.8996 30.0521 14.9193 30.1913 14.9831L30.3053 15.0476ZM6.6486 15.1346L8.98277 17.4673C9.12338 17.608 9.20238 17.7987 9.20238 17.9976C9.20238 18.1965 9.12338 18.3872 8.98277 18.5279L6.6471 20.8636C6.50645 21.0042 6.3157 21.0832 6.11681 21.0832C5.91793 21.0832 5.72718 21.0042 5.58652 20.8636L3.25086 18.5279C3.11024 18.3872 3.03125 18.1965 3.03125 17.9976C3.03125 17.7987 3.11024 17.608 3.25086 17.4673L5.58502 15.1346C5.72568 14.994 5.91643 14.915 6.11531 14.915C6.3142 14.915 6.50495 14.994 6.6456 15.1346M18.4215 15.0476L18.5265 15.1346L20.8591 17.4673C20.9834 17.5914 21.0601 17.7552 21.076 17.9301C21.0919 18.105 21.046 18.2799 20.9461 18.4244L20.8591 18.5294L18.5265 20.8621C18.4024 20.9863 18.2386 21.0631 18.0637 21.079C17.8888 21.0949 17.7139 21.0489 17.5694 20.9491L17.4644 20.8621L15.1317 18.5279C15.0078 18.4039 14.9313 18.2404 14.9154 18.0658C14.8995 17.8913 14.9453 17.7167 15.0447 17.5723L15.1317 17.4673L17.4644 15.1346C17.5726 15.0264 17.7115 14.9538 17.8622 14.9267C18.0129 14.8996 18.1683 14.9193 18.3074 14.9831L18.4215 15.0476ZM18.5265 3.25379L27.2241 11.9514C27.3647 12.0921 27.4437 12.2828 27.4437 12.4817C27.4437 12.6806 27.3647 12.8713 27.2241 13.012L24.8899 15.3462C24.7493 15.4868 24.5585 15.5658 24.3596 15.5658C24.1607 15.5658 23.97 15.4868 23.8293 15.3462L18.5265 10.0433C18.4568 9.97343 18.374 9.91801 18.2829 9.8802C18.1918 9.84238 18.0941 9.82292 17.9954 9.82292C17.8968 9.82292 17.7991 9.84238 17.708 9.8802C17.6168 9.91801 17.5341 9.97343 17.4644 10.0433L12.1615 15.3462C12.0208 15.4868 11.8301 15.5658 11.6312 15.5658C11.4323 15.5658 11.2416 15.4868 11.1009 15.3462L8.76825 13.012C8.62764 12.8713 8.54865 12.6806 8.54865 12.4817C8.54865 12.2828 8.62764 12.0921 8.76825 11.9514L17.4659 3.25379C17.6065 3.11317 17.7973 3.03418 17.9962 3.03418C18.1951 3.03418 18.3858 3.11317 18.5265 3.25379Z"
/>
</G>
</Svg>
);
30 changes: 0 additions & 30 deletions src/assets/svg/EthereumBookIcon.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions src/assets/svg/EthereumIcon.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: ice License 1.0

import {COLORS} from '@constants/colors';
import {EthereumIcon} from '@svg/EthereumIcon';
import {BscIcon} from '@svg/BscIcon';
import React from 'react';
import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native';
import {rem} from 'rn-units';
Expand All @@ -11,12 +11,18 @@ const ICON_SIZE = rem(36);

type Props = {
style?: StyleProp<ViewStyle>;
iconColor?: string;
iconSize?: number;
};

export const FramedEthereumIcon = ({style}: Props) => {
export const FramedBscIcon = ({
style,
iconColor,
iconSize = ICON_SIZE,
}: Props) => {
return (
<View style={[styles.container, style]}>
<EthereumIcon width={ICON_SIZE} height={ICON_SIZE} />
<BscIcon width={iconSize} height={iconSize} color={iconColor} />
</View>
);
};
Expand Down
1 change: 1 addition & 0 deletions src/constants/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ export const COLORS = {
koromiko: '#FFBE6C',
neonCarrot: '#FEA43A',
sunshineGold: '#FFC444',
goldenZest: '#F3BA2F',
danube: '#5c7cd4',
};
4 changes: 2 additions & 2 deletions src/constants/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ 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',
ETHERSCAN: 'https://etherscan.io/address',
OKX_WALLET: 'https://www.okx.com/web3',
BSCSCAN: 'https://bscscan.com/address',
};
6 changes: 3 additions & 3 deletions src/navigation/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {createNativeStackNavigator} from '@react-navigation/native-stack';
import {CreativeIceLibrary} from '@screens/CreativeIceLibrary';
import {FaceRecognition} from '@screens/FaceRecognitionFlow';
import {BalanceHistory} from '@screens/HomeFlow/BalanceHistory';
import {EthereumAddress} from '@screens/HomeFlow/EthereumAddress';
import {BscAddress} from '@screens/HomeFlow/BscAddress';
import {Home} from '@screens/HomeFlow/Home';
import {
ActiveOverviewCard,
Expand Down Expand Up @@ -156,7 +156,7 @@ export type MainStackParamList = {
ProfilePrivacyEditStep1: undefined;
ProfilePrivacyEditStep2: undefined;
ProfilePrivacyEditStep3: undefined;
EthereumAddress: undefined;
BscAddress: undefined;
VerifiedTooltipPopUp: {
hostViewParams: ViewMeasurementsResult;
correctiveOffset?: number;
Expand Down Expand Up @@ -447,7 +447,7 @@ export function MainNavigator() {
options={modalOptions}
component={JoinTelegramPopUp}
/>
<MainStack.Screen name="EthereumAddress" component={EthereumAddress} />
<MainStack.Screen name="BscAddress" component={BscAddress} />
<MainStack.Screen
name="VerifiedTooltipPopUp"
component={VerifiedTooltipPopUp}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const ExternalLink = ({style}: Props) => {
balanceSummary.totalMiningBlockchain !== '0.00'
) {
openLinkWithInAppBrowser({
url: `${LINKS.ETHERSCAN}/${user.miningBlockchainAccountAddress}`,
url: `${LINKS.BSCSCAN}/${user.miningBlockchainAccountAddress}`,
});
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
PrimaryButtonProps,
} from '@components/Buttons/PrimaryButton';
import {COLORS} from '@constants/colors';
import {EthereumBookIcon} from '@svg/EthereumBookIcon';
import {BscBookIcon} from '@svg/BscBookIcon';
import {t} from '@translations/i18n';
import {font} from '@utils/styles';
import React from 'react';
Expand All @@ -24,7 +24,7 @@ export const AddressActionButton = ({
}: Props) => {
return (
<PrimaryButton
icon={<EthereumBookIcon color={COLORS.white} />}
icon={<BscBookIcon color={COLORS.white} />}
text={
isRemoveAction
? t('button.remove_address')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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 {t} from '@translations/i18n';
import {openLinkWithInAppBrowser} from '@utils/device';
import {font} from '@utils/styles';
import React from 'react';
Expand All @@ -32,24 +32,16 @@ export const OkxWalletCard = ({style}: Props) => {
<Image
source={Images.backgrounds.blueSquaresBg}
style={[StyleSheet.absoluteFill, styles.backgroundImage]}
resizeMode={'repeat'}
resizeMode={'stretch'}
/>
<Image source={Images.card.okxWallet} style={styles.logoImage} />
<Text style={styles.descriptionText}>
{replaceString(
t('ethereum_address.okxWalletDescription'),
tagRegex('bold', false),
(match, index) => (
<Text key={match + index} style={styles.boldDescriptionText}>
{match}
</Text>
),
)}
{t('bsc_address.okxWalletDescription')}
</Text>
<View style={styles.action}>
<DownloadIcon />
<Text style={styles.actionText}>
{t('ethereum_address.okxWalletAction')}
{t('bsc_address.okxWalletAction')}
</Text>
</View>
</Touchable>
Expand All @@ -69,17 +61,14 @@ const styles = StyleSheet.create({
height: undefined,
},
logoImage: {
width: rem(126),
height: rem(38),
width: rem(80),
height: rem(45),
},
descriptionText: {
marginTop: rem(12),
marginHorizontal: rem(26),
marginHorizontal: rem(40),
...font(12, 18, 'regular', 'white', 'center'),
},
boldDescriptionText: {
...font(12, 18, 'bold', 'white', 'center'),
},
action: {
marginTop: rem(12),
flexDirection: 'row',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const useGoBackIfAddressSet = ({
checkProp(updatePayload, 'userInfo') &&
checkProp(updatePayload.userInfo, 'miningBlockchainAccountAddress')
) {
removeScreenByName('EthereumAddress');
removeScreenByName('BscAddress');
}
}, [isFormSubmitted, isSuccessUpdate, updatePayload]);
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import {MainNavigationParams} from '@navigation/Main';
import {useNavigation} from '@react-navigation/native';
import {NativeStackNavigationProp} from '@react-navigation/native-stack';
import {useGoBackIfAddressSet} from '@screens/HomeFlow/EthereumAddress/hooks/useGoBackIfAddressSet';
import {useGoBackIfAddressSet} from '@screens/HomeFlow/BscAddress/hooks/useGoBackIfAddressSet';
import {AccountActions} from '@store/modules/Account/actions';
import {unsafeUserSelector} from '@store/modules/Account/selectors';
import {
Expand All @@ -17,7 +17,7 @@ import {StyleSheet, Text} from 'react-native';
import {useDispatch, useSelector} from 'react-redux';
import {rem} from 'rn-units';

export const useSetEthereumAddress = () => {
export const useSetBscAddress = () => {
const navigation =
useNavigation<NativeStackNavigationProp<MainNavigationParams>>();
const dispatch = useDispatch();
Expand Down Expand Up @@ -58,13 +58,13 @@ export const useSetEthereumAddress = () => {
}
navigation.navigate({
name: 'PopUp',
key: 'confirm-eth-address-popup',
key: 'confirm-bsc-address-popup',
params: {
title: t('button.confirm_address'),
message: (
<>
<Text style={styles.messageText}>
{t('ethereum_address.enter_address_confirmation')}
{t('bsc_address.enter_address_confirmation')}
</Text>
<Text style={[styles.messageText, styles.messageTextBold]}>
{address}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {useNavigation} from '@react-navigation/native';
import {NativeStackNavigationProp} from '@react-navigation/native-stack';
import {AccountActions} from '@store/modules/Account/actions';
import {
ethereumWarningConfirmedSelector,
bscWarningConfirmedSelector,
unsafeUserSelector,
} from '@store/modules/Account/selectors';
import {t} from '@translations/i18n';
Expand All @@ -16,17 +16,17 @@ export const useValidatorsWarning = () => {
useNavigation<NativeStackNavigationProp<MainNavigationParams>>();
const dispatch = useDispatch();
const user = useSelector(unsafeUserSelector);
const warningConfirmed = useSelector(ethereumWarningConfirmedSelector);
const warningConfirmed = useSelector(bscWarningConfirmedSelector);
const needToShowWarning =
!user.miningBlockchainAccountAddress && !warningConfirmed;

const showWarning = () => {
navigation.navigate({
name: 'PopUp',
key: 'eth-address-warning-popup',
key: 'bsc-address-warning-popup',
params: {
title: t('ethereum_address.validators_warning_title'),
message: t('ethereum_address.validators_warning_text'),
title: t('bsc_address.validators_warning_title'),
message: t('bsc_address.validators_warning_text'),
buttons: [
{
text: t('button.not_sure'),
Expand All @@ -36,7 +36,7 @@ export const useValidatorsWarning = () => {
text: t('button.confirm'),
onPress: () => {
dispatch(
AccountActions.SET_ETHEREUM_ADDR_WARNING_CONFIRMED.STATE.create(),
AccountActions.SET_BSC_ADDR_WARNING_CONFIRMED.STATE.create(),
);
},
},
Expand Down
Loading

0 comments on commit 66c3bf9

Please sign in to comment.