Adding theme support for Text rendering component
This commit is contained in:
parent
fe714f2363
commit
35efa7cdb0
@ -5,9 +5,9 @@ import { getBBox } from 'layout';
|
|||||||
|
|
||||||
import * as style from './style';
|
import * as style from './style';
|
||||||
|
|
||||||
const Text = ({ transform, quoted, children }) => {
|
const Text = ({ transform, quoted, theme, children }) => {
|
||||||
const textProps = {
|
const textProps = {
|
||||||
style: style.text,
|
style: { ...style.text, ...style[theme] },
|
||||||
transform
|
transform
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -22,6 +22,7 @@ const Text = ({ transform, quoted, children }) => {
|
|||||||
|
|
||||||
Text.propTypes = {
|
Text.propTypes = {
|
||||||
quoted: PropTypes.bool,
|
quoted: PropTypes.bool,
|
||||||
|
theme: PropTypes.string,
|
||||||
transform: PropTypes.string,
|
transform: PropTypes.string,
|
||||||
children: PropTypes.oneOfType([
|
children: PropTypes.oneOfType([
|
||||||
PropTypes.arrayOf(PropTypes.node),
|
PropTypes.arrayOf(PropTypes.node),
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
import { fontSize, fontFamily, grey } from 'rendering/style';
|
import { fontSize, fontFamily, white, grey } from 'rendering/style';
|
||||||
|
|
||||||
export const text = {
|
export const text = {
|
||||||
fontSize, fontFamily
|
fontSize, fontFamily
|
||||||
};
|
};
|
||||||
|
export const anchor = {
|
||||||
|
fill: white
|
||||||
|
};
|
||||||
export const quote = {
|
export const quote = {
|
||||||
fill: grey
|
fill: grey
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user