@safewaystore/native-ui
Version:
A awesome React Native UI by SafeWay Store.
27 lines (23 loc) • 844 B
text/typescript
import styled from 'styled-components/native';
import { IProps } from './types';
export const View = styled.View`
${(props: IProps) => typeof props.flex === 'number' && `flex: ${props.flex};`}
${(props: IProps) => props.bgColor && `background-color: ${props.bgColor}`}
${(props: IProps) => typeof props.p === 'number' && `padding: ${props.p}px`}
${(props: IProps) =>
typeof props.p === 'object' && props.p.t
? `padding-top: ${props.p.t}px`
: null}
${(props: IProps) =>
typeof props.p === 'object' && props.p.r
? `padding-right: ${props.p.r}px`
: null}
${(props: IProps) =>
typeof props.p === 'object' && props.p.b
? `padding-bottom: ${props.p.b}px`
: null}
${(props: IProps) =>
typeof props.p === 'object' && props.p.l
? `padding-left: ${props.p.l}px`
: null}
`;