diff --git a/src/components/anchors.js b/src/components/anchors.js index 3454538..edeeae3 100644 --- a/src/components/anchors.js +++ b/src/components/anchors.js @@ -7,9 +7,7 @@ export default class Anchors extends React.PureComponent { constructor(props) { super(props) - const { categories } = props - - const defaultCategory = categories.filter(category => category.first)[0] + let defaultCategory = props.categories.filter(category => category.first)[0] this.state = { selected: defaultCategory.name, @@ -18,6 +16,21 @@ export default class Anchors extends React.PureComponent { this.handleClick = this.handleClick.bind(this) } + getSVG(name) { + this.SVGs || (this.SVGs = {}) + + if (this.SVGs[name]) { + return this.SVGs[name] + } else { + let svg = ` + ${SVGs[name]} + ` + + this.SVGs[name] = svg + return svg + } + } + handleClick(e) { var index = e.currentTarget.getAttribute('data-index') var { categories, onAnchorClick } = this.props @@ -50,7 +63,7 @@ export default class Anchors extends React.PureComponent { : ''}`} style={{ color: isSelected ? color : null }} > -
+
- - `, + Activity: ``, - Custom: ` - - - - - - `, + Custom: ``, - Flags: ` - - `, + Flags: ``, - Foods: ` - - `, + Foods: ``, - Nature: ` - - - `, + Nature: ``, - Objects: ` - - - `, + Objects: ``, - People: ` - - - `, + People: ``, - Places: ` - - - `, + Places: ``, - Recent: ` - - - `, + Recent: ``, - Symbols: ` - - `, + Symbols: ``, } export default SVGs