-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 🎸 je consulte le détail d'un article (#72)
* feat: 🎸 je consulte le détail d'un article ✅ Closes: #28 * refactor: 💡 PR 🎸 je consulte le détail d'un article Co-authored-by: Benjamin Guedj <benjaminguedj@hotmail.fr>
- Loading branch information
Showing
9 changed files
with
186 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import type { FC } from "react"; | ||
import * as React from "react"; | ||
import { StyleSheet, Text } from "react-native"; | ||
import { Image } from "react-native-elements"; | ||
|
||
import { View } from "../components/Themed"; | ||
import Colors from "../constants/Colors"; | ||
|
||
const Article: FC = () => { | ||
const screenTitle = "Nom de l'étape"; | ||
const description = | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; | ||
const article = { | ||
description: | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", | ||
imageUrl: | ||
"https://raw.githubusercontent.com/koehlersimon/fallback/master/Resources/Public/Images/placeholder.jpg", | ||
name: "Lorem ipsum dolor sit", | ||
}; | ||
|
||
return ( | ||
<View style={[styles.mainContainer]}> | ||
<View> | ||
<Text style={[styles.title]}>{screenTitle}</Text> | ||
<Text style={[styles.description]}>{description}</Text> | ||
</View> | ||
<View> | ||
<Image | ||
source={{ uri: article.imageUrl }} | ||
style={[styles.articleImage]} | ||
/> | ||
<Text style={[styles.title]}>{article.name}</Text> | ||
<Text>{article.description}</Text> | ||
</View> | ||
</View> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
articleImage: { | ||
height: 150, | ||
marginBottom: 15, | ||
marginTop: 15, | ||
width: "100%", | ||
}, | ||
description: { | ||
color: Colors.textColor, | ||
}, | ||
mainContainer: { | ||
padding: 15, | ||
}, | ||
title: { | ||
color: Colors.primaryColor, | ||
fontSize: 15, | ||
fontWeight: "bold", | ||
marginBottom: 10, | ||
}, | ||
}); | ||
|
||
export default Article; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import type { StackNavigationProp } from "@react-navigation/stack"; | ||
import type { FC } from "react"; | ||
import * as React from "react"; | ||
import { StyleSheet, Text } from "react-native"; | ||
import { Image, ListItem } from "react-native-elements"; | ||
|
||
import { View } from "../components/Themed"; | ||
import Colors from "../constants/Colors"; | ||
import type { TabHomeParamList } from "../types"; | ||
|
||
interface Props { | ||
navigation: StackNavigationProp<TabHomeParamList, "listArticles">; | ||
} | ||
|
||
const ListArticles: FC<Props> = ({ navigation }) => { | ||
const screenTitle = "Nom de l'étape"; | ||
const description = | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; | ||
const articles = [ | ||
{ | ||
imageUrl: | ||
"https://raw.githubusercontent.com/koehlersimon/fallback/master/Resources/Public/Images/placeholder.jpg", | ||
name: "Lorem ipsum dolor sit", | ||
subtitle: | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", | ||
}, | ||
{ | ||
imageUrl: | ||
"https://raw.githubusercontent.com/koehlersimon/fallback/master/Resources/Public/Images/placeholder.jpg", | ||
name: "Lorem ipsum dolor sit amet", | ||
subtitle: | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", | ||
}, | ||
{ | ||
imageUrl: | ||
"https://raw.githubusercontent.com/koehlersimon/fallback/master/Resources/Public/Images/placeholder.jpg", | ||
name: "Lorem ipsum dolor sit", | ||
subtitle: | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", | ||
}, | ||
]; | ||
|
||
return ( | ||
<View style={[styles.mainContainer]}> | ||
<View> | ||
<Text style={[styles.title]}>{screenTitle}</Text> | ||
<Text style={[styles.description]}>{description}</Text> | ||
</View> | ||
<View> | ||
{articles.map((article, index) => ( | ||
<ListItem | ||
key={index} | ||
bottomDivider | ||
onPress={() => { | ||
navigation.navigate("article"); | ||
}} | ||
> | ||
<Image | ||
source={{ uri: article.imageUrl }} | ||
style={{ height: 100, width: 100 }} | ||
/> | ||
<ListItem.Content> | ||
<ListItem.Title style={[styles.articleTitle]}> | ||
{article.name} | ||
</ListItem.Title> | ||
<ListItem.Subtitle style={[styles.articleDescription]}> | ||
{article.subtitle} | ||
</ListItem.Subtitle> | ||
</ListItem.Content> | ||
</ListItem> | ||
))} | ||
</View> | ||
</View> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
articleDescription: { | ||
color: Colors.textColor, | ||
}, | ||
articleTitle: { | ||
color: Colors.primaryColor, | ||
fontSize: 15, | ||
}, | ||
description: { | ||
color: Colors.textColor, | ||
}, | ||
mainContainer: { | ||
padding: 15, | ||
}, | ||
title: { | ||
color: Colors.primaryColor, | ||
fontSize: 18, | ||
fontWeight: "bold", | ||
marginBottom: 10, | ||
}, | ||
}); | ||
|
||
export default ListArticles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters