refactor: ♻️ del children type (#3283)

* refactor: 🔧 del unnecessary children type

Change-Id: I3dea5e07f5401bdbdd168eb959fe361c57784167

* feat: 💄 eslint

Change-Id: Ie173adeca9e3112d8cdfc1f85964332105dcb424

* feat: 🔧 add css type

Change-Id: I8850c4d09b152f4d9c4d98e6eebca58bd9eecd37

* fix: 💄 ci lint

Change-Id: I69ff89c7a30e2bdcd26475ec83f3f5ec143121b6
This commit is contained in:
忽如寄
2022-03-25 08:45:36 +08:00
committed by GitHub
parent 6af9246f26
commit 396836dedd
17 changed files with 80 additions and 86 deletions

View File

@@ -9,7 +9,6 @@ type Props = {
label: React.ReactNode;
description: React.ReactNode;
name: string;
children: React.ReactNode;
visible?: boolean;
border?: boolean;
};
@@ -53,20 +52,28 @@ const Label = styled(Text)`
margin-bottom: 4px;
`;
export default function SettingRow(props: Props) {
if (props.visible === false) {
const SettingRow: React.FC<Props> = ({
visible,
description,
name,
label,
border,
children,
}) => {
if (visible === false) {
return null;
}
return (
<Row gap={32} $border={props.border}>
<Row gap={32} $border={border}>
<Column>
<Label as="h3">
<label htmlFor={props.name}>{props.label}</label>
<label htmlFor={name}>{label}</label>
</Label>
<Text type="secondary">{props.description}</Text>
<Text type="secondary">{description}</Text>
</Column>
<Column>{props.children}</Column>
<Column>{children}</Column>
</Row>
);
}
};
export default SettingRow;