web: colocate graphql fragments, unmask where needed, more idiomatic client-preset use
This commit is contained in:
@@ -1,15 +1,26 @@
|
||||
import { AccordionBlock as AccordionBlockType } from "@/gql/graphql";
|
||||
import { graphql } from "@/gql";
|
||||
import { type AccordionBlockFragment } from "@/gql/graphql";
|
||||
import { Blocks } from "./Blocks";
|
||||
import { Accordion } from "@/components/general/Accordion";
|
||||
|
||||
const AccordionBlockFragmentDefinition = graphql(`
|
||||
fragment AccordionBlock on AccordionBlock {
|
||||
heading
|
||||
body {
|
||||
id
|
||||
blockType
|
||||
}
|
||||
}
|
||||
`);
|
||||
|
||||
export const AccordionBlock = ({
|
||||
block,
|
||||
}: {
|
||||
block: AccordionBlockType;
|
||||
block: AccordionBlockFragment;
|
||||
}) => {
|
||||
return (
|
||||
<Accordion heading={block.heading}>
|
||||
<Blocks blocks={block.body} />
|
||||
</Accordion>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user