Adding theme support for Text rendering component

This commit is contained in:
Jeff Avallone 2019-01-27 11:14:49 -05:00
parent fe714f2363
commit 35efa7cdb0
2 changed files with 7 additions and 3 deletions

View File

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

View File

@ -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
}; };