From d0b5b56826deaf4c37129c50868c6462cf1684ee Mon Sep 17 00:00:00 2001 From: Tero Tikkanen Date: Wed, 16 Oct 2024 11:55:51 +0300 Subject: [PATCH] Enable PathsOutcomeBlock on root page --- components/common/StreamField.tsx | 55 ++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/components/common/StreamField.tsx b/components/common/StreamField.tsx index 74ef7852..aa557dd3 100644 --- a/components/common/StreamField.tsx +++ b/components/common/StreamField.tsx @@ -1,33 +1,35 @@ import React from 'react'; -import { Container, Row, Col, ColProps } from 'reactstrap'; -import { gql } from '@apollo/client'; -import { ColumnProps } from 'reactstrap/types/lib/Col'; -import { usePlan } from 'context/plan'; -import images, { getBgImageAlignment } from 'common/images'; + +import type { StreamFieldFragmentFragment } from 'common/__generated__/graphql'; +import { getBgImageAlignment } from 'common/images'; import RichText from 'components/common/RichText'; -import QuestionAnswerBlock from 'components/contentblocks/QuestionAnswerBlock'; +import AccessibilityStatementComplianceStatusBlock from 'components/contentblocks/AccessibilityStatementComplianceStatusBlock'; +import AccessibilityStatementContactFormBlock from 'components/contentblocks/AccessibilityStatementContactFormBlock'; +import AccessibilityStatementContactInformationBlock from 'components/contentblocks/AccessibilityStatementContactInformationBlock'; +import AccessibilityStatementPreparationInformationBlock from 'components/contentblocks/AccessibilityStatementPreparationInformationBlock'; +import ActionCategoryFilterCardsBlock from 'components/contentblocks/ActionCategoryFilterCardsBlock'; +import ActionHighlightsBlock from 'components/contentblocks/ActionHighlightsBlock'; import ActionListBlock from 'components/contentblocks/ActionListBlock'; +import ActionStatusGraphsBlock from 'components/contentblocks/ActionStatusGraphsBlock'; +import CardListBlock from 'components/contentblocks/CardListBlock'; +import CartographyVisualisationBlock from 'components/contentblocks/CartographyVisualisationBlock'; import CategoryListBlock from 'components/contentblocks/CategoryListBlock'; import CategoryTreeBlock from 'components/contentblocks/CategoryTreeBlock'; -import IndicatorGroupBlock from 'components/contentblocks/IndicatorGroupBlock'; import FrontPageHeroBlock from 'components/contentblocks/FrontPageHeroBlock'; -import IndicatorShowcaseBlock from 'components/contentblocks/IndicatorShowcaseBlock'; -import CardListBlock from 'components/contentblocks/CardListBlock'; -import ActionHighlightsBlock from 'components/contentblocks/ActionHighlightsBlock'; -import ActionStatusGraphsBlock from 'components/contentblocks/ActionStatusGraphsBlock'; +import IndicatorGroupBlock from 'components/contentblocks/IndicatorGroupBlock'; import IndicatorHighlightsBlock from 'components/contentblocks/IndicatorHighlightsBlock'; +import IndicatorShowcaseBlock from 'components/contentblocks/IndicatorShowcaseBlock'; +import QuestionAnswerBlock from 'components/contentblocks/QuestionAnswerBlock'; import RelatedIndicatorsBlock from 'components/contentblocks/RelatedIndicatorsBlock'; import RelatedPlanListBlock from 'components/contentblocks/RelatedPlanListBlock'; -import ActionCategoryFilterCardsBlock from 'components/contentblocks/ActionCategoryFilterCardsBlock'; -import AccessibilityStatementComplianceStatusBlock from 'components/contentblocks/AccessibilityStatementComplianceStatusBlock'; -import AccessibilityStatementPreparationInformationBlock from 'components/contentblocks/AccessibilityStatementPreparationInformationBlock'; -import AccessibilityStatementContactFormBlock from 'components/contentblocks/AccessibilityStatementContactFormBlock'; -import AccessibilityStatementContactInformationBlock from 'components/contentblocks/AccessibilityStatementContactInformationBlock'; - -import type { StreamFieldFragmentFragment } from 'common/__generated__/graphql'; -import CartographyVisualisationBlock from 'components/contentblocks/CartographyVisualisationBlock'; +import { usePlan } from 'context/plan'; +import { Col, ColProps, Container, Row } from 'reactstrap'; +import { ColumnProps } from 'reactstrap/types/lib/Col'; import styled, { useTheme } from 'styled-components'; + +import PathsOutcomeBlock from '@/components/paths/contentblocks/PathsOutcomeBlock'; import { STREAM_FIELD_FRAGMENT } from '@/fragments/stream-field.fragment'; + import { ErrorBoundary } from './ErrorBoundary'; import { ErrorPage } from './ErrorPage'; @@ -396,6 +398,21 @@ function StreamFieldBlock(props: StreamFieldBlockProps) { ); } + case 'AccessibilityStatementPreparationInformationBlock': { + return ( + + ); + } + case 'PathsOutcomeBlock': { + const { heading, helpText, outcomeNodeId } = block; + return ( + + ); + } default: return
{`Component for ${__typename} does not exist`}
; }