@reservoir0x/relay-kit-ui
Version:
Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.
35 lines • 3.63 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { motion } from 'framer-motion';
import { Anchor, Box, Button, ChainTokenIcon, Flex, Pill, Skeleton, Text } from '../../../../primitives/index.js';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faCheck, faUpRightFromSquare } from '@fortawesome/free-solid-svg-icons';
import { truncateAddress } from '../../../../../utils/truncate.js';
export const OnrampSuccessStep = ({ toToken, moonpayTxUrl, isLoadingTransaction, toAmountFormatted, fillTxHash, fillTxUrl, baseTransactionUrl, onOpenChange }) => {
return (_jsxs(Flex, { direction: "column", css: {
width: '100%',
height: '100%'
}, children: [_jsx(Text, { style: "h6", css: { mb: '4' }, children: "Transaction Details" }), _jsxs(Flex, { direction: "column", align: "center", justify: "between", children: [_jsx(motion.div, { initial: { scale: 0 }, animate: { scale: 1 }, transition: {
type: 'spring',
stiffness: 260,
damping: 20
}, children: _jsx(Flex, { align: "center", justify: "center", css: {
height: 80,
width: 80,
backgroundColor: 'green2',
'--borderColor': 'colors.green10',
border: '6px solid var(--borderColor)',
borderRadius: '999999px',
position: 'relative'
}, children: _jsx(Box, { css: { color: 'green9', mr: '$2' }, children: _jsx(FontAwesomeIcon, { icon: faCheck, style: { height: 40 } }) }) }) }), _jsx(Text, { style: "subtitle1", css: { mt: '4', textAlign: 'center' }, children: "Successfully purchased" }), _jsxs(Pill, { color: "gray", css: { alignItems: 'center', my: '4', py: '2', px: '3', gap: '2' }, children: [_jsx(ChainTokenIcon, { chainId: toToken.chainId, tokenlogoURI: toToken.logoURI, tokenSymbol: toToken.symbol, css: { height: 32, width: 32 } }), isLoadingTransaction ? (_jsx(Skeleton, { css: { height: 24, width: 60, background: 'gray5' } })) : (_jsxs(Text, { style: "subtitle1", ellipsify: true, children: [toAmountFormatted, " ", toToken.symbol] }))] }), _jsxs(Flex, { direction: "column", css: { gap: '2' }, align: "center", children: [_jsxs(Anchor, { href: moonpayTxUrl, target: "_blank", css: { display: 'flex', alignItems: 'center', gap: '1' }, children: ["View MoonPay transaction", ' ', _jsx(FontAwesomeIcon, { icon: faUpRightFromSquare, style: { width: 14 } })] }), fillTxUrl ? (_jsxs(Anchor, { href: fillTxUrl, target: "_blank", children: ["View Tx: ", truncateAddress(fillTxHash)] })) : null] })] }), _jsxs(Flex, { css: { width: '100%', mt: '24px', gap: '3' }, children: [fillTxHash ? (_jsx("a", { href: `${baseTransactionUrl}/transaction/${fillTxHash}`, style: { width: '100%' }, target: "_blank", onClick: (e) => {
e.stopPropagation();
}, children: _jsx(Button, { color: "secondary", css: {
justifyContent: 'center',
width: 'max-content'
}, children: "View Details" }) })) : null, _jsx(Button, { onClick: () => {
onOpenChange(false);
}, css: {
justifyContent: 'center',
width: '100%'
}, children: "Done" })] })] }));
};
//# sourceMappingURL=OnrampSuccessStep.js.map