8 changed files with 159 additions and 102 deletions
@ -0,0 +1,31 @@ |
|||||
|
export const colors = { |
||||
|
white: "#fff", |
||||
|
white_alpha: "rgba(255, 255, 255, 0.3)", |
||||
|
black: "#000", |
||||
|
blue: "#36b1f0", |
||||
|
dark_blue: "#15a7f0", |
||||
|
red: "#af321e", |
||||
|
red_alpha: "rgba(175, 50, 30, 0.9)", |
||||
|
green: "#28A125", |
||||
|
green_alpha: "rgba(40, 160, 40, 0.9)", |
||||
|
yellow: "#e1ff3c", |
||||
|
yellow_alpha: "rgba(225, 255, 60, 0.9)", |
||||
|
orange: "#ff9b32" |
||||
|
} |
||||
|
|
||||
|
export const texts = { |
||||
|
quizzes: "Seleziona un quiz", |
||||
|
exam: "Simulazione esame", |
||||
|
corrects: "Corrette", |
||||
|
wrongs: "Sbagliate", |
||||
|
percentage: "Percentuale", |
||||
|
aerodynamics: "Aerodinamica", |
||||
|
first_aid: "Primo soccorso", |
||||
|
flight_safety: "Sicurezza in volo", |
||||
|
instruments: "Strumentazione", |
||||
|
legislation: "Normativa e legislazione", |
||||
|
materials: "Materiali", |
||||
|
meteorology: "Meteorologia e aerologia", |
||||
|
physiopathology: "Fisiopatologia del volo", |
||||
|
piloting_techniques: "Tecniche di pilotaggio" |
||||
|
} |
@ -1,26 +1,32 @@ |
|||||
import { createStackNavigator, createAppContainer } from "react-navigation"; |
|
||||
|
import { createStackNavigator, createAppContainer } from "react-navigation" |
||||
|
|
||||
import QuizIndex from "./screens/QuizIndex"; |
|
||||
import Quiz from "./screens/Quiz"; |
|
||||
|
import QuizIndex from "./screens/QuizIndex" |
||||
|
import Quiz from "./screens/Quiz" |
||||
|
import { colors, texts} from "./components/Variables" |
||||
|
|
||||
const MainStack = createStackNavigator({ |
const MainStack = createStackNavigator({ |
||||
QuizIndex: { |
QuizIndex: { |
||||
screen: QuizIndex, |
screen: QuizIndex, |
||||
navigationOptions: { |
navigationOptions: { |
||||
headerTitle: "Quizzes" |
|
||||
|
headerTitle: texts.quizzes, |
||||
|
headerTintColor: colors.white, |
||||
|
backgroundColor: colors.dark_blue, |
||||
|
headerStyle: { |
||||
|
backgroundColor: colors.dark_blue |
||||
|
} |
||||
} |
} |
||||
}, |
}, |
||||
Quiz: { |
Quiz: { |
||||
screen: Quiz, |
screen: Quiz, |
||||
navigationOptions: ({ navigation }) => ({ |
navigationOptions: ({ navigation }) => ({ |
||||
headerTitle: navigation.getParam("title"), |
headerTitle: navigation.getParam("title"), |
||||
headerTintColor: "#fff", |
|
||||
|
headerTintColor: colors.white, |
||||
headerStyle: { |
headerStyle: { |
||||
backgroundColor: navigation.getParam("color"), |
backgroundColor: navigation.getParam("color"), |
||||
borderBottomColor: navigation.getParam("color") |
borderBottomColor: navigation.getParam("color") |
||||
} |
} |
||||
}) |
}) |
||||
} |
} |
||||
}); |
|
||||
|
}) |
||||
|
|
||||
export default createAppContainer(MainStack); |
|
||||
|
export default createAppContainer(MainStack) |
||||
|
@ -1,84 +1,99 @@ |
|||||
import React from "react"; |
|
||||
import { ScrollView, StatusBar } from "react-native"; |
|
||||
|
import React from "react" |
||||
|
import { ScrollView, StatusBar } from "react-native" |
||||
|
|
||||
import testQuestions from "../data/test"; |
|
||||
import aerodynamicsQuestions from "../data/aerodynamics"; |
|
||||
import firstAidQuestions from "../data/firstAid"; |
|
||||
import flightSafetyQuestions from "../data/flightSafety"; |
|
||||
import instrumentsQuestions from "../data/instruments"; |
|
||||
import legislationQuestions from "../data/legislation"; |
|
||||
import materialsQuestions from "../data/materials"; |
|
||||
import meteorologyQuestions from "../data/meteorology"; |
|
||||
import physiopathologyQuestions from "../data/physiopathology"; |
|
||||
import pilotingTechniquesQuestions from "../data/pilotingTechniques"; |
|
||||
|
import testQuestions from "../data/test" |
||||
|
import aerodynamicsQuestions from "../data/aerodynamics" |
||||
|
import firstAidQuestions from "../data/firstAid" |
||||
|
import flightSafetyQuestions from "../data/flightSafety" |
||||
|
import instrumentsQuestions from "../data/instruments" |
||||
|
import legislationQuestions from "../data/legislation" |
||||
|
import materialsQuestions from "../data/materials" |
||||
|
import meteorologyQuestions from "../data/meteorology" |
||||
|
import physiopathologyQuestions from "../data/physiopathology" |
||||
|
import pilotingTechniquesQuestions from "../data/pilotingTechniques" |
||||
|
|
||||
import { RowItem } from "../components/RowItem"; |
|
||||
|
import { RowItem } from "../components/RowItem" |
||||
|
import { colors, texts } from "../components/Variables" |
||||
|
|
||||
export default ({ navigation }) => ( |
export default ({ navigation }) => ( |
||||
<ScrollView> |
|
||||
|
<ScrollView style={[{ backgroundColor: colors.dark_blue }]}> |
||||
<StatusBar barStyle="dark-content" /> |
<StatusBar barStyle="dark-content" /> |
||||
<RowItem name="Aerodinamica" color="#36b1f0" onPress={() => |
|
||||
|
<RowItem name={texts.aerodynamics} color={colors.blue} onPress={() => |
||||
navigation.navigate("Quiz", { |
navigation.navigate("Quiz", { |
||||
title: "Aerodinamica", |
|
||||
|
title: texts.aerodynamics, |
||||
questions: aerodynamicsQuestions, |
questions: aerodynamicsQuestions, |
||||
color: "#36b1f0" |
|
||||
|
color: colors.blue |
||||
})}/> |
})}/> |
||||
|
|
||||
<RowItem name="Primo soccorso" color="#36b1f0" onPress={() => |
|
||||
|
<RowItem name={texts.first_aid} color={colors.blue} onPress={() => |
||||
navigation.navigate("Quiz", { |
navigation.navigate("Quiz", { |
||||
title: "Primo soccorso", |
|
||||
|
title: texts.first_aid, |
||||
questions: firstAidQuestions, |
questions: firstAidQuestions, |
||||
color: "#36b1f0" |
|
||||
|
color: colors.blue |
||||
})}/> |
})}/> |
||||
|
|
||||
<RowItem name="Sicurezza in volo" color="#36b1f0" onPress={() => |
|
||||
|
<RowItem name={texts.flight_safety} color={colors.blue} onPress={() => |
||||
navigation.navigate("Quiz", { |
navigation.navigate("Quiz", { |
||||
title: "Sicurezza in volo", |
|
||||
|
title: texts.flight_safety, |
||||
questions: flightSafetyQuestions, |
questions: flightSafetyQuestions, |
||||
color: "#36b1f0" |
|
||||
|
color: colors.blue |
||||
})}/> |
})}/> |
||||
|
|
||||
<RowItem name="Strumentazione" color="#36b1f0" onPress={() => |
|
||||
|
<RowItem name={texts.instruments} color={colors.blue} onPress={() => |
||||
navigation.navigate("Quiz", { |
navigation.navigate("Quiz", { |
||||
title: "Strumentazione", |
|
||||
|
title: texts.instruments, |
||||
questions: instrumentsQuestions, |
questions: instrumentsQuestions, |
||||
color: "#36b1f0" |
|
||||
|
color: colors.blue |
||||
})}/> |
})}/> |
||||
|
|
||||
<RowItem name="Materiali" color="#36b1f0" onPress={() => |
|
||||
|
<RowItem name={texts.legislation} color={colors.blue} onPress={() => |
||||
navigation.navigate("Quiz", { |
navigation.navigate("Quiz", { |
||||
title: "Materiali", |
|
||||
|
title: texts.legislation, |
||||
|
questions: legislationQuestions, |
||||
|
color: colors.blue |
||||
|
})}/> |
||||
|
|
||||
|
<RowItem name={texts.materials} color={colors.blue} onPress={() => |
||||
|
navigation.navigate("Quiz", { |
||||
|
title: texts.materials, |
||||
questions: materialsQuestions, |
questions: materialsQuestions, |
||||
color: "#36b1f0" |
|
||||
|
color: colors.blue |
||||
})}/> |
})}/> |
||||
|
|
||||
<RowItem name="Meteorologia e aerologia" color="#36b1f0" onPress={() => |
|
||||
|
<RowItem name={texts.meteorology} color={colors.blue} onPress={() => |
||||
navigation.navigate("Quiz", { |
navigation.navigate("Quiz", { |
||||
title: "Meteorologia e aerologia", |
|
||||
|
title: texts.meteorology, |
||||
questions: meteorologyQuestions, |
questions: meteorologyQuestions, |
||||
color: "#36b1f0" |
|
||||
|
color: colors.blue |
||||
})}/> |
})}/> |
||||
|
|
||||
<RowItem name="Fisiopatologia del volo" color="#36b1f0" onPress={() => |
|
||||
|
<RowItem name={texts.physiopathology} color={colors.blue} onPress={() => |
||||
navigation.navigate("Quiz", { |
navigation.navigate("Quiz", { |
||||
title: "Fisiopatologia del volo", |
|
||||
|
title: texts.physiopathology, |
||||
questions: physiopathologyQuestions, |
questions: physiopathologyQuestions, |
||||
color: "#36b1f0" |
|
||||
|
color: colors.blue |
||||
|
})}/> |
||||
|
|
||||
|
<RowItem name={texts.piloting_techniques} color={colors.blue} onPress={() => |
||||
|
navigation.navigate("Quiz", { |
||||
|
title: texts.piloting_techniques, |
||||
|
questions: pilotingTechniquesQuestions, |
||||
|
color: colors.blue |
||||
})}/> |
})}/> |
||||
|
|
||||
<RowItem name="Tecniche di pilotaggio" color="#36b1f0" onPress={() => |
|
||||
|
<RowItem name={texts.exam} color={colors.blue} onPress={() => |
||||
navigation.navigate("Quiz", { |
navigation.navigate("Quiz", { |
||||
title: "Tecniche di pilotaggio", |
|
||||
|
title: texts.exam, |
||||
questions: pilotingTechniquesQuestions, |
questions: pilotingTechniquesQuestions, |
||||
color: "#36b1f0" |
|
||||
|
color: colors.blue |
||||
})}/> |
})}/> |
||||
|
|
||||
<RowItem name="TEST" color="#36b1f0" onPress={() => |
|
||||
|
<RowItem name="TEST" color={colors.orange} onPress={() => |
||||
navigation.navigate("Quiz", { |
navigation.navigate("Quiz", { |
||||
title: "TEST", |
title: "TEST", |
||||
questions: testQuestions, |
questions: testQuestions, |
||||
color: "#36b1f0" |
|
||||
|
color: colors.orange |
||||
})}/> |
})}/> |
||||
|
|
||||
</ScrollView> |
</ScrollView> |
||||
); |
|
||||
|
) |
||||
|
Loading…
Reference in new issue