diff --git a/vds-app/App/assets/logo.png b/vds-app/App/assets/logo.png new file mode 100644 index 0000000..0f19421 Binary files /dev/null and b/vds-app/App/assets/logo.png differ diff --git a/vds-app/App/components/Button.js b/vds-app/App/components/Button.js index dfaf86c..5fe22d6 100644 --- a/vds-app/App/components/Button.js +++ b/vds-app/App/components/Button.js @@ -18,6 +18,11 @@ const styles = StyleSheet.create({ fontSize: 20, textAlign: "center" }, + subtitle: { + color: colors.white, + fontSize: 15, + textAlign: "center" + }, buttonContainer: { flexDirection: "row", flexWrap: "wrap", @@ -26,11 +31,26 @@ const styles = StyleSheet.create({ } }) -export const Button = ({ text, onPress = () => {} }) => ( - - {text} - -) +export const Button = ({ text, subtitle = null, isBig = false, onPress = () => {} }) => { + + const buttonBig = isBig ? {fontSize: 25} : {} + + if(subtitle) { + return ( + + {text} + {subtitle} + + ) + } else { + return ( + + {text} + + ) + } +} + export const ButtonContainer = ({ children }) => ( {children} diff --git a/vds-app/App/components/Variables.js b/vds-app/App/components/Variables.js index 8045012..e182241 100644 --- a/vds-app/App/components/Variables.js +++ b/vds-app/App/components/Variables.js @@ -2,7 +2,7 @@ export const colors = { white: "#fff", white_alpha: "rgba(255, 255, 255, 0.3)", black: "#000", - purple: "#780062", + purple: "#8c0072", purple_light: "#a30085", blue: "#36b1f0", dark_blue: "#15a7f0", @@ -17,7 +17,9 @@ export const colors = { export const texts = { quizzes: "Seleziona un quiz", - exam: "Simulazione esame (30 domande in 30min)", + section_quizzes: "Quiz per argomento", + exam: "Simulazione esame", + exam_simulation: "30 domande in 30min", corrects: "Corrette", wrongs: "Sbagliate", percentage: "Percentuale", diff --git a/vds-app/App/index.js b/vds-app/App/index.js index 9208565..1de72d9 100644 --- a/vds-app/App/index.js +++ b/vds-app/App/index.js @@ -1,21 +1,32 @@ import { createStackNavigator, createAppContainer } from "react-navigation" +import Splash from "./screens/Splash" import QuizIndex from "./screens/QuizIndex" import Quiz from "./screens/Quiz" import Exam from "./screens/Exam" import { colors, texts} from "./components/Variables" const MainStack = createStackNavigator({ + Splash: { + screen: Splash, + navigationOptions: ({ navigation }) => ({ + header: null, + backgroundColor: colors.yellow, + headerStyle: { + backgroundColor: colors.yellow + } + }) + }, QuizIndex: { screen: QuizIndex, - navigationOptions: { + navigationOptions: ({ navigation }) => ({ headerTitle: texts.quizzes, headerTintColor: colors.white, backgroundColor: colors.dark_blue, headerStyle: { - backgroundColor: colors.purple + backgroundColor: colors.dark_blue } - } + }) }, Quiz: { screen: Quiz, diff --git a/vds-app/App/screens/QuizIndex.js b/vds-app/App/screens/QuizIndex.js index 47eb378..373f3d2 100644 --- a/vds-app/App/screens/QuizIndex.js +++ b/vds-app/App/screens/QuizIndex.js @@ -1,5 +1,5 @@ import React from "react" -import { ScrollView, StatusBar } from "react-native" +import { ScrollView, StatusBar, } from "react-native" import testQuestions from "../data/test" import aerodynamicsQuestions from "../data/aerodynamics" @@ -12,82 +12,77 @@ import meteorologyQuestions from "../data/meteorology" import physiopathologyQuestions from "../data/physiopathology" import pilotingTechniquesQuestions from "../data/pilotingTechniques" +import { Button, ButtonContainer } from "../components/Button" import { RowItem } from "../components/RowItem" import { colors, texts} from "../components/Variables" import { examQuestions } from "../components/ExamQuestions" export default ({ navigation }) => ( - + - + navigation.navigate("Quiz", { title: texts.aerodynamics, questions: aerodynamicsQuestions, color: colors.blue })}/> - + navigation.navigate("Quiz", { title: texts.first_aid, questions: firstAidQuestions, color: colors.blue })}/> - + navigation.navigate("Quiz", { title: texts.flight_safety, questions: flightSafetyQuestions, color: colors.blue })}/> - + navigation.navigate("Quiz", { title: texts.instruments, questions: instrumentsQuestions, color: colors.blue })}/> - + navigation.navigate("Quiz", { title: texts.legislation, questions: legislationQuestions, color: colors.blue })}/> - + navigation.navigate("Quiz", { title: texts.materials, questions: materialsQuestions, color: colors.blue })}/> - + navigation.navigate("Quiz", { title: texts.meteorology, questions: meteorologyQuestions, color: colors.blue })}/> - + navigation.navigate("Quiz", { title: texts.physiopathology, questions: physiopathologyQuestions, color: colors.blue })}/> - + navigation.navigate("Quiz", { title: texts.piloting_techniques, questions: pilotingTechniquesQuestions, color: colors.blue })}/> - - navigation.navigate("Exam", { - title: texts.exam, - questions: examQuestions, - color: colors.blue - })}/> ) diff --git a/vds-app/App/screens/Splash.js b/vds-app/App/screens/Splash.js new file mode 100644 index 0000000..b2eb034 --- /dev/null +++ b/vds-app/App/screens/Splash.js @@ -0,0 +1,101 @@ +import React from "react" +import { View, StyleSheet, StatusBar, Text, SafeAreaView, Dimensions, Image } from "react-native" + +import { Button, ButtonContainer } from "../components/Button" +import { colors, texts } from "../components/Variables" +import { examQuestions } from "../components/ExamQuestions" + +const screen = Dimensions.get("window") +const logo = require("../assets/logo.png") + +const styles = StyleSheet.create({ + container: { + backgroundColor: colors.blue, + flex: 1, + paddingHorizontal: 20 + }, + title: { + color: colors.white, + fontSize: 25, + textAlign: "center", + fontWeight: "600", + paddingVertical: 20 + }, + text: { + color: colors.white, + fontSize: 20, + textAlign: "center", + fontWeight: "400", + paddingVertical: 20, + marginTop: 20, + }, + safearea: { + flex: 1, + marginTop: 10, + justifyContent: "space-between" + }, + logoContainer: { + marginTop: 50, + alignItems: "center", + justifyContent: "center", + width: "100%", + height: 150 + }, + logo: { + width: 150 + } +}) + +class Splash extends React.Component { + + state = { + results: false + } + + + render() { + + return ( + + + + + + + + +