({
onBuyCoresClick,
amount,
priceFormatted,
origin,
pid,
}: BuyCoreProps)
| 24 | }; |
| 25 | |
| 26 | export const BuyCore = ({ |
| 27 | onBuyCoresClick, |
| 28 | amount, |
| 29 | priceFormatted, |
| 30 | origin, |
| 31 | pid, |
| 32 | }: BuyCoreProps): ReactElement => { |
| 33 | const isMobile = useViewSize(ViewSize.MobileL); |
| 34 | const params = new URLSearchParams(); |
| 35 | if (pid) { |
| 36 | params.append('pid', pid); |
| 37 | } |
| 38 | |
| 39 | if (origin) { |
| 40 | params.append('origin', origin); |
| 41 | } |
| 42 | |
| 43 | const href = getPathnameWithQuery( |
| 44 | `${webappUrl}cores${isMobile ? '/payment' : ''}`, |
| 45 | params, |
| 46 | ); |
| 47 | |
| 48 | return ( |
| 49 | <Link href={href}> |
| 50 | <a |
| 51 | href={href} |
| 52 | className="btn btn-tertiaryFloat flex flex-1 flex-col items-center rounded-14 p-2" |
| 53 | onClick={() => onBuyCoresClick({ amount, origin })} |
| 54 | > |
| 55 | <CoreIcon size={IconSize.XLarge} className="mb-1" /> |
| 56 | <Typography type={TypographyType.Title3} bold> |
| 57 | {formatCoresCurrency(amount)} |
| 58 | </Typography> |
| 59 | <Typography |
| 60 | type={TypographyType.Caption2} |
| 61 | color={TypographyColor.Tertiary} |
| 62 | > |
| 63 | {typeof priceFormatted !== 'undefined' ? priceFormatted : '~'} |
| 64 | </Typography> |
| 65 | </a> |
| 66 | </Link> |
| 67 | ); |
| 68 | }; |
nothing calls this directly
no test coverage detected