File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed
pages/Sandbox/Editor/Workspace/Project Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ import React, { Fragment } from 'react';
22import { createGlobalStyle } from 'styled-components' ;
33import TagsInput from 'react-tagsinput' ;
44
5- export default function ( color ) {
6- const GlobalStyle = createGlobalStyle `
5+ const GlobalStyle = createGlobalStyle `
76 .react-tagsinput {
87 display: flex;
98 flex-wrap: row;
@@ -19,7 +18,7 @@ export default function(color) {
1918 margin: 0.2rem;
2019 font-size: 13px;
2120 padding: 0.3em 0.5em;
22- background-color: ${ color ( ) } ;
21+ background-color: ${ props => props . color } ;
2322 color: white;
2423 font-weight: 500;
2524 border-radius: 4px;
@@ -43,7 +42,7 @@ export default function(color) {
4342 width: 80px;
4443
4544 &:focus {
46- border-color: ${ color . clearer ( 0.3 ) ( ) } ;
45+ border-color: ${ props => props . color . clearer ( 0.3 ) } ;
4746 }
4847 }
4948
@@ -58,10 +57,9 @@ export default function(color) {
5857 }
5958` ;
6059
61- return props => (
62- < Fragment >
63- < GlobalStyle />
64- < TagsInput { ...props } />
65- </ Fragment >
66- ) ;
67- }
60+ export default props => (
61+ < Fragment >
62+ < GlobalStyle color = { props . template . color } />
63+ < TagsInput { ...props } />
64+ </ Fragment >
65+ ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import UserWithAvatar from 'app/components/UserWithAvatar';
1313import Stats from 'app/pages/common/Stats' ;
1414import PrivacyStatus from 'app/components/PrivacyStatus' ;
1515import GithubBadge from 'common/components/GithubBadge' ;
16- import createEditableTags from 'app/components/EditableTags' ;
16+ import EditableTags from 'app/components/EditableTags' ;
1717import Tags from 'common/components/Tags' ;
1818import Switch from 'common/components/Switch' ;
1919import Tooltip from 'common/components/Tooltip' ;
@@ -102,7 +102,6 @@ class Project extends React.Component {
102102
103103 const template = getTemplateDefinition ( sandbox . template ) ;
104104
105- const EditableTags = createEditableTags ( template . color ) ;
106105 return (
107106 < div style = { { marginBottom : '1rem' } } >
108107 < Item style = { { marginTop : '.5rem' } } >
@@ -217,17 +216,18 @@ class Project extends React.Component {
217216 < StatsContainer >
218217 < Stats sandbox = { sandbox } />
219218 </ StatsContainer >
220-
221219 < Item >
222220 { editable ? (
223221 < EditableTags
222+ template = { template }
224223 value = { sandbox . tags . toJS ( ) }
225224 onChange = { this . changeTags }
226225 onChangeInput = { value => {
227226 signals . workspace . tagChanged ( {
228227 tagName : value ,
229228 } ) ;
230229 } }
230+ maxTags = { 5 }
231231 inputValue = { store . workspace . tags . tagName }
232232 renderInput = { this . renderInput }
233233 onlyUnique
You can’t perform that action at this time.
0 commit comments