diff --git a/src/components/sectionedForm/SectionedFormLayout.module.css b/src/components/sectionedForm/SectionedFormLayout.module.css index 9ad6a047..ca7abf60 100644 --- a/src/components/sectionedForm/SectionedFormLayout.module.css +++ b/src/components/sectionedForm/SectionedFormLayout.module.css @@ -1,6 +1,5 @@ @value m-medium: (min-width: 768px); -/* The purpose of this wrappper is for the */ .layoutWrapper { display: flex; flex-direction: column; @@ -31,7 +30,6 @@ background-color: #fff; min-width: var(--sidebar-width); height: 100%; - border-radius: 0; border-inline-end: 1px solid var(--colors-grey300); } @@ -39,7 +37,7 @@ grid-area: footer; width: 100%; background: var(--colors-white); - border-top: 1px solid var(--colors-grey300); + border-block-start: 1px solid var(--colors-grey300); display: flex; } diff --git a/src/lib/form/sectionedForm/SectionedFormContext.tsx b/src/lib/form/sectionedForm/SectionedFormContext.tsx index e7876438..5f6b0920 100644 --- a/src/lib/form/sectionedForm/SectionedFormContext.tsx +++ b/src/lib/form/sectionedForm/SectionedFormContext.tsx @@ -1,5 +1,5 @@ import React, { createContext, useState } from 'react' -import { SectionDescriptor, SectionedFormDescriptor } from './formDescriptor' +import { SectionDescriptor, SectionedFormDescriptor } from './types' /* Some of the types in this file may look complex. However they are here to help type-safety and autocommpletion for consumers. @@ -50,6 +50,7 @@ function createContextValue( }, } } + type SectionFormContextValue = ReturnType< typeof createContextValue > @@ -62,12 +63,12 @@ export const SectionedFormDescriptorProvider = < T extends SectionedFormDescriptor >({ children, - initialValue, + formDescriptor, }: { - initialValue: T + formDescriptor: T children: React.ReactNode }) => { - const [contextValue] = useState(() => createContextValue(initialValue)) + const [contextValue] = useState(() => createContextValue(formDescriptor)) return ( diff --git a/src/lib/form/sectionedForm/types.ts b/src/lib/form/sectionedForm/types.ts index d57a6264..defeb215 100644 --- a/src/lib/form/sectionedForm/types.ts +++ b/src/lib/form/sectionedForm/types.ts @@ -5,11 +5,9 @@ export type FieldDescriptor = { name: keyof T | (string & {}) } -export type SectionDescriptor = { +export type SectionDescriptor = { label: string name: string - // keyof T | (string & {}) allows auto-completion for fields, while also allowing - // any other string to be used as a key fields: FieldDescriptor[] } diff --git a/src/pages/dataSets/New.tsx b/src/pages/dataSets/New.tsx index 043c9bce..70084fa5 100644 --- a/src/pages/dataSets/New.tsx +++ b/src/pages/dataSets/New.tsx @@ -15,9 +15,10 @@ import { initialValues, validate } from './form/dataSetFormSchema' import { DataSetFormDescriptor } from './form/formDescriptor' const section = SECTIONS_MAP.dataSet + export const Component = () => { return ( - +