Adding style for anchor elements

This commit is contained in:
Jeff Avallone 2018-02-17 06:24:50 -05:00
parent 06a90429ff
commit c047dab5a4
3 changed files with 29 additions and 2 deletions

View File

@ -37,10 +37,11 @@ class Text extends Base {
} }
render() { render() {
const { type } = this.props;
const { transform } = this.state || {}; const { transform } = this.state || {};
const textProps = { const textProps = {
style: { ...style.text }, style: { ...style.text, ...(type ? style[type] : {}) },
transform, transform,
ref: this.textRef ref: this.textRef
}; };
@ -57,7 +58,8 @@ Text.propTypes = {
PropTypes.node PropTypes.node
]).isRequired, ]).isRequired,
quoted: PropTypes.bool, quoted: PropTypes.bool,
transform: PropTypes.string transform: PropTypes.string,
type: PropTypes.string
}; };
export default Text; export default Text;

View File

@ -61,5 +61,11 @@ export default {
...strokeBase, ...strokeBase,
stroke: grey, stroke: grey,
strokeDasharray: '6,2' strokeDasharray: '6,2'
},
anchorBox: {
fill: brown
},
anchorText: {
fill: white
} }
}; };

View File

@ -18,6 +18,25 @@ const demoImage = {
{ {
type: 'Pin' type: 'Pin'
}, },
// Anchor
{
type: 'Box',
props: {
type: 'anchorBox',
radius: 0
},
children: [
{
type: 'Text',
props: {
type: 'anchorText'
},
children: [
'Anchor'
]
}
]
},
// Literal // Literal
{ {
type: 'Box', type: 'Box',