diff --git a/app/callout.tsx b/app/callout.tsx index 07af226..28dc924 100644 --- a/app/callout.tsx +++ b/app/callout.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { motion } from 'framer-motion'; -const CalloutModal = ({ isOpen, onClose, item, onSubmit }) => { +const CalloutModal = ({ isOpen, onClose, onSubmit }) => { const [tokenId, setTokenId] = useState(''); const handleTokenChange = (e) => { diff --git a/app/globals.css b/app/globals.css index 7d4081c..5a28f75 100644 --- a/app/globals.css +++ b/app/globals.css @@ -60,13 +60,11 @@ body { justify-content: center; /* Center vertically */ align-items: center; /* Center horizontally */ position: relative; - transition:{duration:1} } .leaderboard-card:hover{ background: var(--glassmorphism-gradient-hover), var(--glassmorphism-bg); - transition:{duration:1} } diff --git a/app/modal.tsx b/app/modal.tsx index 831afa7..ba23fc5 100644 --- a/app/modal.tsx +++ b/app/modal.tsx @@ -1,11 +1,15 @@ -// Modal.js - -import React, { useEffect,useState} from 'react'; +import React, { useEffect, useState } from 'react'; import { motion } from 'framer-motion'; -const Modal = ({ isOpen, onClose, item }) => { +interface Detail { + token: string; + gains: number; + price_at_creation: number; + price_now: number; +} - const [details, setDetails] = useState(null); +const Modal: React.FC<{ isOpen: boolean; onClose: () => void; item: { username: string; points: number } }> = ({ isOpen, onClose, item }) => { + const [details, setDetails] = useState(null); // Specify null as the initial type useEffect(() => { if (isOpen && item) { @@ -32,46 +36,46 @@ const Modal = ({ isOpen, onClose, item }) => { + exit={{ opacity: 0 }} + className="fixed inset-0 z-50 flex items-center justify-center overflow-x-hidden overflow-y-auto outline-none focus:outline-none modal-bg" + onClick={onClose} + >
- {/* Modal content */}
- {/* Header */}

{item.username}s Callouts

- {/* */} -
- {/* Body */} -
-

0 ? 'text-green-500' : 'text-red-500' - }`}>Total Gains : {parseFloat(item.points).toFixed(2)} x

- {details != null ? ( -
- {details.map((detail) => ( -

0 ? 'text-green-500' : 'text-red-400' - }`} - > - {detail.token}: {parseFloat(detail.gains).toFixed(2)}x [ - {parseFloat(detail.price_at_creation).toFixed(8) + ' => ' + parseFloat(detail.price_now).toFixed(8)}] -

- ))} -
- ) : ( -

Loading...

- )} -
- +

0 ? 'text-green-500' : 'text-red-500' + }`} + > + Total Gains : {item.points.toFixed(2)} x +

+
+
+ {details !== null ? ( +
+ {details.map((detail) => ( +

0 ? 'text-green-500' : 'text-red-400' + }`} + > + {detail.token}: {detail.gains.toFixed(2)}x [ + {detail.price_at_creation.toFixed(8) + + ' => ' + + detail.price_now.toFixed(8)} + ] +

+ ))} +
+ ) : ( +

Loading...

+ )} +
diff --git a/app/page.tsx b/app/page.tsx index 256d260..3631262 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -245,7 +245,7 @@ function Home() { {/* Modal */} - + {/* Rest of your Home component */}