Use Text component for HeaderItem

This commit is contained in:
Brandon Millman
2018-06-12 15:25:47 -07:00
parent 155e3d225d
commit 9d9341901f
2 changed files with 11 additions and 7 deletions

View File

@@ -11,6 +11,7 @@ export interface TextProps {
fontFamily?: string; fontFamily?: string;
fontColor?: string; fontColor?: string;
lineHeight?: string; lineHeight?: string;
minHeight?: string;
center?: boolean; center?: boolean;
fontWeight?: number; fontWeight?: number;
} }
@@ -26,6 +27,7 @@ export const Text = styled(PlainText)`
${props => (props.lineHeight ? `line-height: ${props.lineHeight}` : '')}; ${props => (props.lineHeight ? `line-height: ${props.lineHeight}` : '')};
${props => (props.center ? 'text-align: center' : '')}; ${props => (props.center ? 'text-align: center' : '')};
color: ${props => props.fontColor}; color: ${props => props.fontColor};
min-height: ${props => props.minHeight};
`; `;
Text.defaultProps = { Text.defaultProps = {

View File

@@ -1,6 +1,8 @@
import * as React from 'react'; import * as React from 'react';
import { Text } from 'ts/components/ui/text';
import { ListItem } from 'ts/pages/jobs/list/list_item'; import { ListItem } from 'ts/pages/jobs/list/list_item';
import { colors } from 'ts/style/colors';
export interface HeaderItemProps { export interface HeaderItemProps {
headerText?: string; headerText?: string;
@@ -9,15 +11,15 @@ export const HeaderItem: React.StatelessComponent<HeaderItemProps> = ({ headerTe
return ( return (
<div className="h2 lg-py4 md-py4 sm-py3"> <div className="h2 lg-py4 md-py4 sm-py3">
<ListItem> <ListItem>
<div <Text
style={{ fontFamily="Roboto Mono"
fontFamily: 'Roboto Mono', fontSize="24px"
minHeight: '1.25em', lineHeight="1.25"
lineHeight: 1.25, minHeight="1.25em"
}} fontColor={colors.black}
> >
{headerText} {headerText}
</div> </Text>
</ListItem> </ListItem>
</div> </div>
); );