Skip to content

Commit 8a6146f

Browse files
committed
Fixing type errors in react example
1 parent 58adb61 commit 8a6146f

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

examples/components/src/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ const NetworkSelect = () => {
108108
>
109109
<div className="flex items-center gap-2">
110110
<NetworkImage chainId={chainId} size="sm" />
111-
<Text display={{ sm: 'none', lg: 'block' }} variant="normal" fontWeight="bold" color="primary">
111+
<Text className="hidden lg:block" variant="normal" fontWeight="bold" color="primary">
112112
{chains.find(chain => chain.id === chainId)?.name || chainId}
113113
</Text>
114114
</div>

examples/react/src/components/Connected.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,8 @@ export const Connected = () => {
701701
<Text variant="xsmall">{formatUnits(BigInt(option.value), option.token.decimals || 0)}</Text>
702702
</div>
703703
<div className="flex flex-row">
704-
<Text>Wallet balance for {option.token.name}: </Text> <Text>{option.balanceFormatted}</Text>
704+
<Text>Wallet balance for {option.token.name}: </Text>{' '}
705+
<Text>{'balanceFormatted' in option ? option.balanceFormatted : null}</Text>
705706
</div>
706707
</div>
707708
),
@@ -717,7 +718,7 @@ export const Connected = () => {
717718
)
718719

719720
if (selected?.token.contractAddress !== undefined) {
720-
if (!selected.hasEnoughBalanceForFee) {
721+
if (!('hasEnoughBalanceForFee' in selected) || !selected.hasEnoughBalanceForFee) {
721722
setFeeOptionAlert({
722723
title: 'Insufficient balance',
723724
description: `You do not have enough balance to pay the fee with ${selected.token.name}, please make sure you have enough balance in your wallet for the selected fee option.`,

examples/react/src/components/CustomCheckout/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const CustomCheckout = () => {
7676
}
7777

7878
if (orderSummary.error) {
79-
return <Text color="error">Error loading order summary</Text>
79+
return <Text color="negative">Error loading order summary</Text>
8080
}
8181

8282
return (
@@ -128,7 +128,7 @@ export const CustomCheckout = () => {
128128
}
129129

130130
if (creditCardPayment.error) {
131-
return <Text color="error">Error loading credit card payment</Text>
131+
return <Text color="negative">Error loading credit card payment</Text>
132132
}
133133

134134
const CreditCardIframe = creditCardPayment.data?.CreditCardIframe
@@ -152,7 +152,7 @@ export const CustomCheckout = () => {
152152
}
153153

154154
if (cryptoPayment.cryptoOptions.error) {
155-
return <Text color="error">Error loading crypto payment</Text>
155+
return <Text color="negative">Error loading crypto payment</Text>
156156
}
157157

158158
return (
@@ -183,15 +183,15 @@ export const CustomCheckout = () => {
183183
return (
184184
<div className="flex pt-16 pb-8 px-6 gap-2 flex-col">
185185
<Text color="primary">The following data is generated by the useCheckoutUI hook</Text>
186-
<Text fontSize="large" fontWeight="bold" color="primary">
186+
<Text variant="large" fontWeight="bold" color="primary">
187187
Order Summary section
188188
</Text>
189189
<OrderSummary />
190-
<Text fontSize="large" fontWeight="bold" color="primary">
190+
<Text variant="large" fontWeight="bold" color="primary">
191191
Crypto Payment section
192192
</Text>
193193
<CryptoPayment />
194-
<Text fontSize="large" fontWeight="bold" color="primary">
194+
<Text variant="large" fontWeight="bold" color="primary">
195195
Credit Card Payment section
196196
</Text>
197197
<CreditCardPayment />

examples/react/src/components/ImmutableCallback.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function ImmutableCallback() {
2424
return (
2525
<div className="flex flex-col items-center justify-center min-h-screen">
2626
<Spinner size="lg" />
27-
<Text marginTop="4">Processing Immutable login...</Text>
27+
<Text className="mt-4">Processing Immutable login...</Text>
2828
</div>
2929
)
3030
}

0 commit comments

Comments
 (0)