mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-22 07:00:58 -05:00
All class name to be set on category / overline.
This commit is contained in:
parent
4d9d74224f
commit
6aa8c5c0ba
2 changed files with 8 additions and 6 deletions
|
@ -31,18 +31,20 @@ const CategoryBase = styled.div<Pick<Props, 'variant'>>`
|
||||||
` }
|
` }
|
||||||
`;
|
`;
|
||||||
|
|
||||||
interface Props {
|
type Props = Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children' | 'as'> & {
|
||||||
text: Children;
|
text: Children;
|
||||||
action?: () => void;
|
action?: () => void;
|
||||||
variant?: 'default' | 'uniform';
|
variant?: 'default' | 'uniform';
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Category(props: Props) {
|
export default function Category(props: Props) {
|
||||||
|
let { text, action, ...otherProps } = props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<CategoryBase>
|
<CategoryBase {...otherProps}>
|
||||||
{props.text}
|
{text}
|
||||||
{props.action && (
|
{action && (
|
||||||
<Plus size={16} onClick={props.action} />
|
<Plus size={16} onClick={action} />
|
||||||
)}
|
)}
|
||||||
</CategoryBase>
|
</CategoryBase>
|
||||||
);
|
);
|
||||||
|
|
|
@ -2,7 +2,7 @@ import styled, { css } from "styled-components";
|
||||||
import { Children } from "../../types/Preact";
|
import { Children } from "../../types/Preact";
|
||||||
import { Text } from 'preact-i18n';
|
import { Text } from 'preact-i18n';
|
||||||
|
|
||||||
interface Props {
|
type Props = Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children' | 'as'> & {
|
||||||
error?: string;
|
error?: string;
|
||||||
block?: boolean;
|
block?: boolean;
|
||||||
children?: Children;
|
children?: Children;
|
||||||
|
|
Loading…
Reference in a new issue