diff --git a/src/app/usd-ars-price/page.tsx b/src/app/usd-ars-price/page.tsx new file mode 100644 index 000000000..db75c10a9 --- /dev/null +++ b/src/app/usd-ars-price/page.tsx @@ -0,0 +1,140 @@ +'use client' + +import Layout from '@/components/Global/Layout' +import { motion } from 'framer-motion' +import borderCloud from '@/assets/illustrations/border-cloud.svg' +import noHiddenFees from '@/assets/illustrations/no-hidden-fees.svg' +import { useEffect, useState } from 'react' +import { Star } from '@/assets' +import Image from 'next/image' +import { useExchangeRate } from '@/hooks/useExchangeRate' + +export default function UsdArsPrice() { + const [screenWidth, setScreenWidth] = useState(typeof window !== 'undefined' ? window.innerWidth : 1200) + + const { sourceAmount, destinationAmount, isLoading, isError } = useExchangeRate({ + sourceCurrency: 'USD', + destinationCurrency: 'ARS', + initialSourceAmount: 1, + }) + + const createCloudAnimation = (side: 'left' | 'right', top: string, width: number, speed: number) => { + const vpWidth = screenWidth || 1080 + const totalDistance = vpWidth + width + + return { + initial: { x: side === 'left' ? -width : vpWidth }, + animate: { x: side === 'left' ? vpWidth : -width }, + transition: { + ease: 'linear', + duration: totalDistance / speed, + repeat: Infinity, + }, + } + } + + useEffect(() => { + const handleResize = () => { + setScreenWidth(window.innerWidth) + } + + handleResize() + window.addEventListener('resize', handleResize) + return () => window.removeEventListener('resize', handleResize) + }, []) + + return ( + +
+
+ {/* Animated clouds */} + + +
+ +
+ {/* Animated stars */} + + + + + +

+ ZERO FEES +

+ + {/* No hidden fees SVG */} +
+ Really, we mean zero. No hidden fees +
+ + {/* */} + +
+ {isLoading &&
} + + {!isLoading && isError && ( +

+ Couldn't load ARS rate. Please try again. +

+ )} + {!isLoading && !isError && ( +

+ ${sourceAmount} = {destinationAmount} ARS +

+ )} +
+
+
+
+ ) +}