Skip to content

Commit

Permalink
feat: sync some changes on approval page on extension (#470)
Browse files Browse the repository at this point in the history
* feat: display protocol for send

* fix: balance change display

* feat: add interacted before back
  • Loading branch information
vvvvvv1vvvvvv authored Nov 5, 2024
1 parent 0bc1856 commit 12be0dc
Show file tree
Hide file tree
Showing 26 changed files with 263 additions and 31 deletions.
2 changes: 1 addition & 1 deletion apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"@rabby-wallet/gnosis-sdk": "1.3.8",
"@rabby-wallet/object-multiplex": "workspace:^",
"@rabby-wallet/persist-store": "workspace:^",
"@rabby-wallet/rabby-action": "0.1.3",
"@rabby-wallet/rabby-action": "0.1.4",
"@rabby-wallet/rabby-api": "0.8.3",
"@rabby-wallet/rabby-security-engine": "2.0.7",
"@rabby-wallet/rabby-sign-bvm": "0.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ const ApproveNFT = ({
</SubRow>
</SubCol>

<SubCol>
<SubRow isTitle>
<Text style={commonStyle.subRowTitleText}>
{t('page.signTx.interacted')}
</Text>
</SubRow>
<SubRow>
<Values.Boolean value={requireData.hasInteraction} />
</SubRow>
</SubCol>

<SecurityListItem
id="1043"
engineResult={engineResultMap['1043']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ const ApproveNFTCollection = ({
</SubRow>
</SubCol>

<SubCol>
<SubRow isTitle>
<Text style={commonStyle.subRowTitleText}>
{t('page.signTx.interacted')}
</Text>
</SubRow>
<SubRow>
<Values.Boolean value={requireData.hasInteraction} />
</SubRow>
</SubCol>

<SecurityListItem
id="1053"
engineResult={engineResultMap['1053']}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ const ContractCall = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}>
<View ref={contractCallAddressRef}>
Expand All @@ -102,7 +103,16 @@ const ContractCall = ({
/>
</SubRow>
</SubCol>

<SubCol>
<SubRow isTitle>
<Text style={commonStyle.subRowTitleText}>
{t('page.signTx.interacted')}
</Text>
</SubRow>
<SubRow>
<Values.Boolean value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,21 @@ const CrossSwapToken = ({
{!engineResultMap['1096'] && (
<>
<SubCol>
<SubRow isTitle>{t('page.signTx.address')}</SubRow>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.signTx.address')}
</Text>
</SubRow>
<SubRow>
<Values.AccountAlias address={receiver} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.addressDetail.source')}</SubRow>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.addressDetail.source')}
</Text>
</SubRow>
<SubRow>
<Values.KnownAddress address={receiver} />
</SubRow>
Expand All @@ -282,6 +290,7 @@ const CrossSwapToken = ({
rank: requireData.rank,
address: requireData.id,
chain,
hasInteraction: requireData.hasInteraction,
}}>
<View ref={crossSwapTokenAddressRef}>
<Values.Address address={requireData.id} chain={chain} />
Expand All @@ -303,6 +312,16 @@ const CrossSwapToken = ({
/>
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>
<Text style={commonStyle.subRowTitleText}>
{t('page.signTx.interacted')}
</Text>
</SubRow>
<SubRow>
<Values.Boolean value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,21 @@ const Swap = ({
{!engineResultMap['1103'] && (
<>
<SubCol>
<SubRow isTitle>{t('page.signTx.address')}</SubRow>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.signTx.address')}
</Text>
</SubRow>
<SubRow>
<Values.AccountAlias address={receiver} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.addressDetail.source')}</SubRow>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.addressDetail.source')}
</Text>
</SubRow>
<SubRow>
<Values.KnownAddress address={receiver} />
</SubRow>
Expand All @@ -272,6 +280,7 @@ const Swap = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}>
<View ref={crossTokenAddressRef}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,16 @@ const MultiSwap = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>

<SubCol>
<SubRow isTitle>
<Text style={commonStyle.subRowTitleText}>
{t('page.signTx.interacted')}
</Text>
</SubRow>
<SubRow>
<Values.Boolean value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>
Expand Down
12 changes: 12 additions & 0 deletions apps/mobile/src/components/Approval/components/Actions/Send.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ const Send = ({
/>
</SubRow>
</SubCol>
{requireData.protocol && (
<SubCol>
<SubRow isTitle>
<Text style={commonStyle.subRowTitleText}>
{t('page.signTx.protocol')}
</Text>
</SubRow>
<SubRow>
<Values.Protocol value={requireData.protocol} />
</SubRow>
</SubCol>
)}
{!!requireData.contract && (
<SubCol>
<SubRow isTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ const SendNFT = ({
)}
{!!requireData.name && (
<SubCol nested={!isLabelAddress}>
<SubRow>{isLabelAddress ? t('page.signTx.label') : ' '}</SubRow>
<SubRow>
<Text>{isLabelAddress ? t('page.signTx.label') : ' '}</Text>
</SubRow>
<SubRow>
{isLabelAddress ? (
<LogoWithText
Expand Down
23 changes: 21 additions & 2 deletions apps/mobile/src/components/Approval/components/Actions/Swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,21 @@ const Swap = ({
{!engineResultMap['1069'] && (
<>
<SubCol>
<SubRow isTitle>{t('page.signTx.address')}</SubRow>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.signTx.address')}
</Text>
</SubRow>
<SubRow>
<Values.AccountAlias address={receiver} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.addressDetail.source')}</SubRow>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.addressDetail.source')}
</Text>
</SubRow>
<SubRow>
<Values.KnownAddress address={receiver} />
</SubRow>
Expand All @@ -360,6 +368,7 @@ const Swap = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}>
<View ref={swapContractRef}>
Expand All @@ -382,6 +391,16 @@ const Swap = ({
/>
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.signTx.hasInteraction')}
</Text>
</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,16 @@ const SwapLimitPay = ({
<ProtocolListItem protocol={requireData.protocol} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.signTx.hasInteraction')}
</Text>
</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

{isInWhitelist && (
<SubCol>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,16 @@ const TokenApprove = ({
/>
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.signTx.hasInteraction')}
</Text>
</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>

<SecurityListItem
id="1022"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,21 @@ const UnWrapToken = ({
{!engineResultMap['1093'] && (
<>
<SubCol>
<SubRow isTitle>{t('page.signTx.address')}</SubRow>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.signTx.address')}
</Text>
</SubRow>
<SubRow>
<Values.AccountAlias address={receiver} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.addressDetail.source')}</SubRow>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.addressDetail.source')}
</Text>
</SubRow>
<SubRow>
<Values.KnownAddress address={receiver} />
</SubRow>
Expand All @@ -191,6 +199,7 @@ const UnWrapToken = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}>
<View ref={unwrapTokenAddressRef}>
Expand All @@ -213,6 +222,16 @@ const UnWrapToken = ({
/>
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.signTx.hasInteraction')}
</Text>
</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,21 @@ const WrapToken = ({
{!engineResultMap['1093'] && (
<>
<SubCol>
<SubRow isTitle>{t('page.signTx.address')}</SubRow>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.signTx.address')}
</Text>
</SubRow>
<SubRow>
<Values.AccountAlias address={receiver} />
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>{t('page.addressDetail.source')}</SubRow>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.addressDetail.source')}
</Text>
</SubRow>
<SubRow>
<Values.KnownAddress address={receiver} />
</SubRow>
Expand All @@ -199,6 +207,7 @@ const WrapToken = ({
protocol: requireData.protocol,
rank: requireData.rank,
address: requireData.id,
hasInteraction: requireData.hasInteraction,
chain,
}}>
<View ref={wrapTokenAddressRef}>
Expand All @@ -221,6 +230,16 @@ const WrapToken = ({
/>
</SubRow>
</SubCol>
<SubCol>
<SubRow isTitle>
<Text style={commonStyle.rowTitleText}>
{t('page.signTx.hasInteraction')}
</Text>
</SubRow>
<SubRow>
<Values.Interacted value={requireData.hasInteraction} />
</SubRow>
</SubCol>
{isInWhitelist && (
<SubCol>
<SubRow isTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const getStyles = (colors: AppColorsVariants) =>

interface Props {
address: string;
chain: Chain;
chain?: Chain;
onWhitelist: boolean;
onBlacklist: boolean;
visible: boolean;
Expand Down Expand Up @@ -113,7 +113,7 @@ const UserListDrawer = ({
<BottomSheetView style={styles.mainView}>
<AppBottomSheetModalTitle
title={t('page.signTx.myMarkWithContract', {
chainName: chain.name,
chainName: chain?.name,
})}
/>
<View style={styles.footer}>
Expand Down
Loading

0 comments on commit 12be0dc

Please sign in to comment.