Update UI of the part2

Merge pull request 'update UI' (#2) from part2 into master
Reviewed-on: #2
pull/5/head^2
Antoine PEREDERII 1 year ago
commit dab1695919

@ -2,6 +2,7 @@ import {StyleSheet, Text, View, FlatList, Image} from 'react-native';
import {SampleJoke} from "../model/SampleJoke";
import {CustomJoke} from "../model/CustomJoke";
import {darksalmonColor, whiteColor, greyColor, indigoColor} from "../assets/Theme";
import {Colors} from "react-native/Libraries/NewAppScreen";
type JokeListItemProps = {
jokes: CustomJoke[] | SampleJoke[];
@ -13,10 +14,10 @@ export default function JokeListItem(props: JokeListItemProps) {
<View style={styles.color}/>
<Image source={{ uri: item.image }} style={styles.image} />
<View style={styles.columnContainer}>
<Text style={styles.text}>{item.id}</Text>
<Text style={styles.text}>Résumé de la blague</Text>
<Text style={styles.text}>{item.description()}</Text>
<View style={styles.bottomContainer}>
<Text style={styles.text}>{item.type}</Text>
<Text style={{color:'white'}}>{item.type}</Text>
</View>
</View>
</View>
@ -67,11 +68,14 @@ const styles = StyleSheet.create({
color:whiteColor,
paddingBottom: 7,
paddingTop: 7,
fontSize: 16,
},
bottomContainer: {
backgroundColor: greyColor,
width:"auto",
height: 15,
borderRadius: 5
paddingVertical: 5,
paddingHorizontal: 10,
borderRadius: 20,
width : 150,
alignItems : 'center'
}
});

@ -41,12 +41,4 @@ export class CustomJoke extends Joke {
set id(id: string) {
this._id = id;
}
/**
* @brief Obtient une description textuelle de la blague.
* @return {string} La description de la blague.
*/
description(): string {
return `ID: ${this.id}, Setup: ${this.setup}, Punchline: ${this.punchline}`;
}
}
}

@ -104,6 +104,6 @@ export abstract class Joke {
* @return {string} Une description textuelle de la blague.
*/
public description(): string {
return this.type + this.summary;
return this.type + this.summary();
}
}

@ -41,12 +41,4 @@ export class SampleJoke extends Joke {
set id(id: number) {
this._id = id;
}
/**
* @brief Obtient une description textuelle de la blague d'échantillon.
* @return {string} Une description textuelle de la blague d'échantillon.
*/
description(): string {
return `ID: ${this.id}, Setup: ${this.setup}, Punchline: ${this.punchline}`;
}
}
Loading…
Cancel
Save