You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1022 B
34 lines
1022 B
import { customJokeStub } from '../data/stub/CustomJokeStub';
|
|
import { sampleJokeStub } from '../data/stub/SampleJokeStub';
|
|
import JokeItems from "../components/JokeItems";
|
|
import '../types/extension';
|
|
import {StyleSheet, View} from "react-native";
|
|
import {purpleColor} from "../assets/Theme";
|
|
import {useDispatch, useSelector} from "react-redux";
|
|
import {useEffect} from "react";
|
|
import { getSampleJokesList } from "../redux/thunk/RecentsJokesThunk";
|
|
|
|
export default function Catalogue() {
|
|
// @ts-ignore
|
|
const allJokes = useSelector(state => state.appReducer.jokes);
|
|
const dispatch = useDispatch();
|
|
|
|
useEffect(() => {
|
|
const loadJokes = async () => {
|
|
// @ts-ignore
|
|
await dispatch(getSampleJokesList());
|
|
};
|
|
loadJokes();
|
|
}, [dispatch]);
|
|
return (
|
|
<View style={styles.container}>
|
|
<JokeItems jokes={allJokes}/>
|
|
</View>
|
|
)
|
|
};
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
backgroundColor: purpleColor
|
|
}
|
|
}); |