From ef4aa4eb8c443d81096809c1ecec1601531dd185 Mon Sep 17 00:00:00 2001 From: David Klakurka Date: Thu, 23 Jul 2026 09:23:58 -0700 Subject: [PATCH] Removed bad code --- .../components/Widget/AltpaymentWidget.tsx | 45 +++++-------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/react/lib/components/Widget/AltpaymentWidget.tsx b/react/lib/components/Widget/AltpaymentWidget.tsx index 508fa455..8798f9ef 100644 --- a/react/lib/components/Widget/AltpaymentWidget.tsx +++ b/react/lib/components/Widget/AltpaymentWidget.tsx @@ -73,7 +73,6 @@ export const AltpaymentWidget: React.FunctionComponent = props const [selectedCoinNetwork, setSelectedCoinNetwork] = useState(undefined); const [pairAmountFixedDecimals, setPairAmountFixedDecimals] = useState(undefined); const [pairAmount, setPairAmount] = useState(undefined); - const [activeShiftStep, setActiveShiftStep] = useState<1 | 2 | 3>(1) const autoRateRequestedRef = useRef(false); const autoQuoteRequestedRef = useRef(false); const prevAltpaymentSocketRef = useRef(undefined); @@ -348,7 +347,7 @@ export const AltpaymentWidget: React.FunctionComponent = props }, 1500) } - const copyToClipboard = async (value: string, nextStep?: 1 | 2 | 3): Promise => { + const copyToClipboard = async (value: string): Promise => { if (!value) { return } @@ -356,20 +355,11 @@ export const AltpaymentWidget: React.FunctionComponent = props try { await navigator.clipboard.writeText(value) showCopyToast('Copied') - if (nextStep !== undefined) { - setActiveShiftStep(nextStep) - } } catch { showCopyToast('Copy failed') } } - useEffect(() => { - if (altpaymentShift?.id) { - setActiveShiftStep(1) - } - }, [altpaymentShift?.id]) - const SideshiftCtn = styled('div')({ alignItems: 'center', justifyContent: 'flex-start', @@ -481,22 +471,9 @@ export const AltpaymentWidget: React.FunctionComponent = props padding: '10px', borderRadius: '5px', color: 'red' }) - const ShiftStepLabel = styled('span', { - shouldForwardProp: (prop) => prop !== 'active', - })<{ active?: boolean }>(({ active }) => ({ - fontSize: '14px', - marginLeft: '5px', - fontWeight: 700, - padding: '4px 8px', - borderRadius: '999px', - display: 'inline-flex', - alignItems: 'center', - lineHeight: 1.2, - transition: 'all 140ms ease', - border: active ? '1px solid #0074c2' : '1px solid #d6d6d6', - background: active ? '#e9f3fb' : 'transparent', - color: active ? '#005e9d' : '#2f2f2f', - })) + const ShiftLabel = styled('span')({ + fontSize: '14px', marginLeft: '5px', fontWeight: 600 + }) const ShiftSubLabel = styled('span')({ fontSize: '11px', @@ -728,7 +705,7 @@ export const AltpaymentWidget: React.FunctionComponent = props - Step 1: Send + Send @@ -739,7 +716,7 @@ export const AltpaymentWidget: React.FunctionComponent = props {altpaymentShift.depositAmount}{' '}{altpaymentShift.depositCoin} - { void copyToClipboard(altpaymentShift.depositAmount, 2) }}> + { void copyToClipboard(altpaymentShift.depositAmount) }}> Copy = props - Step 2: To + To Network: {formatNetworkName(selectedCoinNetwork)} @@ -756,14 +733,14 @@ export const AltpaymentWidget: React.FunctionComponent = props {altpaymentShift.depositAddress} - { void copyToClipboard(altpaymentShift.depositAddress, 3) }}> + { void copyToClipboard(altpaymentShift.depositAddress) }}> Copy - { void copyToClipboard(shiftQrValue, 3) }}> + { void copyToClipboard(shiftQrValue) }}> = props includeMargin /> - Step 3: SideShift ID + SideShift ID {altpaymentShift.id} - { void copyToClipboard(altpaymentShift.id, 3) }}> + { void copyToClipboard(altpaymentShift.id) }}>