-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #235 from bnb-chain/feat/sendConfirmPopup1230
feat: Send confirm popup
- Loading branch information
Showing
35 changed files
with
1,286 additions
and
603 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@bnb-chain/canonical-bridge-widget": patch | ||
--- | ||
|
||
feat: Send confirm popup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"mode": "pre", | ||
"tag": "alpha", | ||
"initialVersions": { | ||
"@bnb-chain/canonical-bridge-sdk": "0.4.6", | ||
"@bnb-chain/canonical-bridge-widget": "0.5.16" | ||
}, | ||
"changesets": [ | ||
"hot-knives-pay" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/canonical-bridge-widget/src/modules/aggregator/hooks/useHandleTxFailure.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { useCallback } from 'react'; | ||
|
||
import { reportEvent } from '@/core/utils/gtm'; | ||
import { useAppSelector } from '@/modules/store/StoreProvider'; | ||
|
||
export const useHandleTxFailure = ({ onOpenFailedModal }: { onOpenFailedModal: () => void }) => { | ||
const fromChain = useAppSelector((state) => state.transfer.fromChain); | ||
const toChain = useAppSelector((state) => state.transfer.toChain); | ||
const selectedToken = useAppSelector((state) => state.transfer.selectedToken); | ||
const sendValue = useAppSelector((state) => state.transfer.sendValue); | ||
const transferActionInfo = useAppSelector((state) => state.transfer.transferActionInfo); | ||
|
||
const handleFailure = useCallback( | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
(e: any) => { | ||
reportEvent({ | ||
id: 'transaction_bridge_fail', | ||
params: { | ||
item_category: fromChain?.name, | ||
item_category2: toChain?.name, | ||
token: selectedToken?.displaySymbol, | ||
value: sendValue, | ||
item_variant: transferActionInfo?.bridgeType, | ||
message: JSON.stringify(e.message || e), | ||
page_location: JSON.stringify(e.message || e), | ||
}, | ||
}); | ||
onOpenFailedModal(); | ||
}, | ||
[ | ||
fromChain?.name, | ||
onOpenFailedModal, | ||
selectedToken?.displaySymbol, | ||
sendValue, | ||
toChain?.name, | ||
transferActionInfo?.bridgeType, | ||
], | ||
); | ||
|
||
return { handleFailure }; | ||
}; |
61 changes: 60 additions & 1 deletion
61
packages/canonical-bridge-widget/src/modules/transfer/BridgeRoutes.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.