From ac6e7b9cf7d7b09548e8239bc469f79f76dc8270 Mon Sep 17 00:00:00 2001 From: Vyvy-vi Date: Thu, 27 May 2021 02:26:56 +0530 Subject: [PATCH] chore: rebase and squash feat: meta tags for player pages feat: meta tags for quest pages feat: meta tags for patrons page fix: typos, extra tags feat: HeadComponent for metadata feat: HeadComponent in pages Implements the HeadComponent from components/Seo.tsx to take props and render the relevant meta tags in the pages fix: type-cast to string fix: string for playersDescriptionmeta fix: optional chaining player meta data fix: text consistency and typo-fixes fix: use player helpers for meta feat: meta tags for guilds route feat: meta tags for player pages feat: meta tags for quest pages feat: meta tags for patrons page feat: HeadComponent in pages Implements the HeadComponent from components/Seo.tsx to take props and render the relevant meta tags in the pages fix: type-cast to string fix: import Head in _app --- packages/web/components/Seo.tsx | 40 ++++++++++++++++++++++++ packages/web/pages/guild/[guildname].tsx | 7 +++++ packages/web/pages/guilds.tsx | 6 ++++ packages/web/pages/patrons.tsx | 6 ++++ packages/web/pages/player/[username].tsx | 11 +++++++ packages/web/pages/players.tsx | 2 ++ packages/web/pages/quest/[id].tsx | 6 ++++ packages/web/pages/quest/create.tsx | 5 +++ packages/web/pages/quests.tsx | 6 ++++ 9 files changed, 89 insertions(+) create mode 100644 packages/web/components/Seo.tsx diff --git a/packages/web/components/Seo.tsx b/packages/web/components/Seo.tsx new file mode 100644 index 000000000..065dbd1bd --- /dev/null +++ b/packages/web/components/Seo.tsx @@ -0,0 +1,40 @@ +import Head from 'next/head'; +import React from 'react'; + +export type HeadMetaProps = { + title?: string; + description?: string; + url?: string; + img?: string; +}; + +export const HeadComponent: React.FC = ({ + title = 'MetaGame', + description = 'Metagame is a Massive Online Coordination Game! Metagame is any approach to a game that transcends or operates outside of the prescribed rules of the game, uses external factors to affect the game, or goes beyond the supposed limits or environment set by the game.', + url = 'https://my.metagame.wtf/', + img = 'https://my.metagame.wtf/_next/image?url=%2Fassets%2Flogo.alt.png&w=1920&q=75', +}) => ( + + MetaGame + + + + + + + + + + + + + + + + + + + + + +); diff --git a/packages/web/pages/guild/[guildname].tsx b/packages/web/pages/guild/[guildname].tsx index fb4ed89b9..4709dee82 100644 --- a/packages/web/pages/guild/[guildname].tsx +++ b/packages/web/pages/guild/[guildname].tsx @@ -16,6 +16,7 @@ import { PageContainer } from '../../components/Container'; import { GuildHero } from '../../components/Guild/GuildHero'; import { GuildLinks } from '../../components/Guild/GuildLinks'; import { ProfileSection } from '../../components/ProfileSection'; +import { HeadComponent } from '../../components/Seo'; type Props = InferGetStaticPropsType; @@ -32,6 +33,12 @@ const GuildPage: React.FC = ({ guild, quests }) => { return ( + { const GuildsPage: React.FC = ({ guilds }) => ( + ); diff --git a/packages/web/pages/patrons.tsx b/packages/web/pages/patrons.tsx index 9730ad4c6..d3d2dd673 100644 --- a/packages/web/pages/patrons.tsx +++ b/packages/web/pages/patrons.tsx @@ -1,5 +1,6 @@ import { PageContainer } from 'components/Container'; import { PatronList } from 'components/Patron/PatronList'; +import { HeadComponent } from 'components/Seo'; import { getPatrons } from 'graphql/getPatrons'; import { InferGetStaticPropsType } from 'next'; import React from 'react'; @@ -18,6 +19,11 @@ export const getStaticProps = async () => { const PatronsPage: React.FC = ({ patrons }) => ( + ); diff --git a/packages/web/pages/player/[username].tsx b/packages/web/pages/player/[username].tsx index a90c0f70e..fc00f4236 100644 --- a/packages/web/pages/player/[username].tsx +++ b/packages/web/pages/player/[username].tsx @@ -17,6 +17,11 @@ import { PlayerAddSection } from '../../components/Player/Section/PlayerAddSecti import { PlayerGallery } from '../../components/Player/Section/PlayerGallery'; import { PlayerMemberships } from '../../components/Player/Section/PlayerMemberships'; import { PlayerSkills } from '../../components/Player/Section/PlayerSkills'; +import { HeadComponent } from '../../components/Seo'; +import { + getPlayerDescription, + getPlayerImage, +} from '../../utils/playerHelpers'; type Props = InferGetStaticPropsType; @@ -100,6 +105,12 @@ const PlayerPage: React.FC = ({ player }) => { return ( + = () => { } = usePlayerFilter(); return ( + = ({ quest_id }) => { return ( + = ({ guilds, skillChoices }) => { return ( + Create quest = () => { return ( + Quest explorer