ilink-world/app/screens/ads/InterticielAds.js

122 lines
3.1 KiB
JavaScript
Raw Normal View History

2021-06-09 23:49:59 +00:00
import React, {Component} from 'react';
2019-06-16 13:09:54 +00:00
import PropTypes from 'prop-types';
import {
Platform, StyleSheet, Text,
TouchableWithoutFeedback, View, TextInput,
Button,
Animated, Dimensions, Image, PermissionsAndroid,
2021-06-09 23:49:59 +00:00
StatusBar, TouchableNativeFeedback, TouchableOpacity, BackHandler, Alert, ProgressBarAndroid
2019-06-16 13:09:54 +00:00
, NativeModules, Picker, FlatList
} from 'react-native';
2021-06-09 23:49:59 +00:00
import {responsiveHeight, responsiveWidth} from "react-native-responsive-dimensions"
2019-06-16 13:09:54 +00:00
import BaseScreen from "../BaseScreen";
import Icon from "react-native-vector-icons/MaterialIcons";
2021-06-09 23:49:59 +00:00
import BlurOverlay, {openOverlay, closeOverlay} from 'react-native-blur-overlay'
import I18n from 'react-native-i18n';
import {WebView} from 'react-native-webview';
2019-06-16 13:09:54 +00:00
type Props = {};
2021-06-09 23:49:59 +00:00
const route = require("./../../route.json")
const theme = require('./../../utils/theme.json')
2019-06-16 13:09:54 +00:00
export default class InterticielAds
extends BaseScreen {
static navigatorStyle = {
drawUnderNavBar: true,
2021-06-09 23:49:59 +00:00
navBarHidden: true,
2019-06-16 13:09:54 +00:00
drawUnderStatusBar: false,
statusBarHidden: true,
statusBarTextColorScheme: 'light',
};
2021-06-09 23:49:59 +00:00
2019-06-16 13:09:54 +00:00
static options(passProps) {
return {
statusBar: {
visible: false,
drawBehind: true,
},
topBar: {
drawBehind: true,
visible: false,
animate: false
}
};
}
2021-06-09 23:49:59 +00:00
constructor(props) {
2019-06-16 13:09:54 +00:00
super(props);
};
2021-06-09 23:49:59 +00:00
render() {
return (<BlurOverlay radius={14}
downsampling={2}
onPress={() => {
this.setState({isPubShow: false})
}}
brightness={-200}
2019-06-16 13:09:54 +00:00
2021-06-09 23:49:59 +00:00
>
{this.renderChild()}
</BlurOverlay>)
2019-06-16 13:09:54 +00:00
}
2021-06-09 23:49:59 +00:00
renderChild() {
return (<View style={styles.container}>
2019-06-16 13:09:54 +00:00
<WebView
2021-06-09 23:49:59 +00:00
source={{uri: 'https://ilink-app.com/ads.html'}}
style={{
width: responsiveWidth(100),
marginTop: 37 + responsiveHeight(4),
backgroundColor: 'white'
}}
2019-06-16 13:09:54 +00:00
/>
<View>
2021-06-09 23:49:59 +00:00
<Button
title={I18n.t('QUIT_')}
color={theme.reddeconnect}
style={{position: 'absolute', zIndex: 10000}}
onPress={() => {
this.popOverLay()
}}
>{I18n.t('QUIT_')}</Button>
2019-06-16 13:09:54 +00:00
</View>
2021-06-09 23:49:59 +00:00
2019-06-16 13:09:54 +00:00
</View>)
}
2021-06-09 23:49:59 +00:00
componentDidMount() {
2019-06-16 13:09:54 +00:00
openOverlay()
}
2021-06-09 23:49:59 +00:00
async tryGetHtml() {
response = await fetch('https://ad-server.ilink-app.com/ad_display/zone1/zone4.html')
2019-06-16 13:09:54 +00:00
}
2021-06-09 23:49:59 +00:00
2019-06-16 13:09:54 +00:00
popOverLay() {
2021-06-09 23:49:59 +00:00
if (this.props.closeIntersticiel)
this.props.closeIntersticiel()
2019-06-16 13:09:54 +00:00
closeOverlay()
}
}
2021-06-09 23:49:59 +00:00
const styles = StyleSheet.create({
container: {
flex: 1,
marginTop: 30,
backgroundColor: "white"
2019-06-16 13:09:54 +00:00
},
2021-06-09 23:49:59 +00:00
parent: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: "#000000AE"
2019-06-16 13:09:54 +00:00
}
2021-06-09 23:49:59 +00:00
})