Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ interface VerificationStepViewProps {
isLoading: boolean;
type: string;
error: string | null;
autoComplete?: string;
name?: string;
}

const VerificationStepView = ({
Expand All @@ -56,6 +58,8 @@ const VerificationStepView = ({
isLoading,
type,
error,
autoComplete,
name,
}: VerificationStepViewProps) => (
<>
<HeaderInner title={title} icon={icon} variant="compressed" />
Expand All @@ -65,6 +69,8 @@ const VerificationStepView = ({
{label}
</label>
<Input
name={name}
autoComplete={autoComplete}
placeholder={placeholder}
value={value}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
Expand Down Expand Up @@ -374,6 +380,8 @@ export function Verification() {
onContinue={handleSendEmail}
isLoading={sendEmailMutation.isLoading}
type="email"
autoComplete="email"
name="email"
error={error}
/>
);
Expand Down Expand Up @@ -407,6 +415,8 @@ export function Verification() {
onContinue={handleSendPhone}
isLoading={sendPhoneMutation.isLoading}
type="tel"
autoComplete="tel"
name="phone"
error={error}
/>
);
Expand Down
14 changes: 13 additions & 1 deletion packages/keychain/src/context/starterpack/onchain-purchase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,18 @@ export const OnchainPurchaseProvider = ({
setDisplayError(undefined);
}, [selectedToken, selectedWallet, setDisplayError]);

// Auto-select USDC when Apple Pay is selected
useEffect(() => {
if (isApplePaySelected && availableTokens.length > 0) {
const usdcToken = availableTokens.find(
(token) => token.symbol === "USDC",
);
if (usdcToken && selectedToken?.address !== usdcToken.address) {
setSelectedToken(usdcToken);
}
}
}, [isApplePaySelected, availableTokens, selectedToken, setSelectedToken]);

// Wrap onSendDeposit to clear errors before sending
const onSendDeposit = useCallback(async () => {
setDisplayError(undefined);
Expand Down Expand Up @@ -475,7 +487,7 @@ export const OnchainPurchaseProvider = ({
convertedPrice,
swapQuote,
isFetchingConversion,
isTokenSelectionLocked,
isTokenSelectionLocked: isTokenSelectionLocked || isApplePaySelected,
conversionError,
usdAmount,
layerswapFees,
Expand Down
Loading