From 39bdcbafacefaad6d7b4c710521dba85d9250a83 Mon Sep 17 00:00:00 2001 From: Seroxdesign Date: Mon, 2 Oct 2023 10:39:30 -0400 Subject: [PATCH] community tabs, tablist and body --- packages/web/pages/community/index.tsx | 107 +++++++++++++++++- packages/web/pages/join/guild/[guildname].tsx | 2 +- packages/web/pages/join/guild/index.tsx | 9 -- packages/web/pages/players.tsx | 2 +- 4 files changed, 107 insertions(+), 13 deletions(-) diff --git a/packages/web/pages/community/index.tsx b/packages/web/pages/community/index.tsx index e3932535..6f529c78 100644 --- a/packages/web/pages/community/index.tsx +++ b/packages/web/pages/community/index.tsx @@ -1,3 +1,106 @@ -import React from 'react'; +import { + Box, + Button, + Flex, + HStack, + MetaHeading, + Tab, + TabList, + TabPanel, + TabPanels, + Tabs, + VStack, +} from '@metafam/ds'; +import { PageContainer } from 'components/Container'; +import { getPatrons, getPSeedPrice } from 'graphql/getPatrons'; +import { getGuilds } from 'graphql/queries/guild'; +import { InferGetStaticPropsType } from 'next'; +import GuildsPage from 'pages/guilds'; +import PatronsPage from 'pages/patrons'; +import Players from 'pages/players'; +import React, { useEffect, useState } from 'react'; -export const UnifiedCommunityPage: React.FC = () =>
UnifiedCommunit
; +type Props = InferGetStaticPropsType; + +export const getStaticProps = async () => { + const patronsLimit = 150; + const patrons = await getPatrons(patronsLimit); + const pSeedPrice = await getPSeedPrice().catch((error) => { + console.error('Error fetching pSeed price', error); + return null; + }); + return { + props: { + guilds: await getGuilds(), + patrons, + pSeedPrice, + }, + revalidate: 1, + }; +}; + +const UnifiedCommunityPage: React.FC = ({ + guilds, + patrons, + pSeedPrice, +}) => ( + + + Community + + + + + Players + + + Guilds + + + Patrons + + {/* Elders */} + + + + + + + + + + + + {/* + Elders + */} + + + + + +); +export default UnifiedCommunityPage; diff --git a/packages/web/pages/join/guild/[guildname].tsx b/packages/web/pages/join/guild/[guildname].tsx index cc3dcc7a..fae529b6 100644 --- a/packages/web/pages/join/guild/[guildname].tsx +++ b/packages/web/pages/join/guild/[guildname].tsx @@ -114,7 +114,7 @@ const SetupGuild: React.FC = () => { rounded="lg" p="6" my="6" - w="100%" + w="max-content" align="stretch" justify="space-between" > diff --git a/packages/web/pages/join/guild/index.tsx b/packages/web/pages/join/guild/index.tsx index af77f5d1..6362750c 100644 --- a/packages/web/pages/join/guild/index.tsx +++ b/packages/web/pages/join/guild/index.tsx @@ -113,15 +113,6 @@ export const GuildJoinLanding: React.FC = ({ guilds }) => { {/* Section: Tiers and Perks */} - - {/* Section: Other guilds include... - NOTES - - Was supposed to be limited to 6 guilds with a LOAD MORE button :( - - Is actually limited to first 6 guilds with VIEW ALL GUILDS button that links to https://metagame.wtf/guilds - - This section is not imported as a component because getStaticProps is used to get the list of guilds and it's not possible - to use getStaticProps in a component that is imported to a static page - */} - ; export const getStaticProps = async (): Promise<{ - props: { urqlState: SSRData }; + props: { urqlState?: SSRData }; revalidate: 1; }> => { const [ssrClient, ssrCache] = getSsrClient();