Skip to content

Commit

Permalink
Merge branch 'v3' into about-us-section
Browse files Browse the repository at this point in the history
  • Loading branch information
BaggioGiacomo committed Aug 3, 2021
1 parent c4cfd5f commit a72ecc5
Show file tree
Hide file tree
Showing 9 changed files with 289 additions and 15 deletions.
8 changes: 5 additions & 3 deletions backend/components/section/about-us-section.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@
"collectionName": "components_section_about_us_sections",
"info": {
"name": "aboutUsSection",
"icon": "ambulance",
"description": ""
"icon": "angle-double-right"
},
"options": {},
"attributes": {
"sectionTitle": {
"type": "string"
},
"sectionTitleColor": {
"type": "string"
},
"title": {
"type": "string"
},
"subtitle": {
"type": "richtext"
"type": "string"
}
}
}
8 changes: 7 additions & 1 deletion frontend/features/page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ import {
cardSectionBlock,
CardSectionBlockData,
} from "./sections/CardListSection/CardListSectionBlock";
import {
AboutUsSectionBlockData,
aboutUsSectionBlock,
} from "./sections/AboutUsSection/blocks/AboutUsSectionBlock";

export const SECTION_PAGE_BLOCKS = {
heroSection: heroSectionBlock,
featureListSection: featureSectionBlock,
cardListSection: cardSectionBlock,
aboutUsSection: aboutUsSectionBlock,
};

export type SectionBlockData =
| HeroSectionBlockData
| FeatureListSectionBlockData
| CardSectionBlockData;
| CardSectionBlockData
| AboutUsSectionBlockData;
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,28 @@ import {
BlocksControls,
InlineTextarea,
} from "react-tinacms-inline";
import { BlockTemplateData } from "./types";

export type AboutUsSectionBlockData = BlockTemplateData<
"aboutUsSection",
{
id: string;
sectionTitle: Nullable<string>;
sectionTitleColor: Nullable<string>;
title: Nullable<string>;
subtitle: Nullable<string>;
}
>;

interface AboutUsSectionBlockProps {
sectionTitle: string;
sectionTitleColor: string;
}

const StyledInlineTextarea = chakra(InlineTextarea);

export function AboutUsSectionBlock({
sectionTitle,
sectionTitleColor,
}: AboutUsSectionBlockProps) {
return (
<Box as="section" py="52" w="full" pos="relative">
Expand All @@ -45,7 +47,7 @@ export function AboutUsSectionBlock({
pos="relative"
letterSpacing="0.02em">
<Box
color="rgb(129, 82, 188)"
color={sectionTitleColor || "black"}
fontSize="sm"
textTransform="uppercase"
letterSpacing="0.1em"
Expand All @@ -65,7 +67,7 @@ export function AboutUsSectionBlock({
pos: "absolute",
top: "7px",
left: "-68px",
backgroundColor: "rgb(129, 82, 188)",
backgroundColor: sectionTitleColor || "black",
}
: undefined
}>
Expand Down Expand Up @@ -126,6 +128,12 @@ export const aboutUsSectionBlock: Block = {
subtitle: "Default subtitle",
sectionTitle: "Default section title",
},
fields: [],
fields: [
{
name: "sectionTitleColor",
component: "color",
label: "Section title color",
},
],
},
};
15 changes: 10 additions & 5 deletions frontend/features/pageBlocks/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
export * from "./types";
import { heroSectionBlock, HeroSectionBlockData } from "./HeroSectionBlock";
import {
cardSectionBlock,
CardSectionBlockData,
} from "@features/page/sections/CardListSection/CardListSectionBlock";
import {
featureSectionBlock,
FeatureListSectionBlockData,
} from "./FeatureListSectionBlock";
import { cardSectionBlock, CardSectionBlockData } from "./CardListSectionBlock";
} from "@features/page/sections/FeatureListSection/FeatureListSectionBlock";
import {
heroSectionBlock,
HeroSectionBlockData,
} from "@features/page/sections/HeroSection/HeroSectionBlock";
import {
aboutUsSectionBlock,
AboutUsSectionBlockData,
} from "./AboutUsSectionBlock";
} from "../page/sections/AboutUsSection/blocks/AboutUsSectionBlock";

export const PAGE_SECTION_BLOCKS = {
heroSection: heroSectionBlock,
Expand Down
215 changes: 215 additions & 0 deletions frontend/graphql.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,140 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "ComponentSectionAboutUsSection",
"description": null,
"fields": [
{
"name": "id",
"description": null,
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "sectionTitle",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "sectionTitleColor",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "title",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "subtitle",
"description": null,
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "ComponentSectionAboutUsSectionInput",
"description": null,
"fields": null,
"inputFields": [
{
"name": "sectionTitle",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "sectionTitleColor",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "title",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "subtitle",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "ComponentSectionCardSection",
Expand Down Expand Up @@ -3134,6 +3268,11 @@
"name": "ComponentMenuPageLink",
"ofType": null
},
{
"kind": "OBJECT",
"name": "ComponentSectionAboutUsSection",
"ofType": null
},
{
"kind": "OBJECT",
"name": "ComponentSectionCardSection",
Expand Down Expand Up @@ -4837,6 +4976,11 @@
"kind": "OBJECT",
"name": "ComponentSectionSingleFeatureSection",
"ofType": null
},
{
"kind": "OBJECT",
"name": "ComponentSectionAboutUsSection",
"ofType": null
}
]
},
Expand Down Expand Up @@ -10046,6 +10190,77 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "editComponentSectionAboutUsSectionInput",
"description": null,
"fields": null,
"inputFields": [
{
"name": "id",
"description": null,
"type": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "sectionTitle",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "sectionTitleColor",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "title",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "subtitle",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "editComponentSectionCardSectionInput",
Expand Down
1 change: 1 addition & 0 deletions frontend/graphql/GetPages.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ query GetPages($where: JSON, $locale: String) {
__typename
id
sectionTitle
sectionTitleColor
title
subtitle
}
Expand Down
Loading

0 comments on commit a72ecc5

Please sign in to comment.