-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1,564 additions
and
418 deletions.
There are no files selected for viewing
This file contains 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 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 was deleted.
Oops, something went wrong.
This file contains 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,38 @@ | ||
import React from 'react'; | ||
import { Badge, Button } from 'tdesign-mobile-react'; | ||
import { NotificationIcon } from 'tdesign-icons-react'; | ||
|
||
export default function BaseBadge() { | ||
return ( | ||
<> | ||
<div className="summary">红点徽标</div> | ||
<div className="badge-demo"> | ||
<Badge dot className="badge-item" content="消息" /> | ||
<Badge dot offset={[1, -1]} className="badge-item"> | ||
<NotificationIcon size="24" /> | ||
</Badge> | ||
<Badge dot offset={[1, 1]} className="badge-item"> | ||
<Button>按钮</Button> | ||
</Badge> | ||
</div> | ||
|
||
<div className="summary">数字徽标</div> | ||
<div className="badge-demo"> | ||
<Badge count="8" content="消息" offset={[-8, 0]} className="badge-item" /> | ||
<Badge count="2" offset={[-2, -2]} className="badge-item"> | ||
<NotificationIcon size="24" /> | ||
</Badge> | ||
<Badge count="8" offset={[2, 2]} className="badge-item"> | ||
<Button>按钮</Button> | ||
</Badge> | ||
</div> | ||
|
||
<div className="summary">自定义徽标</div> | ||
<div className="badge-demo"> | ||
<Badge count="NEW" offset={[0, 2]}> | ||
<Button icon={<NotificationIcon />} shape="square" size="large" /> | ||
</Badge> | ||
</div> | ||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
22 changes: 12 additions & 10 deletions
22
src/badge/_example/index.jsx → src/badge/_example/index.tsx
This file contains 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 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,19 @@ | ||
import React from 'react'; | ||
import { Avatar } from 'tdesign-mobile-react'; | ||
import { UserIcon } from 'tdesign-icons-react'; | ||
|
||
export default function SizeBadge() { | ||
return ( | ||
<> | ||
<div className="summary">Large</div> | ||
<div className="block"> | ||
<Avatar icon={<UserIcon />} size="large" badgeProps={{ count: 8, size: 'large', offset: [7, 7] }} /> | ||
</div> | ||
|
||
<div className="summary">Middle</div> | ||
<div className="block"> | ||
<Avatar icon={<UserIcon />} badgeProps={{ count: 8, offset: [5, 5] }} /> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains 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,18 +1,16 @@ | ||
.tdesign-mobile-demo { | ||
.badge-demo { | ||
display: flex; | ||
padding: 16px 0; | ||
width: 100%; | ||
.badge-demo { | ||
display: flex; | ||
margin-top: 28px; | ||
margin-bottom: 24px; | ||
margin-left: 16px; | ||
align-items: center; | ||
color: var(--td-text-color-primary, rgba(0, 0, 0, 0.9)); | ||
|
||
&__container { | ||
width: 24%; | ||
text-align: center; | ||
position: relative; | ||
} | ||
|
||
.badge-item { | ||
width: 24%; | ||
text-align: center; | ||
} | ||
.badge-item { | ||
margin-right: 48px; | ||
} | ||
} | ||
|
||
.block { | ||
padding: 16px 16px 24px; | ||
} |
Oops, something went wrong.