From 2384b9384984ffa6b197c718452371f76bb76bf1 Mon Sep 17 00:00:00 2001 From: Dslak Date: Fri, 1 Nov 2019 16:32:27 +0100 Subject: [PATCH] button colors background --- vds-app/App/components/Button.js | 14 +++++++++----- vds-app/App/components/Variables.js | 8 ++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/vds-app/App/components/Button.js b/vds-app/App/components/Button.js index b57f336..2c4fdad 100644 --- a/vds-app/App/components/Button.js +++ b/vds-app/App/components/Button.js @@ -5,6 +5,8 @@ import { colors } from "../components/Variables" const styles = StyleSheet.create({ button: { backgroundColor: colors.white_alpha, + borderWidth: 4, + borderColor: 'transparent', borderRadius: 10, paddingHorizontal: 10, paddingVertical: 10, @@ -34,21 +36,23 @@ const styles = StyleSheet.create({ export const Button = ({ text, subtitle = null, isBig = false, colorize = false, onPress = () => {} }) => { const buttonBig = isBig ? {fontSize: 25} : {} + const isClicked = colorize.clicked == colorize.id let buttonColor = {backgroundColor: colors.white_alpha} + if(colorize && colorize.answered) { - //console.log(colorize) + if(colorize.isCorrect) { - buttonColor = {backgroundColor: colors.green_light} + buttonColor = {backgroundColor: colors.green_light, borderColor: isClicked ? colors.white_alpha : 'transparent'} } else { - if(colorize.clicked == colorize.id) { - buttonColor = {backgroundColor: colors.red_light} + if(isClicked) { + buttonColor = {backgroundColor: colors.red_light, borderColor: isClicked ? colors.white_alpha : 'transparent'} } } } if(subtitle) { return ( - + {text} {subtitle} diff --git a/vds-app/App/components/Variables.js b/vds-app/App/components/Variables.js index bfa8c5e..74e4d56 100644 --- a/vds-app/App/components/Variables.js +++ b/vds-app/App/components/Variables.js @@ -4,21 +4,21 @@ export const colors = { black: "#000", purple: "#8c0072", purple_light: "#a30085", - blue: "#15a7f0", + blue: "#1385d0", dark_blue: "#1279be", red: "#af321e", red_alpha: "rgba(175, 50, 30, 0.9)", - red_light: "#af442f", + red_light: "#af5d44", green: "#28A125", green_alpha: "rgba(40, 160, 40, 0.9)", - green_light: "#5bc135", + green_light: "#6cc155", yellow: "#e1ff3c", yellow_alpha: "rgba(225, 255, 60, 0.9)", orange: "#ff9b32" } export const texts = { - quizzes: "Seleziona un quiz", + quizzes: "Seleziona un argomento", section_quizzes: "Quiz per argomento", exam: "Simulazione esame", exam_simulation: "30 domande in 30min",