From 6221fa82e41915702d8139cade5c25e9d61e619f Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 2 Oct 2023 17:39:16 +0200 Subject: refactor(components): remove Column and NoScript from atoms * Column is a simple div meant to be used inside Columns component so they should live together. * NoScript is only used in Layout component and its name does not make sense since it needs to be used inside a `noscript` element. --- src/components/molecules/layout/columns.tsx | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/components/molecules/layout/columns.tsx') diff --git a/src/components/molecules/layout/columns.tsx b/src/components/molecules/layout/columns.tsx index b5bd9b5..56cd1a1 100644 --- a/src/components/molecules/layout/columns.tsx +++ b/src/components/molecules/layout/columns.tsx @@ -1,7 +1,27 @@ -import { FC, ReactComponentElement } from 'react'; -import { Column } from '../../atoms'; +import type { + FC, + HTMLAttributes, + ReactComponentElement, + ReactNode, +} from 'react'; import styles from './columns.module.scss'; +export type ColumnProps = HTMLAttributes & { + children: ReactNode; +}; + +/** + * Column component. + * + * Render the body as a column. + */ +export const Column: FC = ({ children, ...props }) => ( +
{children}
+); + +// eslint-disable-next-line @typescript-eslint/no-magic-numbers +type ColumnsNumber = 2 | 3 | 4; + export type ColumnsProps = { /** * The columns. @@ -14,7 +34,7 @@ export type ColumnsProps = { /** * The number of columns. */ - count: 2 | 3 | 4; + count: ColumnsNumber; /** * Should the columns be stacked on small devices? Default: true. */ -- cgit v1.2.3