reza fixed something

master
Reza_ashrafi 2 years ago
parent dbd5641cd2
commit fe804130a5
  1. 2
      navigation/index.js
  2. 1
      package.json
  3. 2
      src/redux/actions/public.js
  4. 3
      src/redux/reducers/public.js
  5. 13
      src/screens/Splash/index.js
  6. 5
      yarn.lock

@ -3,6 +3,7 @@ import { Restart } from "fiction-expo-restart";
import { I18nManager, StatusBar, Dimensions } from "react-native"; import { I18nManager, StatusBar, Dimensions } from "react-native";
import * as Linking from "expo-linking"; import * as Linking from "expo-linking";
import Svg, { G, Path } from "react-native-svg"; import Svg, { G, Path } from "react-native-svg";
import {asyncAwesomeAlert} from "../src/utils/AsyncWrappers";
import { NavigationContainer } from "@react-navigation/native"; import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack"; import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs"; import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
@ -610,6 +611,7 @@ const Navigation = ({
); );
}, []); }, []);
Dimensions.addEventListener("change", () => { Dimensions.addEventListener("change", () => {
const dim = Dimensions.get("window"); const dim = Dimensions.get("window");
setOrientation(dim.height > dim.width ? "portrait" : "landscape"); setOrientation(dim.height > dim.width ? "portrait" : "landscape");

@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"@expo-google-fonts/noto-sans": "^0.2.0", "@expo-google-fonts/noto-sans": "^0.2.0",
"@react-native-async-storage/async-storage": "~1.15.0", "@react-native-async-storage/async-storage": "~1.15.0",
"@react-native-community/netinfo": "7.1.3",
"@react-native-community/slider": "4.1.12", "@react-native-community/slider": "4.1.12",
"@react-navigation/bottom-tabs": "^6.0.9", "@react-navigation/bottom-tabs": "^6.0.9",
"@react-navigation/drawer": "^6.1.8", "@react-navigation/drawer": "^6.1.8",

@ -1,5 +1,7 @@
import proxy from "../proxy"; import proxy from "../proxy";
const publicApi = { const publicApi = {
setOffline : (data) => async (dispatch) =>
await dispatch({ type: "public/setOffline", data }),
setOrientation: (data) => async (dispatch) => setOrientation: (data) => async (dispatch) =>
await dispatch({ type: "public/setOrientation", data }), await dispatch({ type: "public/setOrientation", data }),
setLTR: (data) => async (dispatch) => setLTR: (data) => async (dispatch) =>

@ -9,6 +9,7 @@ const initialState = {
mobile: width < 720, mobile: width < 720,
orientation: height > width ? "portrait" : "landscape", orientation: height > width ? "portrait" : "landscape",
homeData: [], homeData: [],
offline: false,
newProducts: [], newProducts: [],
levels: [], levels: [],
loading: false, loading: false,
@ -79,6 +80,8 @@ const grades = [
const publicApi = (state = initialState, action) => { const publicApi = (state = initialState, action) => {
let { type, data } = action; let { type, data } = action;
switch (type) { switch (type) {
case "public/setOffline":
return { ...state, offline: data, error: null, loading: false };
case "public/setOrientation": case "public/setOrientation":
return { ...state, orientation: data, error: null, loading: false }; return { ...state, orientation: data, error: null, loading: false };
case "public/setLtr": case "public/setLtr":

@ -16,8 +16,12 @@ import Logo from "../../assets/images/logo.png";
const { width } = Dimensions.get("window"); const { width } = Dimensions.get("window");
//style
import Colors from "../../constants/Colors";
function Splash({ function Splash({
navigation, navigation,
theme,
isLogin, isLogin,
blogs, blogs,
getBlogs, getBlogs,
@ -26,7 +30,6 @@ function Splash({
userProducts, userProducts,
getUserProducts, getUserProducts,
setIsDark, setIsDark,
theme,
}) { }) {
const isFocused = useIsFocused(); const isFocused = useIsFocused();
const [out, setOut] = React.useState(false); const [out, setOut] = React.useState(false);
@ -40,7 +43,7 @@ function Splash({
const getTheme = async () => { const getTheme = async () => {
const theme = await AsyncStorage.getItem("theme"); const theme = await AsyncStorage.getItem("theme");
setIsDark(theme); setIsDark(!theme ? "light" : theme);
}; };
const setOutHandler = React.useCallback( const setOutHandler = React.useCallback(
@ -121,7 +124,11 @@ function Splash({
}} }}
/> />
</View> </View>
<ActivityIndicator size={"large"} style={{ marginTop: 20 }} /> <ActivityIndicator
size={"large"}
color={theme === "light" ? Colors.theme1.dark : Colors.theme1.white}
style={{ marginTop: 20 }}
/>
</View> </View>
); );
} }

@ -1519,6 +1519,11 @@
sudo-prompt "^9.0.0" sudo-prompt "^9.0.0"
wcwidth "^1.0.1" wcwidth "^1.0.1"
"@react-native-community/netinfo@7.1.3":
version "7.1.3"
resolved "https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-7.1.3.tgz#518d753a9ac08f1e59562c5d4168193584fd7329"
integrity sha512-E8q3yuges6NYhrXBDQdzwCnG0bBQXATRjs6fpTjRJ37nURmdpe4HLq1awvooG4ymGTpZhrx4elcs/aUM7PTgrA==
"@react-native-community/slider@4.1.12": "@react-native-community/slider@4.1.12":
version "4.1.12" version "4.1.12"
resolved "https://registry.yarnpkg.com/@react-native-community/slider/-/slider-4.1.12.tgz#279ff7bbe487af92ad95ec758a029a54569e2a62" resolved "https://registry.yarnpkg.com/@react-native-community/slider/-/slider-4.1.12.tgz#279ff7bbe487af92ad95ec758a029a54569e2a62"

Loading…
Cancel
Save