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.
57 lines
1.4 KiB
57 lines
1.4 KiB
import {FlatList, SafeAreaView, StyleSheet, Text, View} from "react-native";
|
|
import React from "react";
|
|
import {JokeListItems} from "../components/ListeJokeComponent";
|
|
import {Joke} from "../model/Joke";
|
|
import {JokeFactory} from "../model/JokeFactory";
|
|
import {JokeStub} from "../model/JokeStub";
|
|
import {indigo} from "../Theme";
|
|
|
|
|
|
const DATACUSTOM = JokeFactory.createCustomJokes(JokeStub.customJokes)
|
|
const DATASAMPLE = JokeFactory.createSampleJokes(JokeStub.sampleJokes)
|
|
|
|
//@ts-ignore
|
|
let DataGen = DATACUSTOM.concat(DATASAMPLE);
|
|
|
|
export function ListJokeScreen() {
|
|
return (
|
|
<SafeAreaView style={styles.container}>
|
|
<View style={styles.top}>
|
|
<Text style={styles.title}>Liste des Blagues</Text>
|
|
</View>
|
|
<FlatList
|
|
data={DataGen}
|
|
renderItem={JokeListItems}
|
|
keyExtractor={(item: Joke) => item.summary()}
|
|
/>
|
|
</SafeAreaView>
|
|
);
|
|
}
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
title: {
|
|
fontSize: 24,
|
|
color: 'darksalmon',
|
|
textAlign: 'center',
|
|
fontWeight: 'bold',
|
|
marginVertical: 20,
|
|
},
|
|
titleResume: {
|
|
fontSize: 15,
|
|
fontWeight: 'bold',
|
|
marginBottom: 20,
|
|
},
|
|
container: {
|
|
flex: 1,
|
|
backgroundColor: indigo,
|
|
|
|
},
|
|
top: {
|
|
backgroundColor : "rgba(14, 14, 44, 1)"
|
|
},
|
|
|
|
|
|
});
|