-
Notifications
You must be signed in to change notification settings - Fork 39
feat(statustag): support bg statusTag #450
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 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
be5c064
feat(statustag): support bg statusTag and change some props
LuckyFBB dfc4a9d
update PresetColorType
LuckyFBB e3f3f2f
fix(statustag): update fontSize and border style, md API, remove colo…
LuckyFBB f58d62e
feat(statustag): change presetColor type and support bg in custom fil…
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 |
---|---|---|
@@ -1,15 +1,43 @@ | ||
import React from 'react'; | ||
import { Space } from 'antd'; | ||
import React, { useState } from 'react'; | ||
import { Divider, Radio, Space } from 'antd'; | ||
import { StatusTag } from 'dt-react-component'; | ||
import { StatusTagType } from 'dt-react-component/statusTag'; | ||
|
||
export default () => { | ||
const presets = ['warning', 'error', 'success', 'run', 'stopped', 'frozen']; | ||
|
||
const [type, setType] = useState<StatusTagType>('default'); | ||
|
||
return ( | ||
<Space direction="vertical"> | ||
<StatusTag type="run">运行中</StatusTag> | ||
<StatusTag type="success">成功</StatusTag> | ||
<StatusTag type="stopped">取消</StatusTag> | ||
<StatusTag type="error">运行失败</StatusTag> | ||
<StatusTag type="warning">提交中</StatusTag> | ||
</Space> | ||
<> | ||
<Radio.Group value={type} onChange={(e) => setType(e.target.value)}> | ||
<Radio.Button value="default">无外边框</Radio.Button> | ||
<Radio.Button value="outline">有外边框</Radio.Button> | ||
<Radio.Button value="fill">有背景色</Radio.Button> | ||
</Radio.Group> | ||
<Divider orientation="left">Presets</Divider> | ||
<Space direction="vertical"> | ||
{presets.map((preset) => ( | ||
<StatusTag key={preset} type={type} color={preset}> | ||
{preset} | ||
</StatusTag> | ||
))} | ||
</Space> | ||
<Divider orientation="left">Custom</Divider> | ||
<Space direction="vertical"> | ||
<StatusTag type={type} color="#f50"> | ||
#f50 | ||
</StatusTag> | ||
<StatusTag type={type} color="rgb(45, 183, 245)"> | ||
rgb(45, 183, 245) | ||
</StatusTag> | ||
<StatusTag type={type} color="#a31980"> | ||
#a31980 | ||
</StatusTag> | ||
<StatusTag type={type} color="#0fd5e8"> | ||
#0fd5e8 | ||
</StatusTag> | ||
</Space> | ||
</> | ||
); | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
import { SketchOutlined } from '@ant-design/icons'; | ||
import { Space } from 'antd'; | ||
import { StatusTag } from 'dt-react-component'; | ||
|
||
export default () => { | ||
return ( | ||
<Space direction="vertical"> | ||
<StatusTag color="success" type="outline" icon={<SketchOutlined />}> | ||
成功 | ||
</StatusTag> | ||
<StatusTag color="run" icon={<SketchOutlined />}> | ||
运行中 | ||
</StatusTag> | ||
<StatusTag color="warning" type="fill" icon={<SketchOutlined />}> | ||
运行中 | ||
</StatusTag> | ||
<StatusTag color="#2f10fb" type="fill" icon={<SketchOutlined />}> | ||
运行中 | ||
</StatusTag> | ||
</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,13 +1,14 @@ | ||
import React from 'react'; | ||
import { Space } from 'antd'; | ||
import { StatusTag } from 'dt-react-component'; | ||
|
||
export default () => { | ||
return ( | ||
<> | ||
<StatusTag type="run" showBorder={false} /> | ||
<StatusTag type="success" showBorder={false} /> | ||
<StatusTag type="stopped" showBorder={false} /> | ||
<StatusTag type="warning" showBorder={false} /> | ||
</> | ||
<Space direction="vertical"> | ||
<StatusTag color="run" /> | ||
<StatusTag color="success" /> | ||
<StatusTag color="stopped" /> | ||
<StatusTag color="warning" /> | ||
</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
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.