Skip to content

Commit

Permalink
refactor(tag): changes component name
Browse files Browse the repository at this point in the history
  • Loading branch information
ITML committed Mar 4, 2022
1 parent ea58e86 commit e1db068
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/semantic.less
Expand Up @@ -237,7 +237,7 @@
}

& {
@import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/tags';
@import '@eeacms/volto-eea-design-system/../theme/themes/eea/extras/tag';
}

& {
Expand Down
8 changes: 4 additions & 4 deletions src/ui/Tags/Tags.jsx → src/ui/Tag/Tag.jsx
@@ -1,23 +1,23 @@
import React from 'react';

function Tags({ children, ...rest }) {
function Tag({ children, ...rest }) {
return (
<div {...rest} className={`eea tags ${rest.className || ''}`}>
<div>{children}</div>
</div>
);
}

Tags.Title = ({ children, ...rest }) => (
Tag.Title = ({ children, ...rest }) => (
<span className="tags-title" {...rest}>
{children}
</span>
);

Tags.Tag = ({ children, ...rest }) => (
Tag.Tag = ({ children, ...rest }) => (
<a {...rest} className={`tag ${rest.className || ''}`}>
<span className="name">{children}</span>
</a>
);

export default Tags;
export default Tag;
22 changes: 11 additions & 11 deletions src/ui/Tags/Tags.stories.jsx → src/ui/Tag/Tag.stories.jsx
@@ -1,19 +1,19 @@
import React from 'react';
import Tags from './Tags';
import Tag from './Tag';

export default {
title: 'Components/Tags',
component: Tags,
title: 'Components/Tag',
component: Tag,
argTypes: {
title: {
name: 'title',
description: 'Tags main text',
description: 'Tag main text',
type: { name: 'string', required: true },
},
direction: {
control: { type: 'select' },
options: ['right', 'left'],
description: 'tags container direction',
description: 'tag container direction',
table: {
type: {
summary: 'string',
Expand All @@ -24,7 +24,7 @@ export default {
},
},
tags: {
description: 'category tags',
description: 'category tag',
table: {
type: {
summary: 'Object',
Expand All @@ -38,14 +38,14 @@ export default {
};

export const Default = (args) => (
<Tags className={args.direction}>
<Tags.Title>{args.title}</Tags.Title>
<Tag className={args.direction}>
<Tag.Title>{args.title}</Tag.Title>
{args.tags.map((tag) => [
<Tags.Tag className={tag.class} href={tag.href}>
<Tag.Tag className={tag.class} href={tag.href}>
{tag.category}
</Tags.Tag>,
</Tag.Tag>,
])}
</Tags>
</Tag>
);

Default.args = {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/index.js
Expand Up @@ -4,7 +4,7 @@ export Blockquote from './Blockquote/Blockquote';

export Breadcrumbs from './Breadcrumbs/Breadcrumbs';

export Tags from './Tags/Tags';
export Tag from './Tag/Tag';

export Footer from './Footer/Footer';

Expand Down
5 changes: 5 additions & 0 deletions theme/theme.config
Expand Up @@ -83,7 +83,12 @@
@timeline : 'eea';
@footer : 'eea';
@header : 'eea';
<<<<<<< Updated upstream
@tags : 'eea';
=======
@tag : 'eea';
@content : 'eea';
>>>>>>> Stashed changes
@inpageNavigation : 'eea';
@avatar : 'eea';
@divider : 'eea';
Expand Down
@@ -1,10 +1,10 @@
@type: 'extra';
@element: 'tags';
@element: 'tag';

@import (multiple) '../../theme.config';

/*******************************
Tags
Tag
*******************************/

.eea.tags {
Expand Down
File renamed without changes.

0 comments on commit e1db068

Please sign in to comment.