|
@ -1,8 +1,9 @@ |
|
|
import React from "react" |
|
|
import React from "react" |
|
|
import { View, StyleSheet, StatusBar, Text, SafeAreaView, Dimensions, Image } from "react-native" |
|
|
import { View, StyleSheet, StatusBar, Text, SafeAreaView, Dimensions, Image } from "react-native" |
|
|
|
|
|
import { AdMobBanner, AdMobInterstitial, PublisherBanner, AdMobRewarded } from "expo-ads-admob" |
|
|
|
|
|
|
|
|
import { Button, ButtonContainer } from "../components/Button" |
|
|
import { Button, ButtonContainer } from "../components/Button" |
|
|
import { colors, texts } from "../components/Variables" |
|
|
|
|
|
|
|
|
import { colors, texts, credentials } from "../components/Variables" |
|
|
import { examQuestions } from "../components/ExamQuestions" |
|
|
import { examQuestions } from "../components/ExamQuestions" |
|
|
|
|
|
|
|
|
const screen = Dimensions.get("window") |
|
|
const screen = Dimensions.get("window") |
|
@ -14,6 +15,21 @@ const styles = StyleSheet.create({ |
|
|
flex: 1, |
|
|
flex: 1, |
|
|
paddingHorizontal: 20 |
|
|
paddingHorizontal: 20 |
|
|
}, |
|
|
}, |
|
|
|
|
|
bannerContainer: { |
|
|
|
|
|
backgroundColor: colors.white, |
|
|
|
|
|
position: "absolute", |
|
|
|
|
|
bottom: 0, |
|
|
|
|
|
left: 0, |
|
|
|
|
|
right: 0, |
|
|
|
|
|
flex: 1, |
|
|
|
|
|
alignItems: "center", |
|
|
|
|
|
justifyContent: "center" |
|
|
|
|
|
}, |
|
|
|
|
|
banner: { |
|
|
|
|
|
width: 300, |
|
|
|
|
|
height: 250, |
|
|
|
|
|
marginVertical: 20 |
|
|
|
|
|
}, |
|
|
title: { |
|
|
title: { |
|
|
color: colors.white, |
|
|
color: colors.white, |
|
|
fontSize: 25, |
|
|
fontSize: 25, |
|
@ -52,6 +68,10 @@ class Splash extends React.Component { |
|
|
results: false |
|
|
results: false |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bannerError = (e) => { |
|
|
|
|
|
console.log("Banner error: ", e) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() { |
|
|
render() { |
|
|
|
|
|
|
|
@ -85,25 +105,18 @@ class Splash extends React.Component { |
|
|
color: colors.blue |
|
|
color: colors.blue |
|
|
})} |
|
|
})} |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<Button |
|
|
|
|
|
text={"Banner"} |
|
|
|
|
|
isBig={true} |
|
|
|
|
|
onPress={() => |
|
|
|
|
|
this.props.navigation.navigate("Banner", { |
|
|
|
|
|
title: texts.exam, |
|
|
|
|
|
questions: examQuestions, |
|
|
|
|
|
color: colors.blue |
|
|
|
|
|
})} |
|
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ButtonContainer> |
|
|
</ButtonContainer> |
|
|
|
|
|
|
|
|
</View> |
|
|
</View> |
|
|
|
|
|
|
|
|
</SafeAreaView> |
|
|
</SafeAreaView> |
|
|
|
|
|
|
|
|
|
|
|
<View style={styles.bannerContainer}> |
|
|
|
|
|
<AdMobBanner |
|
|
|
|
|
style={styles.banner} |
|
|
|
|
|
bannerSize="mediumRectangle" |
|
|
|
|
|
adUnitID={credentials.adMobUnitID} |
|
|
|
|
|
onDidFailToReceiveAdWithError={this.bannerError} /> |
|
|
|
|
|
</View> |
|
|
</View> |
|
|
</View> |
|
|
) |
|
|
) |
|
|
} |
|
|
} |
|
|