Skip to content

Commit

Permalink
refactor: card header file organisation and descriptionRadio story (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jamdelion authored Oct 28, 2024
1 parent fb00920 commit 186a721
Show file tree
Hide file tree
Showing 31 changed files with 209 additions and 179 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import type { PublicProps } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/Checklist/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "@planx/components/Checklist/model";
import ImageButton from "@planx/components/shared/Buttons/ImageButton";
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import { getIn, useFormik } from "formik";
import React, { useState } from "react";
import { ExpandableList, ExpandableListItem } from "ui/public/ExpandableList";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import type { PublicProps } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/Content/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { getContrastTextColor } from "styleUtils";
import { emptyContent } from "ui/editor/RichTextInput";
import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml";

import { HelpButton, Image } from "../shared/Preview/CardHeader";
import { HelpButton, Image } from "../shared/Preview/CardHeader/styled";
import MoreInfo from "../shared/Preview/MoreInfo";
import MoreInfoSection from "../shared/Preview/MoreInfoSection";

Expand Down
9 changes: 6 additions & 3 deletions editor.planx.uk/src/@planx/components/DateInput/Public.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import Box from "@mui/material/Box";
import { visuallyHidden } from "@mui/utils";
import { DateInput, paddedDate } from "@planx/components/DateInput/model";
import { dateRangeSchema } from "@planx/components/DateInput/model";
import {
DateInput,
dateRangeSchema,
paddedDate,
} from "@planx/components/DateInput/model";
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import { PublicProps } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { visuallyHidden } from "@mui/utils";
import { FileUploadSlot } from "@planx/components/FileUpload/model";
import { PASSPORT_REQUESTED_FILES_KEY } from "@planx/components/FileUploadAndLabel/model";
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import {
MapContainer,
MapFooter,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import { useStore } from "pages/FlowEditor/lib/store";
import React, { useEffect, useRef, useState } from "react";
import ErrorWrapper from "ui/shared/ErrorWrapper";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml";
import { FileUploadSlot } from "../FileUpload/model";
import { MoreInformation } from "../shared";
import Card from "../shared/Preview/Card";
import CardHeader, { Image } from "../shared/Preview/CardHeader";
import { CardHeader } from "../shared/Preview/CardHeader/CardHeader";
import { Image } from "../shared/Preview/CardHeader/styled";
import MoreInfo from "../shared/Preview/MoreInfo";
import MoreInfoSection from "../shared/Preview/MoreInfoSection";
import { Dropzone } from "../shared/PrivateFileUpload/Dropzone";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from "@mui/material/Link";
import { styled } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import { squareMetresToHectares } from "@planx/components/shared/utils";
import { PublicProps } from "@planx/components/ui";
import area from "@turf/area";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import FullWidthWrapper from "ui/public/FullWidthWrapper";
import ErrorWrapper from "ui/shared/ErrorWrapper";

import Card from "../../shared/Preview/Card";
import CardHeader from "../../shared/Preview/CardHeader";
import { CardHeader } from "../../shared/Preview/CardHeader/CardHeader";
import type { List } from "../model";
import { formatSchemaDisplayValue } from "../utils";
import { ListProvider, useListContext } from "./Context";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import FullWidthWrapper from "ui/public/FullWidthWrapper";
import ErrorWrapper from "ui/shared/ErrorWrapper";

import Card from "../../shared/Preview/Card";
import CardHeader from "../../shared/Preview/CardHeader";
import { CardHeader } from "../../shared/Preview/CardHeader/CardHeader";
import { MapContainer } from "../../shared/Preview/MapContainer";
import { PublicProps } from "../../ui";
import type { MapAndLabel } from "./../model";
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/NextSteps/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import NextStepsList from "ui/public/NextStepsList";

import Card from "../shared/Preview/Card";
import CardHeader from "../shared/Preview/CardHeader";
import { CardHeader } from "../shared/Preview/CardHeader/CardHeader";
import { NextSteps } from "./model";

export type Props = PublicProps<NextSteps>;
Expand Down
7 changes: 4 additions & 3 deletions editor.planx.uk/src/@planx/components/Notice/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import Button from "@mui/material/Button";
import { styled, useTheme } from "@mui/material/styles";
import Typography from "@mui/material/Typography";
import type { Notice } from "@planx/components/Notice/model";
import Card from "@planx/components/shared/Preview/Card";
import { contentFlowSpacing } from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import Card, {
contentFlowSpacing,
} from "@planx/components/shared/Preview/Card";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import { PublicProps } from "@planx/components/ui";
import { useAnalyticsTracking } from "pages/FlowEditor/lib/analytics/provider";
import React from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import { PublicProps } from "@planx/components/ui";
import { useFormik } from "formik";
import isNil from "lodash/isNil";
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/Page/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from "react";

import { flatten } from "../List/utils";
import Card from "../shared/Preview/Card";
import CardHeader from "../shared/Preview/CardHeader";
import { CardHeader } from "../shared/Preview/CardHeader/CardHeader";
import { useSchema } from "../shared/Schema/hook";
import { SchemaUserData } from "../shared/Schema/model";
import { SchemaFields } from "../shared/Schema/SchemaFields";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ErrorOutline from "@mui/icons-material/ErrorOutline";
import Typography from "@mui/material/Typography";
import type { Constraint, GISResponse } from "@opensystemslab/planx-core/types";
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import capitalize from "lodash/capitalize";
import { HandleSubmit } from "pages/Preview/Node";
import React from "react";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {
GISResponse,
} from "@opensystemslab/planx-core/types";
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import type { PublicProps } from "@planx/components/ui";
import DelayedLoadingIndicator from "components/DelayedLoadingIndicator";
import { GraphError } from "components/Error/GraphError";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Box from "@mui/material/Box";
import Link from "@mui/material/Link";
import { visuallyHidden } from "@mui/utils";
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import { SummaryListTable } from "@planx/components/shared/Preview/SummaryList";
import type { PublicProps } from "@planx/components/ui";
import { GraphError } from "components/Error/GraphError";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import Grid from "@mui/material/Grid";
import RadioGroup from "@mui/material/RadioGroup";
import { visuallyHidden } from "@mui/utils";
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import BasicRadio from "@planx/components/shared/Radio/BasicRadio";
import DescriptionRadio from "@planx/components/shared/Radio/DescriptionRadio";
import DescriptionRadio from "@planx/components/shared/Radio/DescriptionRadio/DescriptionRadio";
import ImageRadio from "@planx/components/shared/Radio/ImageRadio";
import { useFormik } from "formik";
import React from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NodeId } from "@opensystemslab/planx-core/types";
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import SummaryListsBySections from "@planx/components/shared/Preview/SummaryList";
import { PrintButton } from "components/PrintButton";
import { Store } from "pages/FlowEditor/lib/store";
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/Section/Public.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { SectionNode, SectionStatus } from "types";
import ReactMarkdownOrHtml from "ui/shared/ReactMarkdownOrHtml";

import Card from "../shared/Preview/Card";
import CardHeader from "../shared/Preview/CardHeader";
import { CardHeader } from "../shared/Preview/CardHeader/CardHeader";
import type { Section } from "./model";
import { computeSectionStatuses } from "./model";

Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/TaskList/Public.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import type { TaskList } from "@planx/components/TaskList/model";
import { PublicProps } from "@planx/components/ui";
import React from "react";
Expand Down
2 changes: 1 addition & 1 deletion editor.planx.uk/src/@planx/components/TextInput/Public.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Card from "@planx/components/shared/Preview/Card";
import CardHeader from "@planx/components/shared/Preview/CardHeader";
import { CardHeader } from "@planx/components/shared/Preview/CardHeader/CardHeader";
import { PublicProps } from "@planx/components/ui";
import { useFormik } from "formik";
import React from "react";
Expand Down
147 changes: 0 additions & 147 deletions editor.planx.uk/src/@planx/components/shared/Preview/CardHeader.tsx

This file was deleted.

Loading

0 comments on commit 186a721

Please sign in to comment.