From 6aa8c5c0ba2ef775520d1b17d1e39f0ffafd0077 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 2 Jul 2021 09:41:37 +0100 Subject: [PATCH] All class name to be set on category / overline. --- src/components/ui/Category.tsx | 12 +++++++----- src/components/ui/Overline.tsx | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/components/ui/Category.tsx b/src/components/ui/Category.tsx index 16c14444..ccdd4e91 100644 --- a/src/components/ui/Category.tsx +++ b/src/components/ui/Category.tsx @@ -31,18 +31,20 @@ const CategoryBase = styled.div>` ` } `; -interface Props { +type Props = Omit, 'children' | 'as'> & { text: Children; action?: () => void; variant?: 'default' | 'uniform'; } export default function Category(props: Props) { + let { text, action, ...otherProps } = props; + return ( - - {props.text} - {props.action && ( - + + {text} + {action && ( + )} ); diff --git a/src/components/ui/Overline.tsx b/src/components/ui/Overline.tsx index 86233697..5a9f9d04 100644 --- a/src/components/ui/Overline.tsx +++ b/src/components/ui/Overline.tsx @@ -2,7 +2,7 @@ import styled, { css } from "styled-components"; import { Children } from "../../types/Preact"; import { Text } from 'preact-i18n'; -interface Props { +type Props = Omit, 'children' | 'as'> & { error?: string; block?: boolean; children?: Children;