diff --git a/components/LeaderboardPage/LeaderboardAddress.tsx b/components/LeaderboardPage/LeaderboardAddress.tsx deleted file mode 100644 index c939e208..00000000 --- a/components/LeaderboardPage/LeaderboardAddress.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { useEffect, useState } from "react" - -import retryGetEns from "../../lib/retryGetEns" -import truncateEthAddress from "../../lib/truncateEthAddress" -import getLensHandle from "../../lib/lens/getLensHandle" - -const LeaderboardAddress = ({ address }) => { - const [ensName, setEnsName] = useState(null as string) - - const handleClick = () => { - if (ensName?.includes?.(".lens")) { - window.open(`https://hey.xyz/u/${ensName}`, "_blank") - return - } - window.open(`https://zora.co/${ensName || address}`, "_blank") - } - - useEffect(() => { - const init = async () => { - const lensHandle = await getLensHandle(address) - if (lensHandle) { - setEnsName(lensHandle) - return - } - const ensRecord = await retryGetEns(address) - if (!ensRecord?.title) return - setEnsName(ensRecord?.title) - } - - if (!address) return - init() - }, [address]) - - return ( - - - - ) -} - -export default LeaderboardAddress diff --git a/components/LeaderboardPage/LeaderboardHeader.tsx b/components/LeaderboardPage/LeaderboardHeader.tsx deleted file mode 100644 index 7c0990c7..00000000 --- a/components/LeaderboardPage/LeaderboardHeader.tsx +++ /dev/null @@ -1,46 +0,0 @@ -const LeaderboardHeader = () => ( - - - - Rank - - - Score - - - Name - - - Address - - - -) - -export default LeaderboardHeader diff --git a/components/LeaderboardPage/LeaderboardPage.tsx b/components/LeaderboardPage/LeaderboardPage.tsx deleted file mode 100644 index a38c9958..00000000 --- a/components/LeaderboardPage/LeaderboardPage.tsx +++ /dev/null @@ -1,80 +0,0 @@ -import { useEffect, useState } from "react" -import LeaderboardRow from "./LeaderboardRow" -import SkeletonTableBody from "./SkeletonTableBody" -import SeoHead from "../SeoHead" -import { getLeaderboard } from "../../lib/firebase/firebase" -import LeaderboardHeader from "./LeaderboardHeader" -import { ARTIST, TITLE } from "../../lib/consts" - -const LeaderboardPage = () => { - const [scores, setScores] = useState([]) - - useEffect(() => { - const init = async () => { - const response = await getLeaderboard() - setScores(response) - } - init() - }, []) - - return ( -
- -
- Leaderboard -
-
-
- {TITLE} by {ARTIST} -
-
-
-
-
- - - {scores.length > 0 ? ( - - {scores.map((collector, index) => ( - - ))} - - ) : ( - - )} -
-
-
-
- ) -} - -export default LeaderboardPage diff --git a/components/LeaderboardPage/LeaderboardRow.tsx b/components/LeaderboardPage/LeaderboardRow.tsx deleted file mode 100644 index 4a616f91..00000000 --- a/components/LeaderboardPage/LeaderboardRow.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import LeaderboardAddress from "./LeaderboardAddress" - -const LeaderboardRow = ({ address, numberOwned, rank, name }) => ( - - - #{rank} - - - {numberOwned} - - - {name} - - - -) - -export default LeaderboardRow diff --git a/components/LeaderboardPage/SkeletonTableBody.tsx b/components/LeaderboardPage/SkeletonTableBody.tsx deleted file mode 100644 index 106dbd89..00000000 --- a/components/LeaderboardPage/SkeletonTableBody.tsx +++ /dev/null @@ -1,25 +0,0 @@ -/* eslint-disable react/no-array-index-key, jsx-a11y/control-has-associated-label */ -const SkeletonTableBody = () => ( - - {Array(10) - .fill(null) - .map((_, index) => ( - - -
- - -
- - -
- - -
- - - ))} - -) - -export default SkeletonTableBody diff --git a/components/Pages/LeaderboardPage/LeaderboardPage.tsx b/components/Pages/LeaderboardPage/LeaderboardPage.tsx new file mode 100644 index 00000000..c05a34e1 --- /dev/null +++ b/components/Pages/LeaderboardPage/LeaderboardPage.tsx @@ -0,0 +1,41 @@ +import useIsMobile from "@/hooks/useIsMobile" +import Layout from "@/components/Layout" +import SeoHead from "@/components/SeoHead" +import RecBar from "@/components/RecBar" +import BackPortalButton from "@/components/BackPortalButton" + +const LeaderboardPage = () => { + const isMobile = useIsMobile() + + return ( + + +
+
+