web: colocate graphql fragments, unmask where needed, more idiomatic client-preset use

This commit is contained in:
2026-05-19 01:49:58 +02:00
parent bc8642b1fc
commit b09ce9808d
29 changed files with 2065 additions and 7283 deletions
+16 -3
View File
@@ -1,13 +1,26 @@
import { PageSectionBlock as PageSectionBlockType } from "@/gql/graphql";
import { graphql } from "@/gql";
import { type PageSectionBlockFragment } from "@/gql/graphql";
import styles from "./pageSection.module.scss";
import { Blocks } from "./Blocks";
import slugify from "@sindresorhus/slugify";
import { DecorativeIcon } from "../general/Icon";
const PageSectionBlockFragmentDefinition = graphql(`
fragment PageSectionBlock on PageSectionBlock {
title
backgroundColor
icon
body {
id
blockType
}
}
`);
export const PageSectionBlock = ({
block,
}: {
block: PageSectionBlockType;
block: PageSectionBlockFragment;
}) => {
const anchor = slugify(block.title);
@@ -31,7 +44,7 @@ export const PageSectionBlock = ({
export const PageSectionNavigationBlock = ({
sections,
}: {
sections: PageSectionBlockType[];
sections: PageSectionBlockFragment[];
}) => {
if (!sections.length) {
return <></>;