diff --git a/client/src/components/Creatify/EditableFontface/index.js b/client/src/components/Creatify/EditableFontface/index.js index 4050413c..7f7664d7 100644 --- a/client/src/components/Creatify/EditableFontface/index.js +++ b/client/src/components/Creatify/EditableFontface/index.js @@ -19,6 +19,7 @@ export default class EditableFontface extends Component { } = me.state; const { + editable = true, fontFace, } = me.props; @@ -30,23 +31,25 @@ export default class EditableFontface extends Component { MozOsxFontSmoothing: 'grayscale', }, fontFace.text); - console.log(textStyles); + const fontInput = (editable === true) ? ( + me.onKeyPress(e)} onChange={(e) => me.onChange(e)} style={{ + ...{ + bottom: 0, + opacity: 0, + padding: 0, + left: 0, + position: 'absolute', + top: 0, + width: '100%', + zIndex: 1, + }, + ...(fontFace.editorStyle || {}), + }} /> + ) : null; return (
- me.onKeyPress(e)} onChange={(e) => me.onChange(e)} style={{ - ...{ - bottom: 0, - opacity: 0, - padding: 0, - left: 0, - position: 'absolute', - top: 0, - width: '100%', - zIndex: 1, - }, - ...(fontFace.editorStyle || {}), - }} /> + {fontInput}
{textRender(value)}
); diff --git a/client/src/components/Creatify/index.js b/client/src/components/Creatify/index.js index 01217a56..013d1ff7 100644 --- a/client/src/components/Creatify/index.js +++ b/client/src/components/Creatify/index.js @@ -1,4 +1,5 @@ import React, { Component } from 'react'; +import Select from 'react-select' import RichDraggable from './RichDraggable'; import EditableFontface, { PRESETS as FontPresets } from './EditableFontface'; @@ -20,12 +21,20 @@ export default class Creatify extends Component { this.canvas = React.createRef(); this.contents = React.createRef(); + const fontOptions = fontKeys.map( + (fontName) => ( + { + value: fontName, + label: , + fontName, + } + ) + ); + this.state = { bounds: {}, fontName: fontKeys[0], - fontOptions: fontKeys.map((fontName) => ( - - )), + fontOptions, }; } @@ -59,13 +68,19 @@ export default class Creatify extends Component { state, } = this; + const options = [ + { value: 'chocolate', label:
Chocolate
}, + { value: 'strawberry', label: 'Strawberry' }, + { value: 'vanilla', label: 'Vanilla' }, + ]; + return (
- - - +
+ + +