diff --git a/src/components/SVG/Text.js b/src/components/SVG/Text.js index 05353c0..3a21aeb 100644 --- a/src/components/SVG/Text.js +++ b/src/components/SVG/Text.js @@ -37,10 +37,11 @@ class Text extends Base { } render() { + const { type } = this.props; const { transform } = this.state || {}; const textProps = { - style: { ...style.text }, + style: { ...style.text, ...(type ? style[type] : {}) }, transform, ref: this.textRef }; @@ -57,7 +58,8 @@ Text.propTypes = { PropTypes.node ]).isRequired, quoted: PropTypes.bool, - transform: PropTypes.string + transform: PropTypes.string, + type: PropTypes.string }; export default Text; diff --git a/src/components/SVG/style.js b/src/components/SVG/style.js index 3f5517d..a16b7da 100644 --- a/src/components/SVG/style.js +++ b/src/components/SVG/style.js @@ -61,5 +61,11 @@ export default { ...strokeBase, stroke: grey, strokeDasharray: '6,2' + }, + anchorBox: { + fill: brown + }, + anchorText: { + fill: white } }; diff --git a/src/devel.js b/src/devel.js index 3682843..deb2e6b 100644 --- a/src/devel.js +++ b/src/devel.js @@ -18,6 +18,25 @@ const demoImage = { { type: 'Pin' }, + // Anchor + { + type: 'Box', + props: { + type: 'anchorBox', + radius: 0 + }, + children: [ + { + type: 'Text', + props: { + type: 'anchorText' + }, + children: [ + 'Anchor' + ] + } + ] + }, // Literal { type: 'Box',