Skip to content

Commit

Permalink
Merge pull request #435 from oceanbase/dengfuping-design
Browse files Browse the repository at this point in the history
chore(design): Update Table with-card demo
  • Loading branch information
dengfuping authored Jan 19, 2024
2 parents 139c667 + b58023b commit 408e065
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/design/src/table/demo/with-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useState } from 'react';
import { Card, Form, Radio, Table } from '@oceanbase/design';

const App: React.FC = () => {
const [hasTitle, setHasTitle] = useState(true);
const [hasPadding, setHasPadding] = useState(true);
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);

Expand Down Expand Up @@ -35,8 +36,19 @@ const App: React.FC = () => {

return (
<div>
<Form style={{ marginBottom: 24 }}>
<Form.Item label="Card" required={true}>
<Form layout="inline" style={{ marginBottom: 24 }}>
<Form.Item label="Card title" required={true}>
<Radio.Group
value={hasTitle}
onChange={e => {
setHasTitle(e.target.value);
}}
>
<Radio.Button value={true}>Has title</Radio.Button>
<Radio.Button value={false}>No title </Radio.Button>
</Radio.Group>
</Form.Item>
<Form.Item label="Card body padding" required={true}>
<Radio.Group
value={hasPadding}
onChange={e => {
Expand All @@ -49,7 +61,7 @@ const App: React.FC = () => {
</Form.Item>
</Form>
<Card
title="Title"
title={hasTitle ? 'Title' : ''}
bodyStyle={
hasPadding
? {}
Expand Down

0 comments on commit 408e065

Please sign in to comment.