-
Notifications
You must be signed in to change notification settings - Fork 39
feat(blockheader): supprt large size and change some props name #478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
1c846c4
feat(blockheader): supprt large size and change some props name
LuckyFBB 1324ce1
feat(blockheader): supprt padding for blockheader children
LuckyFBB c6e4d7b
feat(blockheader): change tooltip to TooltipProps and use toTooltipProps
LuckyFBB 953f6b7
feat(blockheader): change classname to use BEM
LuckyFBB 934eee6
feat(blockheader): change classname and add style
LuckyFBB b275b5e
feat(blockheader): change doc and ts
LuckyFBB 7ed1a52
feat(blockheader): use utils toTooltipProps and use BEM style
LuckyFBB File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import { Input, Space } from 'antd'; | ||
import { BlockHeader } from 'dt-react-component'; | ||
|
||
export default () => ( | ||
<Space size={12} direction="vertical" style={{ width: '100%' }}> | ||
<BlockHeader title="分类标题" addonAfter="这是 addonAfter 内容" /> | ||
<BlockHeader | ||
background={false} | ||
title="分类标题" | ||
addonAfter={<Input placeholder="请输入" />} | ||
tooltip={{ title: '这里展示问号提示' }} | ||
/> | ||
</Space> | ||
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,52 @@ | ||
import React, { useState } from 'react'; | ||
import { Switch } from 'antd'; | ||
import { Radio, Space, Switch } from 'antd'; | ||
import { BlockHeader } from 'dt-react-component'; | ||
import { SizeType } from 'dt-react-component/blockHeader'; | ||
|
||
export default () => { | ||
const [size, setSize] = useState<SizeType>('middle'); | ||
const [showBackground, setShowBackground] = useState(true); | ||
const [tooltip, setTooltip] = useState(true); | ||
const [description, setDescription] = useState(true); | ||
LuckyFBB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
return ( | ||
<> | ||
背景: | ||
<Switch defaultChecked onChange={setShowBackground} /> | ||
<div> | ||
<Space direction="vertical" size={12}> | ||
<Radio.Group value={size} onChange={(e) => setSize(e.target.value)}> | ||
<Radio.Button value="small">Small</Radio.Button> | ||
<Radio.Button value="middle">Middle</Radio.Button> | ||
<Radio.Button value="large">Large</Radio.Button> | ||
</Radio.Group> | ||
<Space direction="horizontal" size={12}> | ||
<Switch | ||
defaultChecked | ||
onChange={setShowBackground} | ||
LuckyFBB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
checkedChildren="带背景" | ||
unCheckedChildren="不带背景" | ||
/> | ||
<Switch | ||
defaultChecked | ||
onChange={setTooltip} | ||
checkedChildren="展示 tooltip" | ||
unCheckedChildren="不展示 tooltip" | ||
/> | ||
<Switch | ||
defaultChecked | ||
onChange={setDescription} | ||
checkedChildren="展示说明文字" | ||
unCheckedChildren="不展示说明文字" | ||
/> | ||
</Space> | ||
</Space> | ||
<br /> | ||
<br /> | ||
<BlockHeader title="分类标题" showBackground={showBackground} /> | ||
</> | ||
<BlockHeader | ||
size={size} | ||
title="分类标题" | ||
background={showBackground} | ||
tooltip={tooltip && '这里展示问号提示'} | ||
description={description && '提示说明文字'} | ||
LuckyFBB marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/> | ||
</div> | ||
); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.