-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* logic for triggering new payment select modal * payment seleciton(wip) * added buy with currency flow * send transactions utility function * swap and buy * utility function * sardine checkout (wip) * credit card payment * card height adjustment * disable other buttons when a TX is in progress * adde sales contract-specific hook * renamed tokenId, collectionAddress and price fields * replaced chainId field with more generic chain field * clean up helpers * transfer to wallet * transfer funds modal context * export transfer funds modal * transfer funds modal * fixed add funds modal, trigger modal * new pnpm lock file * return txhash from onsuccess callback * fix peer deps * onClose callbacks * rename erc1155 sales contract setting modal * callback fns * disable mock connector * moved sardine * refactor selectpaymentmodal settings * wip * item description section * price section * price formatted * price section and layout * added footer * crypto option (WIP) * show list of options * on click purchase logic; fixed flickering issue * fuzzy search wup * fuzzy search * pay with credit card WIP * sardine logo * display fiat price * credit card section * remove unused settings * hide sections if only one item * native token information * return no quotes in case of error * fix currency info for native toknes * logic for native token tranasctions * disabling swap paymetns with native currency * fixes
- Loading branch information
Showing
25 changed files
with
5,055 additions
and
5,730 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export const HEADER_HEIGHT = '54px' | ||
export const CARD_HEIGHT = '130px' | ||
export const CARD_HEIGHT_MOBILE = '180px' | ||
export const CARD_HEIGHT_MOBILE = '180px' | ||
export const PAYMENT_SELECTION_MODAL_HEIGHT = '786px' |
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
66 changes: 0 additions & 66 deletions
66
packages/checkout/src/views/PaymentSelection/FiatOnRamp.tsx
This file was deleted.
Oops, something went wrong.
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,64 @@ | ||
import { Box, Text, SequenceIcon } from '@0xsequence/design-system' | ||
|
||
export const Footer = () => { | ||
return ( | ||
<Box position="fixed" height="7" marginTop="2" width="full" style={{ bottom: '4px' }}> | ||
<Box gap="4" justifyContent="center" alignItems="center"> | ||
<Box | ||
as="a" | ||
href="https://sequence.xyz/" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
textDecoration="none" | ||
opacity={{ hover: '80' }} | ||
gap="1" | ||
justifyContent="center" | ||
alignItems="center" | ||
cursor="pointer" | ||
> | ||
<SequenceIcon color="text50" /> | ||
<Text color="text50" variant="xsmall">Sequence</Text> | ||
</Box> | ||
<Box | ||
as="a" | ||
href="https://sequence.xyz/privacy" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
textDecoration="none" | ||
opacity={{ hover: '80' }} | ||
cursor="pointer" | ||
> | ||
<Text color="text50" variant="xsmall"> | ||
Privacy | ||
</Text> | ||
</Box> | ||
<Box | ||
as="a" | ||
href="https://sequence.xyz/terms" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
textDecoration="none" | ||
opacity={{ hover: '80' }} | ||
cursor="pointer" | ||
> | ||
<Text color="text50" variant="xsmall"> | ||
Terms | ||
</Text> | ||
</Box> | ||
<Box | ||
as="a" | ||
href="https://docs.sequence.xyz/" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
textDecoration="none" | ||
opacity={{ hover: '80' }} | ||
cursor="pointer" | ||
> | ||
<Text color="text50" variant="xsmall"> | ||
Help | ||
</Text> | ||
</Box> | ||
</Box> | ||
</Box> | ||
) | ||
} |
71 changes: 71 additions & 0 deletions
71
packages/checkout/src/views/PaymentSelection/ItemDescription/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { | ||
NetworkBadge, | ||
CollectibleTileImage, | ||
useTokenMetadata | ||
} from '@0xsequence/kit' | ||
import { Box, Spinner, Text } from '@0xsequence/design-system' | ||
import { findSupportedNetwork } from '@0xsequence/network' | ||
|
||
import { useSelectPaymentModal } from '../../../hooks' | ||
|
||
export const ItemDescription = () => { | ||
const { selectPaymentSettings } = useSelectPaymentModal() | ||
const nftQuantity = selectPaymentSettings!.nftQuantity | ||
const chain = selectPaymentSettings!.chain | ||
const network = findSupportedNetwork(chain) | ||
const chainId = network?.chainId || 137 | ||
const collectionAddress = selectPaymentSettings!.collectionAddress | ||
const tokenId = selectPaymentSettings!.tokenId | ||
const { data: tokenMetadatas, isLoading: isLoadingTokenMetadatas } = useTokenMetadata(chainId, collectionAddress, [tokenId]) | ||
const tokenMetadata = tokenMetadatas?.[0] | ||
|
||
const isLoading = isLoadingTokenMetadatas | ||
|
||
if (isLoading) { | ||
<Box marginBottom="2" paddingX="6" gap="3" style={{ height: '72px' }}> | ||
<Spinner /> | ||
</Box> | ||
} | ||
|
||
return ( | ||
<Box marginBottom="2" paddingX="6" gap="5" alignItems="center"> | ||
<Box position="relative"> | ||
<Box | ||
background="backgroundControl" | ||
borderRadius="md" | ||
style={{ | ||
height: "60px", | ||
width: "60px", | ||
transform: "rotate(-15deg)" | ||
}} | ||
/> | ||
<Box | ||
position="absolute" | ||
borderRadius="md" | ||
style={{ | ||
height: "60px", | ||
width: "60px", | ||
bottom: '0' | ||
}} | ||
> | ||
<CollectibleTileImage imageUrl={tokenMetadata?.image} /> | ||
</Box> | ||
</Box> | ||
<Box flexDirection="column" gap="0.5"> | ||
<Text | ||
variant="normal" | ||
color="text100" | ||
fontWeight="bold" | ||
> | ||
{tokenMetadata?.name || "Unknown"} | ||
</Text> | ||
<Text variant="normal" color="text50" fontWeight="medium"> | ||
{Number(nftQuantity) === 1 ? `${nftQuantity} item` : `${nftQuantity} items`} | ||
</Text> | ||
<Box marginTop="1"> | ||
<NetworkBadge chainId={chainId} /> | ||
</Box> | ||
</Box> | ||
</Box> | ||
) | ||
} |
53 changes: 53 additions & 0 deletions
53
packages/checkout/src/views/PaymentSelection/PayWithCreditCard/PaymentProviderOption.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { Box, Card, Text } from '@0xsequence/design-system' | ||
|
||
interface PaymentProviderOptionProps { | ||
name: string | ||
onClick: () => void | ||
isSelected: boolean | ||
isRecommended: boolean | ||
logo: JSX.Element | ||
} | ||
|
||
export const PaymentProviderOption = ({ | ||
name, | ||
onClick, | ||
isSelected, | ||
isRecommended, | ||
logo | ||
}: PaymentProviderOptionProps) => { | ||
return ( | ||
<Card | ||
borderColor={isSelected ? 'backgroundRaised' : 'transparent' } | ||
borderWidth="thick" | ||
borderStyle="solid" | ||
justifyContent="space-between" | ||
padding="4" | ||
onClick={onClick} | ||
opacity={{ | ||
hover: '80', | ||
base: '100' | ||
}} | ||
cursor="pointer" | ||
> | ||
<Box justifyContent="space-between" width="full"> | ||
<Box justifyContent="space-between" alignItems="center" gap="3"> | ||
<Box borderRadius="md"> | ||
{logo} | ||
</Box> | ||
<Text | ||
variant="normal" | ||
fontWeight="bold" | ||
color="text80" | ||
> | ||
{name} | ||
</Text> | ||
</Box> | ||
<Box flexDirection="row" justifyContent="center" alignItems="center" gap="3"> | ||
{isRecommended && ( | ||
<Text color="text50" variant="small">Recommended</Text> | ||
)} | ||
</Box> | ||
</Box> | ||
</Card> | ||
) | ||
} |
Oops, something went wrong.