This commit is contained in:
DrMint 2022-03-31 15:01:44 +02:00
parent 125421de0f
commit 73ad43fe7d
6 changed files with 13 additions and 18 deletions

View File

@ -8,7 +8,10 @@ module.exports = {
headers: { Authorization: `Bearer ${process.env.ACCESS_TOKEN}` }, headers: { Authorization: `Bearer ${process.env.ACCESS_TOKEN}` },
}, },
}, },
documents: ["src/graphql/operations/*.graphql", "src/graphql/fragments/*.graphql"], documents: [
"src/graphql/operations/*.graphql",
"src/graphql/fragments/*.graphql",
],
generates: { generates: {
"src/graphql/generated.ts": { "src/graphql/generated.ts": {
plugins: [ plugins: [

View File

@ -79,7 +79,8 @@ export default function AppLayout(props: AppLayoutProps): JSX.Element {
const currencyOptions: string[] = []; const currencyOptions: string[] = [];
currencies.map((currency) => { currencies.map((currency) => {
if (currency.attributes?.code) currencyOptions.push(currency.attributes.code); if (currency.attributes?.code)
currencyOptions.push(currency.attributes.code);
}); });
const [currencySelect, setCurrencySelect] = useState<number>(-1); const [currencySelect, setCurrencySelect] = useState<number>(-1);
@ -132,10 +133,7 @@ export default function AppLayout(props: AppLayoutProps): JSX.Element {
></meta> ></meta>
<meta name="description" content={metaDescription} /> <meta name="description" content={metaDescription} />
<meta <meta name="twitter:description" content={metaDescription}></meta>
name="twitter:description"
content={metaDescription}
></meta>
<meta property="og:image" content={metaImage.image}></meta> <meta property="og:image" content={metaImage.image}></meta>
<meta property="og:image:secure_url" content={metaImage.image}></meta> <meta property="og:image:secure_url" content={metaImage.image}></meta>

View File

@ -58,4 +58,4 @@ query getPost($slug: String, $language_code: String) {
} }
} }
} }
} }

View File

@ -1,9 +1,9 @@
import { GraphQLClient } from "graphql-request"; import { GraphQLClient } from "graphql-request";
import { getSdk, UploadFile } from "graphql/generated"; import { getSdk } from "graphql/generated";
export function getReadySdk() { export function getReadySdk() {
const client = new GraphQLClient(process.env.URL_GRAPHQL ?? "", { const client = new GraphQLClient(process.env.URL_GRAPHQL ?? "", {
headers: { Authorization: `Bearer ${process.env.ACCESS_TOKEN}` }, headers: { Authorization: `Bearer ${process.env.ACCESS_TOKEN}` },
}); });
return getSdk(client); return getSdk(client);
} }

View File

@ -304,12 +304,12 @@ function getGroups(
years.map((year) => { years.map((year) => {
group.set(year.toString(), []); group.set(year.toString(), []);
}); });
group.set(langui.no_year || "No year", []); group.set(langui.no_year ?? "No year", []);
items.map((item) => { items.map((item) => {
if (item.attributes?.release_date?.year) { if (item.attributes?.release_date?.year) {
group.get(item.attributes.release_date.year.toString())?.push(item); group.get(item.attributes.release_date.year.toString())?.push(item);
} else { } else {
group.get(langui.no_year || "No year")?.push(item); group.get(langui.no_year ?? "No year")?.push(item);
} }
}); });

View File

@ -17,13 +17,7 @@ export default function Merch(props: MerchProps): JSX.Element {
</SubPanel> </SubPanel>
); );
return ( return <AppLayout navTitle={langui.merch} subPanel={subPanel} {...props} />;
<AppLayout
navTitle={langui.merch}
subPanel={subPanel}
{...props}
/>
);
} }
export async function getStaticProps( export async function getStaticProps(