Created
October 7, 2018 15:02
-
-
Save mxmzb/d123ae7fd9ecb0fc1a1eef694d5a523f to your computer and use it in GitHub Desktop.
A RN module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import styled, { ThemeProvider } from "styled-components"; | |
import config from "../../config"; | |
const Background = styled.View` | |
width: ${props => props.width}px; | |
height: ${props => props.height}px; | |
background-color: ${props => props.background}; | |
justify-content: flex-end; | |
`; | |
const Label = styled.Text` | |
margin-left: ${props => props.theme.position.listItem.leftRightPadding}; | |
margin-bottom: 5px; | |
font-size: ${props => props.theme.fontSize.separator}; | |
font-weight: 600; | |
color: ${props => props.theme.palette.text.secondary}; | |
`; | |
export default ({ | |
children, | |
background = "transparent", | |
width = 0, | |
height = 35, | |
toUpperCase = true, | |
}) => ( | |
<ThemeProvider theme={config.getTheme()}> | |
<Background background={background} height={height} width={width}> | |
{children && <Label>{toUpperCase ? children.toUpperCase() : children}</Label>} | |
</Background> | |
</ThemeProvider> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment