Skip to content

Commit

Permalink
theme metadata to advanced config
Browse files Browse the repository at this point in the history
  • Loading branch information
oohwooh committed Dec 9, 2023
1 parent 465dc9a commit 8ed78a6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/pages/events/[event]/advancedConfig.gql
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ query getEventAdvancedConfigQuery($data: ClearEventWhereUniqueInput!) {
noticeHero: getMetadata(key: "notice.hero")
noticeTop: getMetadata(key: "notice.top")
noticeBox: getMetadata(key: "notice.box")
disableTheme: getMetadata(key: "theme.disable")
customTheme: getMetadata(key: "theme.custom.text")
customThemeBackgrounds: getMetadata(key: "theme.custom.backgrounds")
}
}
}
29 changes: 28 additions & 1 deletion src/pages/events/[event]/advancedConfig.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React from "react";
import Page from "../../../components/Page";
import Breadcrumbs from "../../../components/Breadcrumbs";
import {Heading, Text} from "@codeday/topo/Atom"
import {Heading, Link, Text} from "@codeday/topo/Atom"
import {getSession} from "next-auth/react";
import {getFetcher} from "../../../fetch";
import {UiInfo} from "@codeday/topocons/Icon"
import EditSpecificMetadata from "../../../components/forms/EditSpecificMetadata";
import { SetEventMetadataMutation } from "../../../components/forms/EditSpecificMetadata.gql"
import { getEventAdvancedConfigQuery } from "./advancedConfig.gql"
import DocsCallout from '../../../components/DocsCallout';

export default function AdvancedConfig({event}) {
if (!event) return <Page />
return (
Expand Down Expand Up @@ -94,6 +96,31 @@ export default function AdvancedConfig({event}) {
setMutation={SetEventMetadataMutation}
updateId={event.id}
/>
<EditSpecificMetadata
displayKeyAs="Disable theme"
description="Do not show a theme on event.codeday.org or present.codeday.org"
metadataKey="theme.disable"
value={event.disableTheme}
setMutation={SetEventMetadataMutation}
updateId={event.id}
/>
<DocsCallout>Read <Link color="brand" to="https://www.notion.so/codeday/Setting-a-custom-theme-87d8785497f3451aab32a395338ee467">this</Link> before setting a custom theme or it <b>will not work.</b></DocsCallout>
<EditSpecificMetadata
displayKeyAs="Custom theme text"
description="Override the theme from Contentful"
metadataKey="theme.custom.text"
value={event.customTheme}
setMutation={SetEventMetadataMutation}
updateId={event.id}
/>
<EditSpecificMetadata
displayKeyAs="Custom theme backgrounds"
description=""
metadataKey="theme.custom.backgrounds"
value={event.customThemeBackgrounds}
setMutation={SetEventMetadataMutation}
updateId={event.id}
/>
</Page>
)
}
Expand Down

0 comments on commit 8ed78a6

Please sign in to comment.