Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
erikrakuscek committed Mar 14, 2024
1 parent 1b32a9c commit 09325a6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
7 changes: 6 additions & 1 deletion packages/commerce/components/checkout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ const Checkout: React.FC<{toggleCheckout: () => void}> = observer(({toggleChecko
const step1 = auth.loggedIn ? (
<div className='flex flex-col gap-4'>
<ContactInfo form={contactForm}/>
<Payment orderId={orderId} setOrderId={setOrderId} setCurrentStep={setCurrentStep} contactForm={contactForm}/>
<Payment
orderId={orderId}
setOrderId={setOrderId}
setCurrentStep={setCurrentStep}
contactForm={contactForm}
/>
</div>
) : (
<LoginComponent hideHeader className='max-w-[20rem] mx-auto'/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ import { Copy } from 'lucide-react'

import { Button, Tabs, TabsContent, TabsList, TabsTrigger, toast } from '@hanzo/ui/primitives'

const InfoField: React.FC<{label: string, value: ReactNode, copyValue: string}> = ({label, value, copyValue}) => {
const InfoField: React.FC<{
label: string,
value: ReactNode,
copyValue: string
}> = ({
label,
value,
copyValue
}) => {
const copyToClipboard = (label: string, text: string) => {
navigator.clipboard.writeText(text)
toast({title: `${label} copied to clipboard`})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ const PayWithCard: React.FC<{
<>
<PaymentMethods/>

{/* Imitates hanzo/ui Button and Input styles, I was unable to render the hanzo/ui button outright and keeping the submit form functionality*/}
{/* Imitates hanzo/ui Button and Input styles, I was unable to render the
hanzo/ui button outright and keeping the submit form functionality*/}
<CreditCard
style={{
'.input-container': {
Expand Down
19 changes: 16 additions & 3 deletions packages/commerce/components/checkout/payment/pay-with-crypto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,11 @@ const PayWithCrypto: React.FC<{

const payWidget = !!!(auth.user?.walletAddress) ? (
<div className='w-full mx-auto max-w-[20rem]'>
<Button variant='outline' className='w-full flex items-center gap-2' onClick={auth.associateWallet.bind(auth)}>
<Button
variant='outline'
className='w-full flex items-center gap-2'
onClick={auth.associateWallet.bind(auth)}
>
<EthIconFromAuth height={20}/>Connect your wallet
</Button>
</div>
Expand All @@ -179,7 +183,10 @@ const PayWithCrypto: React.FC<{
<div>Available funds in your wallet: {availableAmount} ETH</div>
<div>
<Input value={amount ? amount/(10**18) : amount} contentEditable={false}/>
<div className='relative flex items-center gap-2 -top-[32px] justify-end px-2 py-1 rounded-lg bg-muted-4 w-fit text-xs float-right mr-3'><Eth height={10}/>ETH</div>
<div className='relative flex items-center gap-2 -top-[32px] justify-end px-2 py-1 rounded-lg bg-muted-4 w-fit text-xs float-right mr-3'>
<Eth height={10}/>
ETH
</div>
</div>
{transactionStatus === 'error' ? (
<h4 className='text-destructive'>There was an error while confirming the transaction.</h4>
Expand All @@ -195,7 +202,13 @@ const PayWithCrypto: React.FC<{
<div className='flex flex-col gap-6 mt-6'>
{payWidget}
{transactionStatus === 'unpaid' ? (
<Button onClick={() => sendPayment(amount ? amount/(10**18) : 0)} className='mx-auto w-full' disabled={loadingPrice}>Pay</Button>
<Button
onClick={() => sendPayment(amount ? amount/(10**18) : 0)}
className='mx-auto w-full'
disabled={loadingPrice}
>
Pay
</Button>
) : (
<Button onClick={nextStep} className='mx-auto w-full'>Continue</Button>
)}
Expand Down

0 comments on commit 09325a6

Please sign in to comment.