import * as React from "react";
import { Image, StyleSheet, View } from "react-native";
import { useDispatch, useSelector } from "react-redux";
import { Button } from "react-native-elements";
import * as RouterName from "../constants/RouterName";

import { appInit } from "../actions/actioncreators/appinit";
const AppInitReducerSelector = state => state.appInitReducer;

function AppInitScreen({ navigation }) {
    const dispatch = useDispatch();
    const appInitReducer = useSelector(AppInitReducerSelector);

    if(!appInitReducer.init){
        dispatch(appInit());
    }
    return (
        <View style={styles.container}>
            <Image style={styles.logo} source={require("../../assets/image/icon250.png")} />
            <Button
                title="Go to Details"
                onPress={() => {navigation.navigate(RouterName.Login)}}
            />
        </View>
    );
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: "center",
        alignItems: "center",
    },

    logo: {
        width: 100,
        height: 100,
    },
});


export default AppInitScreen;
@@ -33,16 +33,22 @@
 import %7B
+ Text,
  Image, 
@@ -154,81 +154,29 @@
 ort 
-%7B Button %7D from %22react-native-elements%22;%0Aimport * as RouterName
+Constants
  from %22
-../
+expo-
 cons
@@ -184,19 +184,8 @@
 ants
-/RouterName
 %22;%0A%0A
@@ -678,14 +678,13 @@
    %3C
-Button
+View%3E
 %0A   
@@ -700,101 +700,140 @@
     
-title=%22Go to Details%22%0A                onPress=%7B() =%3E %7Bnavigation.navigate(RouterName.Login)%7D%7D
+%3CText style=%7Bstyles.text%7D%3ELoading...%3C/Text%3E%0A                %3CText style=%7Bstyles.text%7D%3EVersion: %7B Constants.manifest.version %7D%3C/Text%3E
 %0A   
@@ -841,17 +841,22 @@
         
-/
+%3C/View
 %3E%0A      
@@ -1012,16 +1012,94 @@
 r%22,%0A
+        backgroundColor: %22#FF3300%22%0A    %7D,%0A    text: %7B%0A        color: %22#FFFFFF%22%0A
     %7D,%0A
-%0A
     

fix init