Skip to content

Commit dfc9943

Browse files
authored
feat(Badge): rename Tag component to Badge (#230)
1 parent 90e00ef commit dfc9943

14 files changed

Lines changed: 109 additions & 109 deletions

File tree

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,47 @@ import React from 'react';
33
import { PrismCode } from 'react-prism';
44
import Helmet from 'react-helmet';
55

6-
import TagExample from '../examples/Tag';
7-
const TagExampleSource = require('!!raw!../examples/Tag');
6+
import BadgeExample from '../examples/Badge';
7+
const BadgeExampleSource = require('!!raw!../examples/Badge');
88

9-
import TagPillsExample from '../examples/TagPills';
10-
const TagPillsExampleSource = require('!!raw!../examples/TagPills');
9+
import BadgePillsExample from '../examples/BadgePills';
10+
const BadgePillsExampleSource = require('!!raw!../examples/BadgePills');
1111

12-
import TagVariationsExample from '../examples/TagVariations';
13-
const TagVariationsExampleSource = require('!!raw!../examples/TagVariations');
12+
import BadgeVariationsExample from '../examples/BadgeVariations';
13+
const BadgeVariationsExampleSource = require('!!raw!../examples/BadgeVariations');
1414

15-
export default class TagsPage extends React.Component {
15+
export default class BadgesPage extends React.Component {
1616
render() {
1717
return (
1818
<div>
19-
<Helmet title="Tags" />
20-
<h3>Tags</h3>
19+
<Helmet title="Badges" />
20+
<h3>Badges</h3>
2121
<hr />
2222
<p>Scale to parent</p>
2323
<div className="docs-example">
24-
<TagExample />
24+
<BadgeExample />
2525
</div>
2626
<pre>
2727
<PrismCode className="language-jsx">
28-
{TagExampleSource}
28+
{BadgeExampleSource}
2929
</PrismCode>
3030
</pre>
3131
<h3>Variations</h3>
3232
<div className="docs-example">
33-
<TagVariationsExample />
33+
<BadgeVariationsExample />
3434
</div>
3535
<pre>
3636
<PrismCode className="language-jsx">
37-
{TagVariationsExampleSource}
37+
{BadgeVariationsExampleSource}
3838
</PrismCode>
3939
</pre>
4040
<h3>Pills</h3>
4141
<div className="docs-example">
42-
<TagPillsExample />
42+
<BadgePillsExample />
4343
</div>
4444
<pre>
4545
<PrismCode className="language-jsx">
46-
{TagPillsExampleSource}
46+
{BadgePillsExampleSource}
4747
</PrismCode>
4848
</pre>
4949
</div>

docs/lib/Components/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class Components extends React.Component {
5050
to: '/components/breadcrumbs/'
5151
},
5252
{
53-
name: 'Tags',
54-
to: '/components/tags/'
53+
name: 'Badge',
54+
to: '/components/badge/'
5555
},
5656
{
5757
name: 'Card',

docs/lib/examples/Badge.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
import { Badge } from 'reactstrap';
3+
4+
export default class Example extends React.Component {
5+
render() {
6+
return (
7+
<div>
8+
<h1>Heading <Badge>New</Badge></h1>
9+
<h2>Heading <Badge>New</Badge></h2>
10+
<h3>Heading <Badge>New</Badge></h3>
11+
<h4>Heading <Badge>New</Badge></h4>
12+
<h5>Heading <Badge>New</Badge></h5>
13+
<h6>Heading <Badge>New</Badge></h6>
14+
</div>
15+
);
16+
}
17+
}

docs/lib/examples/BadgePills.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
import { Badge } from 'reactstrap';
3+
4+
export default class Example extends React.Component {
5+
render() {
6+
return (
7+
<div>
8+
<Badge color="default" pill>default</Badge>{' '}
9+
<Badge color="primary" pill>primary</Badge>{' '}
10+
<Badge color="success" pill>success</Badge>{' '}
11+
<Badge color="info" pill>info</Badge>{' '}
12+
<Badge color="warning" pill>warning</Badge>{' '}
13+
<Badge color="danger" pill>danger</Badge>
14+
</div>
15+
);
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import React from 'react';
2+
import { Badge } from 'reactstrap';
3+
4+
export default class Example extends React.Component {
5+
render() {
6+
return (
7+
<div>
8+
<Badge>default</Badge>
9+
<Badge color="primary">primary</Badge>
10+
<Badge color="success">success</Badge>
11+
<Badge color="info">info</Badge>
12+
<Badge color="warning">warning</Badge>
13+
<Badge color="danger">danger</Badge>
14+
</div>
15+
);
16+
}
17+
}

docs/lib/examples/Tag.js

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

docs/lib/examples/TagPills.js

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

docs/lib/examples/TagVariations.js

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

docs/lib/routes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import InputGroupPage from './Components/InputGroupPage';
1414
import PopoversPage from './Components/PopoversPage';
1515
import ProgressPage from './Components/ProgressPage';
1616
import TooltipsPage from './Components/TooltipsPage';
17-
import TagsPage from './Components/TagsPage';
17+
import BadgePage from './Components/BadgePage';
1818
import MediaPage from './Components/MediaPage';
1919
import ModalsPage from './Components/ModalsPage';
2020
import CardPage from './Components/CardPage';
@@ -43,7 +43,7 @@ const routes = (
4343
<Route path="popovers/" component={PopoversPage} />
4444
<Route path="progress/" component={ProgressPage} />
4545
<Route path="tooltips/" component={TooltipsPage} />
46-
<Route path="tags/" component={TagsPage} />
46+
<Route path="badge/" component={BadgePage} />
4747
<Route path="card/" component={CardPage} />
4848
<Route path="tables/" component={TablesPage} />
4949
<Route path="modals/" component={ModalsPage} />

src/Tag.js renamed to src/Badge.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const defaultProps = {
1717
tag: 'span'
1818
};
1919

20-
const Tag = (props) => {
20+
const Badge = (props) => {
2121
const {
2222
className,
2323
cssModule,
@@ -29,17 +29,17 @@ const Tag = (props) => {
2929

3030
const classes = mapToCssModules(classNames(
3131
className,
32-
'tag',
33-
'tag-' + color,
34-
pill ? 'tag-pill' : false
32+
'badge',
33+
'badge-' + color,
34+
pill ? 'badge-pill' : false
3535
), cssModule);
3636

3737
return (
3838
<Component {...attributes} className={classes} />
3939
);
4040
};
4141

42-
Tag.propTypes = propTypes;
43-
Tag.defaultProps = defaultProps;
42+
Badge.propTypes = propTypes;
43+
Badge.defaultProps = defaultProps;
4444

45-
export default Tag;
45+
export default Badge;

0 commit comments

Comments
 (0)