@platformbuilders/react-native-ui
Version:
Platform Builders Shared Components Library
40 lines • 1.48 kB
JavaScript
import styled from 'styled-components/native';
import { RNCamera } from 'react-native-camera';
import Touchable from '../Touchable';
import Icon from '../Icon';
import { getTheme, ifStyle } from '../../utils/helpers';
const accentMain = getTheme('accent.main');
const accentContrast = getTheme('accent.contrast');
const showBorder = ifStyle('showBorder');
const hasBorderWidth = ifStyle('borderWidth');
const hasBorderColor = ifStyle('borderColor');
export const Wrapper = styled(Touchable) `
width: ${(props) => props.size}px;
height: ${(props) => props.size}px;
border-radius: ${(props) => props.size / 2}px;
overflow: hidden;
border-width: ${(props) => showBorder(hasBorderWidth(props.borderWidth, '2'), '0')}px;
border-color: ${(props) => hasBorderColor(props.borderColor, accentMain)};
position: relative;
`;
export const UploadIconWrapper = styled.View `
align-items: center;
justify-content: center;
width: ${(props) => props.size / 4}px;
height: ${(props) => props.size / 4}px;
border-radius: ${(props) => props.size / 8}px;
position: absolute;
z-index: 2;
background-color: ${accentMain};
`;
export const UploadIcon = styled(Icon).attrs({ name: 'camera' }) `
color: ${accentContrast};
`;
export const CameraView = styled(RNCamera) `
width: ${(props) => props.size}px;
height: 100%;
border-radius: ${(props) => props.size / 2}px;
overflow: hidden;
border: ${showBorder('4px solid white', '')};
`;
//# sourceMappingURL=styles.js.map