@ -0,0 +1,8 @@
|
|||||||
|
> Why do I have a folder named ".expo" in my project?
|
||||||
|
The ".expo" folder is created when an Expo project is started using "expo start" command.
|
||||||
|
> What do the files contain?
|
||||||
|
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
|
||||||
|
- "settings.json": contains the server configuration that is used to serve the application manifest.
|
||||||
|
> Should I commit the ".expo" folder?
|
||||||
|
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
|
||||||
|
Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"devices": []
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:assert');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:async_hooks');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:buffer');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:child_process');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:cluster');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:console');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:constants');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:crypto');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:dgram');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:diagnostics_channel');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:dns');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:domain');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:events');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:fs');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:fs/promises');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:http');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:http2');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:https');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:inspector');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:module');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:net');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:os');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:path');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:perf_hooks');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:process');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:punycode');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:querystring');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:readline');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:repl');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:stream');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:string_decoder');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:timers');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:tls');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:trace_events');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:tty');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:url');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:util');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:v8');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:vm');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:wasi');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:worker_threads');
|
@ -0,0 +1 @@
|
|||||||
|
module.exports = $$require_external('node:zlib');
|
@ -0,0 +1 @@
|
|||||||
|
global.$$require_external = typeof window === "undefined" ? require : () => null;
|
@ -0,0 +1 @@
|
|||||||
|
global.$$require_external = (moduleId) => {throw new Error(`Node.js standard library module ${moduleId} is not available in this JavaScript environment`);}
|
@ -0,0 +1,20 @@
|
|||||||
|
import { SafeAreaView } from 'react-native'
|
||||||
|
import {StyleSheet, Text, View, FlatList, Image} from 'react-native';
|
||||||
|
import NavigationBar from "./navigation/NavigationBar";
|
||||||
|
import Catalogue from "./screens/Catalogue";
|
||||||
|
import {indigoColor} from "./assets/Theme";
|
||||||
|
|
||||||
|
export default function App() {
|
||||||
|
return (
|
||||||
|
<SafeAreaView style={styles.container}>
|
||||||
|
<NavigationBar />
|
||||||
|
</SafeAreaView>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: indigoColor
|
||||||
|
},
|
||||||
|
});
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 604 B |
After Width: | Height: | Size: 603 B |
After Width: | Height: | Size: 744 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 502 B |
After Width: | Height: | Size: 705 B |
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 265 B |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 805 B |
After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
@ -0,0 +1,28 @@
|
|||||||
|
import {StyleSheet, Text, View, FlatList, Image} from 'react-native';
|
||||||
|
import {SampleJoke} from "../model/SampleJoke";
|
||||||
|
import {CustomJoke} from "../model/CustomJoke";
|
||||||
|
import {greyColor} from "../assets/Theme";
|
||||||
|
|
||||||
|
type JokeItemProps = {
|
||||||
|
joke: (CustomJoke | SampleJoke);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function Categ(prop: JokeItemProps) {
|
||||||
|
return (
|
||||||
|
<View style={styles.bottomContainer}>
|
||||||
|
<Text style={{color:'white'}}>{prop.joke.type}</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
bottomContainer: {
|
||||||
|
backgroundColor: greyColor,
|
||||||
|
paddingVertical: 5,
|
||||||
|
paddingHorizontal: 10,
|
||||||
|
margin: 10,
|
||||||
|
borderRadius: 20,
|
||||||
|
width : 100,
|
||||||
|
alignItems : 'center'
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,22 @@
|
|||||||
|
import {FlatList} from 'react-native';
|
||||||
|
import {SampleJoke} from "../model/SampleJoke";
|
||||||
|
import {CustomJoke} from "../model/CustomJoke";
|
||||||
|
import Categ from "./Categ";
|
||||||
|
|
||||||
|
type JokeListItemProps = {
|
||||||
|
jokes: (CustomJoke | SampleJoke)[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function CategList(props: JokeListItemProps) {
|
||||||
|
return (
|
||||||
|
<FlatList showsHorizontalScrollIndicator={false} horizontal={true}
|
||||||
|
data={props.jokes}
|
||||||
|
keyExtractor={(item) => item.summary().toString()}
|
||||||
|
renderItem={
|
||||||
|
({ item }: { item: CustomJoke | SampleJoke }) => (
|
||||||
|
<Categ joke={item}/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
import {StyleSheet, Text, View, Image} from 'react-native';
|
||||||
|
import {SampleJoke} from "../model/SampleJoke";
|
||||||
|
import {CustomJoke} from "../model/CustomJoke";
|
||||||
|
import {darksalmonColor, whiteColor, indigoColor} from "../assets/Theme";
|
||||||
|
|
||||||
|
type JokeListItemProps = {
|
||||||
|
joke: (CustomJoke | SampleJoke);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function JokeHomeSquare(prop: JokeListItemProps) {
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<View style={styles.topBackgroundColor}>
|
||||||
|
<View style={{width: 200, height: 40, backgroundColor: darksalmonColor}}/>
|
||||||
|
</View>
|
||||||
|
<View style={styles.bottomBackgroundColor}>
|
||||||
|
<View style={{width: 200, height: 120, backgroundColor: indigoColor}}/>
|
||||||
|
</View>
|
||||||
|
<Image source={{ uri: prop.joke.image }} style={styles.image} />
|
||||||
|
<Text style={[styles.text, styles.textTitle]}>Résumé de la blague</Text>
|
||||||
|
<Text style={[styles.text, styles.textSimple]}>{prop.joke.description()}</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
marginTop: 10,
|
||||||
|
marginLeft: 20,
|
||||||
|
position: "relative",
|
||||||
|
},
|
||||||
|
topBackgroundColor: {
|
||||||
|
borderTopLeftRadius: 5,
|
||||||
|
borderTopRightRadius: 5,
|
||||||
|
overflow: 'hidden',
|
||||||
|
},
|
||||||
|
bottomBackgroundColor: {
|
||||||
|
borderBottomLeftRadius: 5,
|
||||||
|
borderBottomRightRadius: 5,
|
||||||
|
overflow: 'hidden',
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
width: 120,
|
||||||
|
height: 75,
|
||||||
|
position: "absolute",
|
||||||
|
top: 5,
|
||||||
|
left: "50%",
|
||||||
|
marginLeft: -60
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
position: 'absolute',
|
||||||
|
textAlign: "center",
|
||||||
|
color:whiteColor,
|
||||||
|
paddingBottom: 7,
|
||||||
|
paddingTop: 7,
|
||||||
|
width: "100%"
|
||||||
|
},
|
||||||
|
textTitle: {
|
||||||
|
fontSize: 17,
|
||||||
|
fontWeight: "bold",
|
||||||
|
top: 90
|
||||||
|
},
|
||||||
|
textSimple: {
|
||||||
|
fontSize: 15,
|
||||||
|
top: 115
|
||||||
|
}
|
||||||
|
});
|
@ -1,35 +1,26 @@
|
|||||||
import {StyleSheet, Text, View, FlatList, Image} from 'react-native';
|
import {StyleSheet, Text, View, Image} from 'react-native';
|
||||||
import {SampleJoke} from "../model/SampleJoke";
|
import {SampleJoke} from "../model/SampleJoke";
|
||||||
import {CustomJoke} from "../model/CustomJoke";
|
import {CustomJoke} from "../model/CustomJoke";
|
||||||
import {darksalmonColor, whiteColor, greyColor, indigoColor} from "../assets/Theme";
|
import {darksalmonColor, whiteColor, greyColor, indigoColor} from "../assets/Theme";
|
||||||
import {Colors} from "react-native/Libraries/NewAppScreen";
|
|
||||||
|
|
||||||
type JokeListItemProps = {
|
type JokeListItemProps = {
|
||||||
jokes: CustomJoke[] | SampleJoke[];
|
joke: (CustomJoke | SampleJoke);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function JokeListItem(props: JokeListItemProps) {
|
export default function JokeItem(prop: JokeListItemProps) {
|
||||||
const renderItem = ({ item }: { item: CustomJoke | SampleJoke }) => (
|
return (
|
||||||
<View style={styles.rowContainer}>
|
<View style={styles.rowContainer}>
|
||||||
<View style={styles.color}/>
|
<View style={styles.color}/>
|
||||||
<Image source={{ uri: item.image }} style={styles.image} />
|
<Image source={{ uri: prop.joke.image }} style={styles.image} />
|
||||||
<View style={styles.columnContainer}>
|
<View style={styles.columnContainer}>
|
||||||
<Text style={styles.text}>Résumé de la blague</Text>
|
<Text style={styles.text}>Résumé de la blague</Text>
|
||||||
<Text style={styles.text}>{item.description()}</Text>
|
<Text style={styles.text}>{prop.joke.description()}</Text>
|
||||||
<View style={styles.bottomContainer}>
|
<View style={styles.bottomContainer}>
|
||||||
<Text style={{color:'white'}}>{item.type}</Text>
|
<Text style={{color:'white'}}>{prop.joke.type}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
|
||||||
<FlatList
|
|
||||||
data={props.jokes}
|
|
||||||
keyExtractor={(item) => item.id.toString()}
|
|
||||||
renderItem={renderItem}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
@ -0,0 +1,22 @@
|
|||||||
|
import {FlatList} from 'react-native';
|
||||||
|
import {SampleJoke} from "../model/SampleJoke";
|
||||||
|
import {CustomJoke} from "../model/CustomJoke";
|
||||||
|
import JokeHomeSquare from "./JokeHomeSquare";
|
||||||
|
|
||||||
|
type JokeListItemProps = {
|
||||||
|
jokes: (CustomJoke | SampleJoke)[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function JokeListHomeSquare(props: JokeListItemProps) {
|
||||||
|
return (
|
||||||
|
<FlatList showsHorizontalScrollIndicator={false} horizontal={true}
|
||||||
|
data={props.jokes}
|
||||||
|
renderItem={
|
||||||
|
({ item }: { item: CustomJoke | SampleJoke }) => (
|
||||||
|
<JokeHomeSquare joke={item}/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
keyExtractor={(item) => item.id.toString()}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
import {FlatList} from 'react-native';
|
||||||
|
import {SampleJoke} from "../model/SampleJoke";
|
||||||
|
import {CustomJoke} from "../model/CustomJoke";
|
||||||
|
import JokeItem from "./JokeItem";
|
||||||
|
|
||||||
|
type JokeListItemProps = {
|
||||||
|
jokes: (CustomJoke | SampleJoke)[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function JokeListItem(props: JokeListItemProps) {
|
||||||
|
return (
|
||||||
|
<FlatList
|
||||||
|
data={props.jokes}
|
||||||
|
keyExtractor={(item) => item.id.toString()}
|
||||||
|
renderItem={
|
||||||
|
({ item }: { item: CustomJoke | SampleJoke }) => (
|
||||||
|
<JokeItem joke={item}/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
/**
|
||||||
|
* @file CustomJokeStub.ts
|
||||||
|
* @brief Exemple d'utilisation de la classe JokeFactory pour créer des blagues personnalisées.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { JokeFactory } from '../../model/JokeFactory';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Stub de blagues personnalisées créées à l'aide de la classe JokeFactory.
|
||||||
|
* @constant
|
||||||
|
* @type {CustomJoke[]}
|
||||||
|
*/
|
||||||
|
export const customJokeStub = JokeFactory.createCustomJokes('[{"id":"premier", "type":"custom", "setup":"one", "punchline":"y\'en a pas", "image":"https://placekitten.com/200/300"},{"id":"deuxieme", "type":"custom", "setup":"two","punchline":"y\'en a pas", "image":"https://placekitten.com/200/300"},{"id":"troisieme", "type":"Default", "setup":"three","punchline":"y\'en toujours a pas ;)", "image":"https://placekitten.com/200/300"},{"id":"quatrieme", "type":"custom bro", "setup":"four","punchline":"y\'en toujours toujours ap", "image":"https://placekitten.com/200/300"}]');
|
@ -0,0 +1,109 @@
|
|||||||
|
import { NavigationContainer } from '@react-navigation/native';
|
||||||
|
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
||||||
|
import {Image, SafeAreaView, View} from 'react-native';
|
||||||
|
|
||||||
|
import HomeScreen from "../screens/HomeScreen";
|
||||||
|
import Catalogue from "../screens/Catalogue";
|
||||||
|
import Favorites from "../screens/Favorites";
|
||||||
|
import Add from "../screens/AddScreen";
|
||||||
|
import Settings from "../screens/Settings";
|
||||||
|
|
||||||
|
import {darksalmonColor, greyColor, indigoColor, purpleColor} from "../assets/Theme";
|
||||||
|
|
||||||
|
|
||||||
|
export default function NavigationBar() {
|
||||||
|
const BottomTabNavigator = createBottomTabNavigator();
|
||||||
|
|
||||||
|
const homeIcon = require("../assets/home_icon.png");
|
||||||
|
const listIcon = require("../assets/list_icon.png");
|
||||||
|
const addIcon = require("../assets/add_icon.png");
|
||||||
|
const favoriteIcon = require("../assets/favorite_icon.png");
|
||||||
|
const settingsIcon = require("../assets/settings_icon.png");
|
||||||
|
|
||||||
|
return (
|
||||||
|
<NavigationContainer>
|
||||||
|
<BottomTabNavigator.Navigator initialRouteName="Accueil"
|
||||||
|
screenOptions={{
|
||||||
|
headerStyle: {
|
||||||
|
backgroundColor: indigoColor,
|
||||||
|
|
||||||
|
},
|
||||||
|
headerTitleStyle: {
|
||||||
|
color:darksalmonColor,
|
||||||
|
fontSize:24,
|
||||||
|
textAlign: "center",
|
||||||
|
paddingBottom:20,
|
||||||
|
},
|
||||||
|
headerTitleAlign: 'center',
|
||||||
|
tabBarShowLabel: false,
|
||||||
|
tabBarStyle: {
|
||||||
|
backgroundColor: indigoColor,
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<BottomTabNavigator.Screen name="Accueil" component={HomeScreen}
|
||||||
|
options={{
|
||||||
|
tabBarIcon: ({focused}) => (
|
||||||
|
<Image
|
||||||
|
source={homeIcon}
|
||||||
|
style={{
|
||||||
|
width: 30, height: 30,
|
||||||
|
tintColor: focused ? darksalmonColor : greyColor,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}}/>
|
||||||
|
<BottomTabNavigator.Screen name="Catalogue" component={Catalogue}
|
||||||
|
options={{
|
||||||
|
tabBarIcon: ({focused}) => (
|
||||||
|
<Image
|
||||||
|
source={listIcon}
|
||||||
|
style={{
|
||||||
|
width: 30, height: 30,
|
||||||
|
tintColor: focused ? darksalmonColor : greyColor,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}}/>
|
||||||
|
<BottomTabNavigator.Screen name="Ajouter" component={Add}
|
||||||
|
options={{
|
||||||
|
tabBarIcon: ({focused}) => (
|
||||||
|
<View style={{backgroundColor: greyColor, borderRadius: 5, padding: 10}}>
|
||||||
|
<Image
|
||||||
|
source={addIcon}
|
||||||
|
style={{
|
||||||
|
width: 20, height: 20,
|
||||||
|
tintColor: focused ? darksalmonColor : "black",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}}/>
|
||||||
|
<BottomTabNavigator.Screen name="Favoris" component={Favorites}
|
||||||
|
options={{
|
||||||
|
tabBarIcon: ({focused}) => (
|
||||||
|
<Image
|
||||||
|
source={favoriteIcon}
|
||||||
|
style={{
|
||||||
|
width: 30, height: 30,
|
||||||
|
tintColor: focused ? darksalmonColor : greyColor,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}}/>
|
||||||
|
<BottomTabNavigator.Screen name="Paramètres" component={Settings}
|
||||||
|
options={{
|
||||||
|
tabBarIcon: ({focused}) => (
|
||||||
|
<Image
|
||||||
|
source={settingsIcon}
|
||||||
|
style={{
|
||||||
|
width: 30, height: 30,
|
||||||
|
tintColor: focused ? darksalmonColor : greyColor,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}}/>
|
||||||
|
</BottomTabNavigator.Navigator>
|
||||||
|
</NavigationContainer>
|
||||||
|
)
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
import {createStackNavigator} from "@react-navigation/stack";
|
||||||
|
import Accueil from "../screens/HomeScreen";
|
||||||
|
import Catalogue from "../screens/Catalogue";
|
||||||
|
import Add from "../screens/AddScreen";
|
||||||
|
import Favorites from "../screens/Favorites";
|
||||||
|
import Settings from "../screens/Settings";
|
||||||
|
|
||||||
|
|
||||||
|
export default function StackNavigation() {
|
||||||
|
const Stack = createStackNavigator();
|
||||||
|
return (
|
||||||
|
<Stack.Navigator initialRouteName="Home">
|
||||||
|
<Stack.Screen name="Accueil" component={Accueil}/>
|
||||||
|
<Stack.Screen name="Catalogue" component={Catalogue}/>
|
||||||
|
<Stack.Screen name="Ajouter" component={Add}/>
|
||||||
|
<Stack.Screen name="Favoris" component={Favorites}/>
|
||||||
|
<Stack.Screen name="Paramètres" component={Settings}/>
|
||||||
|
</Stack.Navigator>
|
||||||
|
)
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
import { StatusBar } from 'expo-status-bar';
|
||||||
|
import { StyleSheet, Text, View } from 'react-native';
|
||||||
|
import { customJokeStub } from '../data/stub/CustomJokeStub';
|
||||||
|
import { sampleJokeStub } from '../data/stub/SampleJokeStub';
|
||||||
|
import { SafeAreaView } from 'react-native'
|
||||||
|
import JokeListItem from "../components/JokeListItem";
|
||||||
|
import '../types/extension';
|
||||||
|
import {darksalmonColor, indigoColor, purpleColor} from "../assets/Theme";
|
||||||
|
|
||||||
|
export default function Catalogue() {
|
||||||
|
const allJokes = [...customJokeStub, ...sampleJokeStub];
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<SafeAreaView style={styles.topSafeArea}/>
|
||||||
|
<SafeAreaView style={styles.container}>
|
||||||
|
<StatusBar style="light" />
|
||||||
|
<JokeListItem jokes={allJokes}/>
|
||||||
|
</SafeAreaView>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: purpleColor,
|
||||||
|
},
|
||||||
|
centered: {
|
||||||
|
color:darksalmonColor,
|
||||||
|
fontSize:24,
|
||||||
|
textAlign: "center",
|
||||||
|
paddingBottom:20,
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
backgroundColor: indigoColor
|
||||||
|
},
|
||||||
|
topSafeArea: {
|
||||||
|
flex: 0,
|
||||||
|
backgroundColor: indigoColor
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,41 @@
|
|||||||
|
import { StatusBar } from 'expo-status-bar';
|
||||||
|
import { StyleSheet, Text, View } from 'react-native';
|
||||||
|
import { customJokeStub } from '../data/stub/CustomJokeStub';
|
||||||
|
import { sampleJokeStub } from '../data/stub/SampleJokeStub';
|
||||||
|
import { SafeAreaView } from 'react-native'
|
||||||
|
import JokeListItem from "../components/JokeListItem";
|
||||||
|
import '../types/extension';
|
||||||
|
import {darksalmonColor, indigoColor, purpleColor} from "../assets/Theme";
|
||||||
|
|
||||||
|
export default function Catalogue() {
|
||||||
|
const allJokes = [...customJokeStub, ...sampleJokeStub];
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<SafeAreaView style={styles.topSafeArea}/>
|
||||||
|
<SafeAreaView style={styles.container}>
|
||||||
|
<StatusBar style="light" />
|
||||||
|
<JokeListItem jokes={allJokes}/>
|
||||||
|
</SafeAreaView>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: purpleColor,
|
||||||
|
},
|
||||||
|
centered: {
|
||||||
|
color:darksalmonColor,
|
||||||
|
fontSize:24,
|
||||||
|
textAlign: "center",
|
||||||
|
paddingBottom:20,
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
backgroundColor: indigoColor
|
||||||
|
},
|
||||||
|
topSafeArea: {
|
||||||
|
flex: 0,
|
||||||
|
backgroundColor: indigoColor
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,89 @@
|
|||||||
|
import { StatusBar } from 'expo-status-bar';
|
||||||
|
import {FlatList, Image, StyleSheet, Text, View} from 'react-native';
|
||||||
|
import { customJokeStub } from '../data/stub/CustomJokeStub';
|
||||||
|
import { sampleJokeStub } from '../data/stub/SampleJokeStub';
|
||||||
|
import { SafeAreaView } from 'react-native'
|
||||||
|
import JokeListItem from "../components/JokeListItem";
|
||||||
|
import '../types/extension';
|
||||||
|
import {darksalmonColor, indigoColor, purpleColor, whiteColor} from "../assets/Theme";
|
||||||
|
import JokeListHomeSquare from "../components/JokeListHomeSquare";
|
||||||
|
import CategList from "../components/CategList";
|
||||||
|
import {CustomJoke} from "../model/CustomJoke";
|
||||||
|
import {SampleJoke} from "../model/SampleJoke";
|
||||||
|
|
||||||
|
export default function Catalogue() {
|
||||||
|
const allJokes = [...customJokeStub, ...sampleJokeStub];
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<View style={styles.container}>
|
||||||
|
<View style={styles.top}>
|
||||||
|
<Image style={styles.cat} source={require('../assets/logo.png')}/>
|
||||||
|
<Text style={styles.textAccueil}>Chat C'est Drôle</Text>
|
||||||
|
</View>
|
||||||
|
<View style={styles.Jokes}>
|
||||||
|
<Text style={styles.textLastJokes}>Dernières blagues</Text>
|
||||||
|
<JokeListHomeSquare jokes={allJokes} />
|
||||||
|
</View>
|
||||||
|
<View style={styles.bestCateg}>
|
||||||
|
<View style={styles.horizBestCateg}>
|
||||||
|
<Text style={styles.textBestCateg}>Top Categories</Text>
|
||||||
|
<Image source={require("../assets/fire_icon.png")}/>
|
||||||
|
</View>
|
||||||
|
<View style={styles.horizChip}>
|
||||||
|
<CategList jokes={allJokes}/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
backgroundColor: purpleColor,
|
||||||
|
flex:1,
|
||||||
|
},
|
||||||
|
top: {
|
||||||
|
alignItems: "center",
|
||||||
|
},
|
||||||
|
cat: {
|
||||||
|
height:160,
|
||||||
|
width: 160
|
||||||
|
},
|
||||||
|
textAccueil: {
|
||||||
|
fontSize: 25,
|
||||||
|
color: darksalmonColor,
|
||||||
|
fontWeight: "bold",
|
||||||
|
},
|
||||||
|
Jokes: {
|
||||||
|
display:"flex",
|
||||||
|
flexDirection:"column",
|
||||||
|
marginTop: 50,
|
||||||
|
marginLeft: 20,
|
||||||
|
},
|
||||||
|
scrollList: {
|
||||||
|
alignItems: "center"
|
||||||
|
},
|
||||||
|
textLastJokes: {
|
||||||
|
color: whiteColor,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: "bold",
|
||||||
|
},
|
||||||
|
bestCateg: {
|
||||||
|
marginTop: 30,
|
||||||
|
marginLeft: 20,
|
||||||
|
},
|
||||||
|
horizBestCateg: {
|
||||||
|
flexDirection: "row",
|
||||||
|
},
|
||||||
|
textBestCateg: {
|
||||||
|
color: whiteColor,
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: "bold",
|
||||||
|
},
|
||||||
|
horizChip: {
|
||||||
|
flexDirection: "row",
|
||||||
|
marginTop: 30,
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
@ -0,0 +1,41 @@
|
|||||||
|
import { StatusBar } from 'expo-status-bar';
|
||||||
|
import { StyleSheet, Text, View } from 'react-native';
|
||||||
|
import { customJokeStub } from '../data/stub/CustomJokeStub';
|
||||||
|
import { sampleJokeStub } from '../data/stub/SampleJokeStub';
|
||||||
|
import { SafeAreaView } from 'react-native'
|
||||||
|
import JokeListItem from "../components/JokeListItem";
|
||||||
|
import '../types/extension';
|
||||||
|
import {darksalmonColor, indigoColor, purpleColor} from "../assets/Theme";
|
||||||
|
|
||||||
|
export default function Catalogue() {
|
||||||
|
const allJokes = [...customJokeStub, ...sampleJokeStub];
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<SafeAreaView style={styles.topSafeArea}/>
|
||||||
|
<SafeAreaView style={styles.container}>
|
||||||
|
<StatusBar style="light" />
|
||||||
|
<JokeListItem jokes={allJokes}/>
|
||||||
|
</SafeAreaView>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: purpleColor,
|
||||||
|
},
|
||||||
|
centered: {
|
||||||
|
color:darksalmonColor,
|
||||||
|
fontSize:24,
|
||||||
|
textAlign: "center",
|
||||||
|
paddingBottom:20,
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
backgroundColor: indigoColor
|
||||||
|
},
|
||||||
|
topSafeArea: {
|
||||||
|
flex: 0,
|
||||||
|
backgroundColor: indigoColor
|
||||||
|
}
|
||||||
|
});
|
@ -1,35 +0,0 @@
|
|||||||
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
|
|
||||||
|
|
||||||
# dependencies
|
|
||||||
node_modules/
|
|
||||||
|
|
||||||
# Expo
|
|
||||||
.expo/
|
|
||||||
dist/
|
|
||||||
web-build/
|
|
||||||
|
|
||||||
# Native
|
|
||||||
*.orig.*
|
|
||||||
*.jks
|
|
||||||
*.p8
|
|
||||||
*.p12
|
|
||||||
*.key
|
|
||||||
*.mobileprovision
|
|
||||||
|
|
||||||
# Metro
|
|
||||||
.metro-health-check*
|
|
||||||
|
|
||||||
# debug
|
|
||||||
npm-debug.*
|
|
||||||
yarn-debug.*
|
|
||||||
yarn-error.*
|
|
||||||
|
|
||||||
# macOS
|
|
||||||
.DS_Store
|
|
||||||
*.pem
|
|
||||||
|
|
||||||
# local env files
|
|
||||||
.env*.local
|
|
||||||
|
|
||||||
# typescript
|
|
||||||
*.tsbuildinfo
|
|
@ -1,7 +0,0 @@
|
|||||||
import HomePage from './screens/HomeScreen';
|
|
||||||
|
|
||||||
export default function App() {
|
|
||||||
return (
|
|
||||||
<HomePage />
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file CustomJokeStub.ts
|
|
||||||
* @brief Exemple d'utilisation de la classe JokeFactory pour créer des blagues personnalisées.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { JokeFactory } from '../../model/JokeFactory';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Stub de blagues personnalisées créées à l'aide de la classe JokeFactory.
|
|
||||||
* @constant
|
|
||||||
* @type {CustomJoke[]}
|
|
||||||
*/
|
|
||||||
export const customJokeStub = JokeFactory.createCustomJokes('[{"id":"1", "type":"custom", "setup":"one", "punchline":"y\'en a pas", "image":"https://placekitten.com/200/300"},{"id":"2", "type":"custom", "setup":"two","punchline":"y\'en a pas", "image":"https://placekitten.com/200/300"},{"id":"3", "type":"Default", "setup":"three","punchline":"y\'en toujours a pas ;)", "image":"https://placekitten.com/200/300"},{"id":"4", "type":"custom bro", "setup":"four","punchline":"y\'en toujours toujours ap", "image":"https://placekitten.com/200/300"}]');
|
|