web: colocate graphql fragments, unmask where needed, more idiomatic client-preset use
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
import { FactBoxBlock as FactBoxBlockType } from "@/gql/graphql";
|
||||
import { graphql } from "@/gql";
|
||||
import { type FactBoxBlockFragment } from "@/gql/graphql";
|
||||
import styles from "./factBoxBlock.module.scss";
|
||||
|
||||
type FactBoxBlockTypeWithAlias = FactBoxBlockType & {
|
||||
factBoxBody?: string;
|
||||
};
|
||||
const FactBoxBlockFragmentDefinition = graphql(`
|
||||
fragment FactBoxBlock on FactBoxBlock {
|
||||
backgroundColor
|
||||
factBoxBody: body
|
||||
}
|
||||
`);
|
||||
|
||||
export const FactBoxBlock = ({
|
||||
block,
|
||||
}: {
|
||||
block: FactBoxBlockTypeWithAlias;
|
||||
block: FactBoxBlockFragment;
|
||||
}) => {
|
||||
if (!block.factBoxBody) {
|
||||
return <></>;
|
||||
|
||||
Reference in New Issue
Block a user