Skip to content

Instantly share code, notes, and snippets.

@shreyakupadhyay
Created April 25, 2020 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shreyakupadhyay/b17579ff673f22930f1599e2126ea103 to your computer and use it in GitHub Desktop.
Save shreyakupadhyay/b17579ff673f22930f1599e2126ea103 to your computer and use it in GitHub Desktop.
export const CustomText = styled.Text`
font-size: ${props => props.fontSize}px;
color: ${props => props.fontColor};
letter-spacing: ${props => props.letterSpacing};
font-style: ${props => props.fontStyle};
font-weight: ${props => props.fontWeight};
font-family: ${props => props.fontFamily};
line-height: ${props => props.lineHeight};
`;
CustomText.defaultProps = {
fontSize: fontSize.medium,
fontColor: whiteGroundColor,
letterSpacing: '0px',
fontStyle: 'normal',
fontWeight: 'normal',
fontFamily: regularFont,
lineHeight: '18px',
};
export const CustomButton = ({
width,
backgroundColor,
padding,
borderRadius,
clickData,
onPress,
textColor,
fontSize,
title,
margin,
}) => (
<ButtonWrapper
width={width}
backgroundColor={backgroundColor}
padding={padding}
borderRadius={borderRadius}
margin={margin}
onPress={() => onPress(clickData)}
>
<ButtonText textColor={textColor} fontSize={fontSize}>
{title}
</ButtonText>
</ButtonWrapper>
);
const ButtonWrapper = styled.TouchableOpacity`
width: ${props => props.width};
background-color: ${props => props.backgroundColor};
padding: ${props => props.padding};
border-radius: ${props => props.borderRadius};
border: 2px solid ${props => props.backgroundColor};
margin: ${props => props.margin}
`;
const ButtonText = styled.Text`
color: ${props => props.textColor};
font-size: ${props => props.fontSize}px;
text-align: center;
`;
ButtonWrapper.defaultProps = {
width: '100px',
backgroundColor: appColor,
padding: '4px 16px',
borderRadius: '5px',
margin: '5px 5px'
};
ButtonText.defaultProps = {
textColor: whiteColor,
fontSize: fontSize.medium,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment