Skip to content

Commit b619845

Browse files
committed
feat: Remove InfosBadge
BREAKING CHANGE: InfosBadge has been removed. Use Badge instead (see commit or doc)
1 parent 05deb5b commit b619845

File tree

4 files changed

+32
-41
lines changed

4 files changed

+32
-41
lines changed

docs/styleguide.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ module.exports = {
3232
'../react/Icon',
3333
'../react/IconButton',
3434
'../react/Labs/IconGrid',
35-
'../react/InfosBadge',
3635
'../react/List',
3736
'../react/ListItem',
3837
'../react/ListItemText',

react/Badge/Readme.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,29 @@ Badges can be combined — in this example, we have an item with a new qualifica
6363

6464
```jsx
6565
import Badge from 'cozy-ui/transpiled/react/Badge'
66-
import InfosBadge from 'cozy-ui/transpiled/react/InfosBadge'
6766
import Icon from 'cozy-ui/transpiled/react/Icon'
6867
import Avatar from 'cozy-ui/transpiled/react/Avatar'
6968
import LinkIcon from "cozy-ui/transpiled/react/Icons/Link"
7069

7170
;
7271

73-
<InfosBadge
72+
<Badge
73+
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
7474
badgeContent={
75-
<Badge color="error" variant="dot" size="small">
76-
<Icon icon={LinkIcon} size={16} />
77-
</Badge>
75+
<div
76+
className="u-h-1-half u-miw-1-half u-bdrs-circle u-flex u-flex-items-center u-flex-justify-center"
77+
style={{
78+
backgroundColor: 'var(--paperBackgroundColor)',
79+
color: 'var(--iconTextColor)',
80+
boxShadow: 'var(--shadow3)'
81+
}}
82+
>
83+
<Badge color="error" variant="dot" size="small">
84+
<Icon icon={LinkIcon} size={16} />
85+
</Badge>
86+
</div>
7887
}
7988
>
8089
<Avatar>CD</Avatar>
81-
</InfosBadge>
90+
</Badge>
8291
```

react/InfosBadge/Readme.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
The InfosBadge is used to provide extra information about the item it is annotating.
22

33
```jsx
4-
import InfosBadge from 'cozy-ui/transpiled/react/InfosBadge'
4+
import Badge from 'cozy-ui/transpiled/react/Badge'
55
import Icon from 'cozy-ui/transpiled/react/Icon'
66
import LinkIcon from "cozy-ui/transpiled/react/Icons/Link"
77
import CircleFilledIcon from "cozy-ui/transpiled/react/Icons/CircleFilled"
88

99
;
1010

11-
<InfosBadge badgeContent={<Icon icon={LinkIcon} size="10" />}>
11+
<Badge
12+
badgeContent={
13+
<div
14+
className="u-h-1-half u-miw-1-half u-bdrs-circle u-flex u-flex-items-center u-flex-justify-center"
15+
style={{
16+
backgroundColor: 'var(--paperBackgroundColor)',
17+
color: 'var(--iconTextColor)',
18+
boxShadow: 'var(--shadow3)'
19+
}}
20+
>
21+
<Icon icon={LinkIcon} size="10" />
22+
</div>
23+
}
24+
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
25+
>
1226
<Icon icon={CircleFilledIcon} size="32" color="var(--slateGrey)" />
13-
</InfosBadge>
27+
</Badge>
1428
```

react/InfosBadge/index.jsx

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)