feat: use fast-storage

This commit is contained in:
ammarahm-ed
2020-01-14 20:48:03 +05:00
parent 8b6e4c6483
commit c114e05302
11 changed files with 193 additions and 200 deletions

View File

@@ -18,10 +18,9 @@ import {
} from '../../common/common';
import Icon from 'react-native-vector-icons/Feather';
import {h} from '../../utils/utils';
import AsyncStorage from '@react-native-community/async-storage';
import {AnimatedSafeAreaView} from '../../views/Home';
import {useAppContext} from '../../provider/useAppContext';
import FastStorage from 'react-native-fast-storage';
export const Menu = ({close = () => {}, hide, update = () => {}}) => {
const {colors, changeColorScheme} = useAppContext();
@@ -61,10 +60,10 @@ export const Menu = ({close = () => {}, hide, update = () => {}}) => {
icon: 'moon',
func: () => {
if (!colors.night) {
AsyncStorage.setItem('theme', JSON.stringify({night: true}));
FastStorage.setItem('theme', JSON.stringify({night: true}));
changeColorScheme(COLOR_SCHEME_DARK);
} else {
AsyncStorage.setItem('theme', JSON.stringify({night: false}));
FastStorage.setItem('theme', JSON.stringify({night: false}));
changeColorScheme(COLOR_SCHEME_LIGHT);
}