Explore category to store

This commit is contained in:
Maarten 2024-08-08 14:18:32 +02:00
parent b619fe34f8
commit d8d8ac35f8
3 changed files with 16 additions and 15 deletions

View file

@ -13,7 +13,6 @@ import { router } from 'expo-router';
import type { AutocompleteDropdownRef } from 'react-native-autocomplete-dropdown'
import { AutocompleteDropdown } from 'react-native-autocomplete-dropdown';
import Modal from "react-native-modal";
import AsyncStorage from '@react-native-async-storage/async-storage';
import { ThemedText } from '@/components/ThemedText';
import { ThemedView } from '@/components/ThemedView';
@ -21,6 +20,8 @@ import { Colors } from '@/constants/Colors';
import { useColorScheme } from '@/hooks/useColorScheme';
import { Request } from '@/services/request';
import List from '@/components/List';
import { store } from '@/store/store';
import { setViewCategory } from '@/store/dataStore';
export default function ExploreScreen() {
const colorScheme = useColorScheme() ?? 'light';
@ -67,7 +68,7 @@ export default function ExploreScreen() {
// View item in sub screen
const viewItem = async (item: any) => {
await AsyncStorage.setItem( 'activeCategory', JSON.stringify( item ) );
store.dispatch(setViewCategory(item));
router.push( '/(explore)/category' );
};