123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- import { StyleSheet, Text, View } from 'react-native'
- import React from 'react'
- import fonts from '../../../constants/fonts';
- import colors from '../../../constants/colors';
- import Button from '../../atoms/Buttons/Button';
- const ThemedTextButton = ({ theme, onPress, title, titleStyle, buttonStyle}) => {
- let style = {};
- switch (theme) {
- case 'primary-outline':
- style = {
- buttonStyle: {
- backgroundColor: colors().dominant,
- maxWidth: '100%',
- width: '100%',
- alignItems: 'center',
- borderColor: colors().primaryColor,
- borderRadius: 6,
- borderWidth: 1
- },
- buttonTextStyle: {
- fontFamily: fonts.type.medium,
- color: colors().secondaryColor,
- }
- }
- break;
- case 'secondary-outline':
- style = {
- buttonStyle: {
- backgroundColor: colors().dominant,
- maxWidth: '100%',
- width: '100%',
- alignItems: 'center',
- borderColor: colors().secondaryColor,
- borderRadius: 6,
- borderWidth: 1
- },
- buttonTextStyle: {
- fontFamily: fonts.type.medium,
- color: colors().primaryColor,
- }
- }
- break;
- case 'secondary-contained':
- style = {
- buttonStyle: {
- backgroundColor: colors().secondaryColor,
- maxWidth: '100%',
- width: '100%',
- alignItems: 'center',
- borderRadius: 6,
- },
- buttonTextStyle: {
- fontFamily: fonts.type.medium,
- color: colors().white,
- }
- }
- break;
- case "white":
- style = {
- buttonStyle: {
- backgroundColor: colors().white_variant,
- maxWidth: '100%',
- width: '100%',
- alignItems: 'center',
- borderRadius: 6,
- },
- buttonTextStyle: {
- fontFamily: fonts.type.medium,
- color: colors().black,
- }
- }
- break
- case "black":
- style = {
- buttonStyle: {
- backgroundColor: colors().black_variant,
- maxWidth: '100%',
- width: '100%',
- alignItems: 'center'
- },
- buttonTextStyle: {
- fontFamily: fonts.type.medium,
- color: colors().white,
- }
- }
- break
- case 'primary-contained':
- default:
- style = {
- buttonStyle: {
- backgroundColor: colors().primaryColor,
- maxWidth: '100%',
- width: '100%',
- alignItems: 'center'
- },
- buttonTextStyle: {
- fontFamily: fonts.type.medium,
- color: colors().white,
- }
- }
- break;
- }
- const styles = StyleSheet.create(style)
- return (
- <Button
- onPress={onPress}
- style={[styles.buttonStyle, buttonStyle]}
- >
- <Text style={[styles.buttonTextStyle, titleStyle]}>
- {title}
- </Text>
- </Button>
- )
- }
- export default ThemedTextButton
|