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() {
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;

View File

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

View File

@ -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',