Skip to content

Instantly share code, notes, and snippets.

@thepost
Last active May 3, 2019 15:55
Show Gist options
  • Save thepost/1d0114448bf29f1844837ed97a7e43de to your computer and use it in GitHub Desktop.
Save thepost/1d0114448bf29f1844837ed97a7e43de to your computer and use it in GitHub Desktop.
import React, { FC } from 'react';
import { ViewProps } from 'react-native';
import styled from 'styled-components/native';
import { ThemeInterface } from 'themes/ThemeInterface';
interface IBoxProps extends ViewProps {
theme?: ThemeInterface;
borders?: boolean;
}
const BoxRoot = styled.View<IBoxProps>`
padding: ${props => props.theme.lateralPadding};
`;
const InnerBox = styled.View`
margin: 10px 10px;
background-color: white;
`;
export const Box: FC<IBoxProps> = props => (
<BoxRoot {...props}>
<InnerBox>{props.children}</InnerBox>
</BoxRoot>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment