import React from "react" import { View, TouchableOpacity, Text, StyleSheet } from "react-native" import { colors } from "../components/Variables" const styles = StyleSheet.create({ button: { backgroundColor: colors.white_alpha, borderRadius: 10, paddingHorizontal: 10, paddingVertical: 10, alignItems: "center", justifyContent: "center", width: "100%", marginTop: 20 }, text: { color: colors.white, fontSize: 20, textAlign: "center" }, subtitle: { color: colors.white, fontSize: 15, textAlign: "center" }, buttonContainer: { flexDirection: "row", flexWrap: "wrap", marginTop: 10, justifyContent: "space-between" } }) export const Button = ({ text, subtitle = null, isBig = false, colorize = false, onPress = () => {} }) => { const buttonBig = isBig ? {fontSize: 25} : {} let buttonColor = {backgroundColor: colors.white_alpha} if(colorize && colorize.answered) { //console.log(colorize) if(colorize.isCorrect) { buttonColor = {backgroundColor: colors.green_light} } else { if(colorize.clicked == colorize.id) { buttonColor = {backgroundColor: colors.red_light} } } } if(subtitle) { return ( {text} {subtitle} ) } else { return ( {text} ) } } export const ButtonContainer = ({ children }) => ( {children} )