Skip to content

Commit

Permalink
Enable PathsOutcomeBlock on root page
Browse files Browse the repository at this point in the history
  • Loading branch information
terotik committed Oct 16, 2024
1 parent 0a2f995 commit d0b5b56
Showing 1 changed file with 36 additions and 19 deletions.
55 changes: 36 additions & 19 deletions components/common/StreamField.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -396,6 +398,21 @@ function StreamFieldBlock(props: StreamFieldBlockProps) {
<AccessibilityStatementPreparationInformationBlock {...block} id={id} />
);
}
case 'AccessibilityStatementPreparationInformationBlock': {
return (
<AccessibilityStatementPreparationInformationBlock {...block} id={id} />
);
}
case 'PathsOutcomeBlock': {
const { heading, helpText, outcomeNodeId } = block;
return (
<PathsOutcomeBlock
heading={heading}
helpText={helpText}
outcomenodeId={outcomeNodeId}
/>
);
}
default:
return <div id={id}>{`Component for ${__typename} does not exist`}</div>;
}
Expand Down

0 comments on commit d0b5b56

Please sign in to comment.