diff --git a/src/Components/TipButton/TipButton.tsx b/src/Components/TipButton/TipButton.tsx index f33a332..8c97ea5 100644 --- a/src/Components/TipButton/TipButton.tsx +++ b/src/Components/TipButton/TipButton.tsx @@ -22,6 +22,7 @@ type Props = { export default function TipButton({ onTip = () => { }, ...props }: Props) { const [tipCnt, setTipCnt] = useState(0) + const [incStep, setIncStep] = useState(10) const [sparks, setSparks] = useState([]); const [wasActive, setWasActive] = useState(false); @@ -53,8 +54,9 @@ export default function TipButton({ onTip = () => { }, ...props }: Props) { const { onPressDown, onPressUp } = usePressHolder(_throttle(() => { - const incStep = (Math.ceil((tipCnt + 1) / 100) + 1) ** 2; - setTipCnt(s => s + incStep) + const _incStep = (Math.ceil((tipCnt + 1) / 10) + 1) ** 2 * 10; + setIncStep(_incStep) + setTipCnt(s => { console.log('update'); return s + _incStep}) const newSpark = { id: Math.random().toString(), @@ -84,7 +86,6 @@ export default function TipButton({ onTip = () => { }, ...props }: Props) { } const handlePressUp = (event?: any) => { - if (!wasActive) return; setWasActive(false); @@ -95,9 +96,9 @@ export default function TipButton({ onTip = () => { }, ...props }: Props) { else setTimeout(() => { setSparks([]); - onTip(tipCnt); + onTip(tipCnt + incStep); // somehow we always miss one incStep setTipCnt(0); - }, 1000) + }, 500) } return ( @@ -116,7 +117,7 @@ export default function TipButton({ onTip = () => { }, ...props }: Props) { } as any} {...props} > - Hold To Tip !!! + Hold To Vote !!! { console.log(e); } ) // ONLY TEMPROARY !!! SHOULD BE FIXED FROM BACKEND .finally(() => { setTimeout(() => { onClose?.(); - }, 2000); + }, 4000); }) } catch (error) { @@ -94,7 +94,7 @@ export default function TipCard({ onClose, direction, tipValue, ...props }: Prop setPaymentStatus(PaymentStatus.PAYMENT_CONFIRMED); setTimeout(() => { onClose?.(); - }, 2000); + }, 4000); }, onError: () => { } @@ -125,7 +125,7 @@ export default function TipCard({ onClose, direction, tipValue, ...props }: Prop className="modal-card max-w-[343px] p-24 rounded-xl relative" > -

Tip this Project

+

Vote for this Project

1 sat = 1 vote

- {paymentStatus === PaymentStatus.FETCHING_PAYMENT_DETAILS &&

Please wait while we the fetch payment details.

} + {paymentStatus === PaymentStatus.FETCHING_PAYMENT_DETAILS &&

Please wait while we the fetch payment details.

} {paymentStatus === PaymentStatus.NOT_PAID &&

You did not confirm the payment. Please try again.

} {paymentStatus === PaymentStatus.PAID &&

The invoice was paid! Please wait while we confirm it.

} - {paymentStatus === PaymentStatus.AWAITING_PAYMENT &&

Please confirm the payment in the prompt...

} - {paymentStatus === PaymentStatus.PAYMENT_CONFIRMED &&

Imagine confetti here

} - {paymentStatus === PaymentStatus.PAYMENT_CONFIRMED && }