diff --git a/web/components/manaboard.tsx b/web/components/manaboard.tsx
new file mode 100644
index 00000000..7d4191ca
--- /dev/null
+++ b/web/components/manaboard.tsx
@@ -0,0 +1,114 @@
+import clsx from 'clsx'
+import { useState } from 'react'
+import { ENV_CONFIG } from '../../common/envs/constants'
+import { User } from '../../common/user'
+import { useUser } from '../hooks/use-user'
+import { AmountInput } from './amount-input'
+import { Avatar } from './avatar'
+import { Col } from './layout/col'
+import { Modal } from './layout/modal'
+import { Row } from './layout/row'
+import { SiteLink } from './site-link'
+import { Title } from './title'
+
+export function Manaboard(props: {
+ title: string
+ users: User[]
+ className?: string
+}) {
+ // TODO: Ideally, highlight your own entry on the leaderboard
+ const { title, users, className } = props
+ return (
+
+
+ {users.length === 0 ? (
+
None yet
+ ) : (
+
+
+
+
+ # |
+ Name |
+ |
+
+
+
+ {users.map((user, index) => (
+
+ {index + 1} |
+
+
+
+ {user.name}
+
+ |
+
+
+ |
+
+ ))}
+
+
+
+ )}
+
+ )
+}
+
+export function BuySlotModal(props: {
+ title: string
+ holder: User
+ slot: number
+}) {
+ const { slot, title, holder } = props
+ const user = useUser()
+
+ const [open, setOpen] = useState(false)
+ return (
+ <>
+
+
+
+
+ Currently
+
+ #{slot}
+
+ {holder.name}
+
+
+ After purchasing
+ {user && (
+
+ #{slot}
+
+ {user.name}
+
+ )}
+
+ Assess value
+ {}}
+ error={''}
+ // error="You don't have enough mana"
+ label={ENV_CONFIG.moneyMoniker}
+ />
+
+
+
+
+
+ >
+ )
+}
diff --git a/web/pages/leaderboards.tsx b/web/pages/leaderboards.tsx
index bf202b6f..da754f21 100644
--- a/web/pages/leaderboards.tsx
+++ b/web/pages/leaderboards.tsx
@@ -6,6 +6,7 @@ import { Page } from '../components/page'
import { getTopCreators, getTopTraders, User } from '../lib/firebase/users'
import { formatMoney } from '../../common/util/format'
import { fromPropz, usePropz } from '../hooks/use-propz'
+import { Manaboard } from '../components/manaboard'
export const getStaticProps = fromPropz(getStaticPropz)
export async function getStaticPropz() {
@@ -24,10 +25,7 @@ export async function getStaticPropz() {
}
}
-export default function Leaderboards(props: {
- topTraders: User[]
- topCreators: User[]
-}) {
+function Leaderboards(props: { topTraders: User[]; topCreators: User[] }) {
props = usePropz(props, getStaticPropz) ?? {
topTraders: [],
topCreators: [],
@@ -61,3 +59,23 @@ export default function Leaderboards(props: {
)
}
+
+export default function Manaboards(props: {
+ topTraders: User[]
+ topCreators: User[]
+}) {
+ props = usePropz(props, getStaticPropz) ?? {
+ topTraders: [],
+ topCreators: [],
+ }
+ const { topTraders, topCreators } = props
+
+ return (
+
+
+
+
+
+
+ )
+}