Commit d0705063 by Nguyễn Thị Thúy

update notify

parent f0cfb2a7
...@@ -14,11 +14,6 @@ import DeviceInfo from 'react-native-device-info'; ...@@ -14,11 +14,6 @@ import DeviceInfo from 'react-native-device-info';
import R from './assets/R'; import R from './assets/R';
import {WIDTHXD, HEIGHTXD} from './Config/Functions'; import {WIDTHXD, HEIGHTXD} from './Config/Functions';
import DropdownManager from './components/DropdownAlert/DropdownManager'; import DropdownManager from './components/DropdownAlert/DropdownManager';
import AsyncStorage from '@react-native-community/async-storage';
import KEY from './assets/AsynStorage';
import I18n, {setLocation} from './helper/i18/i18n';
import {changeLanguage} from './actions/language';
enableScreens(); enableScreens();
...@@ -28,16 +23,11 @@ const RootView = (props) => { ...@@ -28,16 +23,11 @@ const RootView = (props) => {
dropDownAlertRef.current, dropDownAlertRef.current,
dropDownAlertLongTimeRef.current, dropDownAlertLongTimeRef.current,
); );
setInitLanguage()
}, []); }, []);
const dropDownAlertRef = useRef(null); const dropDownAlertRef = useRef(null);
const dropDownAlertLongTimeRef = useRef(null); const dropDownAlertLongTimeRef = useRef(null);
const setInitLanguage = async () => {
const laguage = await AsyncStorage.getItem(KEY.LANGUAGE);
if (laguage) props.changeLanguage(laguage);
setLocation(I18n, laguage);
};
return ( return (
<> <>
<View style={{flex: 1}}> <View style={{flex: 1}}>
...@@ -57,10 +47,11 @@ const RootView = (props) => { ...@@ -57,10 +47,11 @@ const RootView = (props) => {
closeInterval={1000} closeInterval={1000}
ref={dropDownAlertRef} ref={dropDownAlertRef}
warnColor={R.colors.orange400} warnColor={R.colors.orange400}
updateStatusBar={false}
defaultContainer={{ defaultContainer={{
borderBottomRightRadius: WIDTHXD(30), borderBottomRightRadius: WIDTHXD(30),
borderBottomLeftRadius: WIDTHXD(30), borderBottomLeftRadius: WIDTHXD(30),
paddingTop: HEIGHTXD(30), paddingTop: HEIGHTXD(90),
paddingVertical: HEIGHTXD(30), paddingVertical: HEIGHTXD(30),
paddingHorizontal: WIDTHXD(20), paddingHorizontal: WIDTHXD(20),
}} }}
...@@ -76,10 +67,11 @@ const RootView = (props) => { ...@@ -76,10 +67,11 @@ const RootView = (props) => {
closeInterval={600000} closeInterval={600000}
ref={dropDownAlertLongTimeRef} ref={dropDownAlertLongTimeRef}
warnColor={R.colors.orange400} warnColor={R.colors.orange400}
updateStatusBar={false}
defaultContainer={{ defaultContainer={{
borderBottomRightRadius: WIDTHXD(30), borderBottomRightRadius: WIDTHXD(30),
borderBottomLeftRadius: WIDTHXD(30), borderBottomLeftRadius: WIDTHXD(30),
paddingTop: HEIGHTXD(30), paddingTop: HEIGHTXD(90),
paddingVertical: HEIGHTXD(30), paddingVertical: HEIGHTXD(30),
paddingHorizontal: WIDTHXD(20), paddingHorizontal: WIDTHXD(20),
}} }}
...@@ -95,4 +87,4 @@ const mapStateToProps = (state) => { ...@@ -95,4 +87,4 @@ const mapStateToProps = (state) => {
}; };
}; };
export default connect(mapStateToProps, {changeLanguage})(RootView); export default connect(mapStateToProps, {})(RootView);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment