+
{item.name}
);
}
- onRemoveClick(tag) {
-
+ onRemoveClick(tagId) {
if(this.props.onRemoveClick){
- this.props.onRemoveClick(tag);
- }
- }
- onTagSelected(tag) {
- if(this.props.onTagSelected){
- this.props.onTagSelected(tag);
+ this.props.onRemoveClick(tagId);
}
}
+ onTagSelected(tagId) {
+ if(this.props.onTagSelected){
+ this.props.onTagSelected(tagId);
+ }
+ }
}
export default TagSelector;
diff --git a/client/src/core-components/tag-selector.scss b/client/src/core-components/tag-selector.scss
index 2cb298af..d03e4712 100644
--- a/client/src/core-components/tag-selector.scss
+++ b/client/src/core-components/tag-selector.scss
@@ -9,6 +9,7 @@
cursor: text;
background-color: white;
border: 1px solid $grey;
+ min-height: 38px;
&:focus {
outline: none;
@@ -17,34 +18,6 @@
}
}
- &__selected-tags {
- border-radius: 3px;
- background-color: white;
- padding: 3px 1px;
- }
-
- &__selected-tag {
- color: white;
- display: inline-block;
- border-radius: 3px;
- margin-left: 5px;
- padding: 3px;
- font-size: 13px;
- }
-
- &__selected-tag {
- cursor: default;
-
- &-remove {
- cursor: pointer;
- margin-left: 10px;
-
- &:hover {
- color: $light-grey;
- }
- }
- }
-
&__tag-options {
font-size: 13px;
color: $dark-grey;
diff --git a/client/src/core-components/tag.js b/client/src/core-components/tag.js
new file mode 100644
index 00000000..9974cab1
--- /dev/null
+++ b/client/src/core-components/tag.js
@@ -0,0 +1,42 @@
+import React from 'react';
+import Icon from 'core-components/icon';
+import classNames from 'classnames';
+
+class Tag extends React.Component {
+
+ static propTypes = {
+ name: React.PropTypes.string,
+ color: React.PropTypes.string,
+ showDeleteButton: React.PropTypes.bool,
+ onRemoveClick: React.PropTypes.func,
+ size: React.PropTypes.oneOf(['small','medium'])
+ };
+
+ render() {
+ return (
+
event.stopPropagation()} >
+ {this.props.name}
+ {this.props.showDeleteButton ? this.renderRemoveButton() : null}
+
+ );
+ }
+
+ renderRemoveButton() {
+ return (
+
+
+
+ );
+ }
+
+ getClass() {
+ let classes = {
+ 'tag': true,
+ 'tag_small': this.props.size === 'small',
+ 'tag_medium': this.props.size === 'medium'
+ };
+
+ return classNames(classes);
+ }
+}
+export default Tag;
diff --git a/client/src/core-components/tag.scss b/client/src/core-components/tag.scss
new file mode 100644
index 00000000..81c2fcc3
--- /dev/null
+++ b/client/src/core-components/tag.scss
@@ -0,0 +1,24 @@
+@import '../scss/vars';
+
+.tag{
+ color: white;
+ display: inline-block;
+ border-radius: 3px;
+ margin-left: 5px;
+ padding: 3px;
+ font-size: 13px;
+ cursor: default;
+
+ &__remove {
+ cursor: pointer;
+ margin-left: 10px;
+
+ &:hover {
+ color: $light-grey;
+ }
+ }
+
+ &_small {
+ font-size: 11px;
+ }
+}
\ No newline at end of file
diff --git a/client/src/lib-app/session-store.js b/client/src/lib-app/session-store.js
index 540c994b..33a31246 100644
--- a/client/src/lib-app/session-store.js
+++ b/client/src/lib-app/session-store.js
@@ -62,6 +62,8 @@ class SessionStore {
this.setItem('allow-attachments', configs['allow-attachments']);
this.setItem('maintenance-mode', configs['maintenance-mode']);
this.setItem('max-size', configs['max-size']);
+ this.setItem('tags', configs['tags']);
+
}
getConfigs() {
@@ -78,6 +80,7 @@ class SessionStore {
'allow-attachments': (this.getItem('allow-attachments') * 1),
'maintenance-mode': (this.getItem('maintenance-mode') * 1),
'max-size': this.getItem('max-size'),
+ 'tags': this.getItem('tags')
};
}