import React from "react"
import { View, ScrollView, StyleSheet, StatusBar, Text, SafeAreaView, Dimensions, Image, BackHandler, Linking} from "react-native"
import { Button, ButtonContainer } from "../components/Button"
import { colors, texts, examScheme, resultsScheme} from "../components/Variables"
const screen = Dimensions.get("window")
const header = require("../assets/header.png")
const pkg = require('../../app.json')
const styles = StyleSheet.create({
container: {
backgroundColor: colors.dark_blue,
flex: 1
},
safearea: {
flex: 1,
marginTop: 0,
justifyContent: "space-between",
paddingHorizontal: 10
},
headerContainer: {
marginTop: -40,
alignItems: "center",
justifyContent: "center",
width: "100%",
height: screen.width/1.5
},
header: {
width: "100%"
},
button: {
position: "absolute",
bottom: 40,
left: 40,
width: screen.width-80
},
box: {
width: screen.width-20,
paddingHorizontal: 10
},
text: {
color: colors.white,
fontSize: 16,
textAlign: "center",
fontWeight: "400",
lineHeight: 20,
textShadowColor: 'rgba(0, 0, 0, 0.75)',
textShadowOffset: {width: -1, height: 1},
textShadowRadius: 10
},
title: {
paddingTop: 30,
color: colors.white,
fontSize: 18,
textTransform: "uppercase",
textAlign: "center",
fontWeight: "400",
lineHeight: 20,
textShadowColor: 'rgba(0, 0, 0, 0.75)',
textShadowOffset: {width: -1, height: 1},
textShadowRadius: 10
},
textSmall: {
lineHeight: 23,
marginTop: 15,
borderRadius: 5,
backgroundColor: colors.black_alpha,
borderWidth: 0,
borderColor: colors.white_alpha,
fontSize: 16,
color: colors.white,
fontWeight: "400",
textAlign: "center",
paddingHorizontal: 20,
paddingVertical: 20
},
textItems: {
fontSize: 16,
fontWeight: "400",
lineHeight: 23,
color: colors.white,
textAlign: "center",
paddingBottom: 10,
marginBottom: 10,
borderBottomColor: colors.black_alpha,
borderBottomWidth: 1
},
noBorder: {
borderBottomWidth: 0
},
item: {
width: "100%"
},
noPadding: {
paddingVertical: 0,
},
textLabel: {
paddingHorizontal: 20,
paddingVertical: 20
},
bold: {
lineHeight: 30,
fontSize: 26,
fontWeight: "600"
}
})
const B = (props) => {props.children}
class Info extends React.Component {
state = {}
openURL = (url) => {
Linking.openURL(url).catch((err) => console.error('An error occurred', err))
}
componentDidMount() {
BackHandler.addEventListener('hardwareBackPress', this.handleBackButton)
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButton)
}
handleBackButton = () => {
this.props.navigation.navigate("Splash")
return true
}
render() {
return (
{`${pkg.expo.name}`}
{`${texts.version}: ${pkg.expo.version}`}
{`${texts.author}: Dslak`}
{texts.description}
{texts.examScheme}:
{examScheme.map( (arg, index) => (
{texts[arg.section]}: {'\n\r'}{arg.questions} {texts.questions} / {arg.points} {texts.points}
))}
TOTALE: {'\n\r'}30 {texts.questions} / 100 {texts.points}
{texts.resultsScheme}:
{resultsScheme.map( (arg, index) => (
{arg.points}: {'\n\r'}{arg.result}
))}
)
}
}
export default Info