1
-
2
- import React , { useContext } from 'react' ;
3
- import { View , Text , Image , SafeAreaView , ScrollView , TouchableOpacity , Pressable } from 'react-native' ;
4
- import { router , useNavigation } from 'expo-router' ;
1
+ import React , { useContext , useState } from "react" ;
2
+ import {
3
+ View ,
4
+ Text ,
5
+ SafeAreaView ,
6
+ ScrollView ,
7
+ TouchableOpacity ,
8
+ Pressable ,
9
+ } from "react-native" ;
10
+ import { router } from "expo-router" ;
5
11
import FieldComponent from "@/components/FieldComponent" ;
6
- import ArticleCard from '@/components/cards/ArticleCard' ;
7
- import { articles } from "@/constants/Articles" ;
8
- import { Ionicons , MaterialCommunityIcons , MaterialIcons } from '@expo/vector-icons' ;
12
+ import ArticleCard from "@/components/cards/ArticleCard" ;
13
+ import {
14
+ Ionicons ,
15
+ MaterialCommunityIcons ,
16
+ MaterialIcons ,
17
+ } from "@expo/vector-icons" ;
9
18
import { ThemeContext } from "@/ctx/ThemeContext" ;
10
19
11
-
12
20
export default function SeeAllArticles ( ) {
13
21
const { theme, changeTheme } = useContext ( ThemeContext ) ;
22
+
14
23
return (
15
- < SafeAreaView style = { { paddingTop : 40 , backgroundColor : theme === "light" ? "#FFFFFF" : "#181A20" , height : "100%" } } >
24
+ < SafeAreaView
25
+ style = { {
26
+ paddingTop : 40 ,
27
+ backgroundColor : theme === "light" ? "#FFFFFF" : "#181A20" ,
28
+ height : "100%" ,
29
+ } }
30
+ >
16
31
< ScrollView showsVerticalScrollIndicator = { false } >
17
- < View style = { { display : "flex" , flexDirection : "row" , justifyContent : "space-between" } } >
18
- < View style = { { display : "flex" , flexDirection : "row" , gap : 15 , padding : 15 } } >
19
- < Pressable
20
- onPress = { ( ) => router . back ( ) }
32
+ < View
33
+ style = { {
34
+ display : "flex" ,
35
+ flexDirection : "row" ,
36
+ justifyContent : "space-between" ,
37
+ } }
38
+ >
39
+ < View
40
+ style = { {
41
+ display : "flex" ,
42
+ flexDirection : "row" ,
43
+ gap : 15 ,
44
+ padding : 15 ,
45
+ } }
46
+ >
47
+ < Pressable
48
+ onPress = { ( ) => router . back ( ) }
49
+ style = { {
50
+ paddingTop : 5 ,
51
+ } }
52
+ >
53
+ < MaterialIcons
54
+ name = "arrow-back"
55
+ size = { 23 }
21
56
style = { {
22
- paddingTop : 5
23
- } }
24
- > < MaterialIcons name = "arrow-back" size = { 23 } style = { {
25
57
alignSelf : "center" ,
26
- color : theme === 'light' ? '#212121' : '#FFFFFF' ,
27
- } } />
28
- </ Pressable >
29
- < Text style = { { fontSize : 24 , color : theme === 'light' ? '#212121' : '#FFFFFF' , } } > Articles</ Text >
58
+ color : theme === "light" ? "#212121" : "#FFFFFF" ,
59
+ } }
60
+ />
61
+ </ Pressable >
62
+ < Text
63
+ style = { {
64
+ fontSize : 24 ,
65
+ color : theme === "light" ? "#212121" : "#FFFFFF" ,
66
+ } }
67
+ >
68
+ Articles
69
+ </ Text >
30
70
</ View >
31
- < View style = { { display : "flex" , flexDirection : "row" , gap : 15 , padding : 15 } } >
71
+ < View
72
+ style = { {
73
+ display : "flex" ,
74
+ flexDirection : "row" ,
75
+ gap : 15 ,
76
+ padding : 15 ,
77
+ } }
78
+ >
32
79
< TouchableOpacity >
33
- < Ionicons name = "search-outline" size = { 24 } style = { { color : theme === 'light' ? "#212121" : '#FFFFFF' } } />
34
- </ TouchableOpacity >
80
+ < Ionicons
81
+ name = "search-outline"
82
+ size = { 24 }
83
+ style = { { color : theme === "light" ? "#212121" : "#FFFFFF" } }
84
+ />
85
+ </ TouchableOpacity >
86
+
35
87
< TouchableOpacity >
36
- < MaterialCommunityIcons name = "dots-horizontal-circle-outline" size = { 24 } style = { { color : theme === 'light' ? "#212121" : '#FFFFFF' } } />
37
- </ TouchableOpacity >
88
+ < MaterialCommunityIcons
89
+ name = "dots-horizontal-circle-outline"
90
+ size = { 24 }
91
+ style = { { color : theme === "light" ? "#212121" : "#FFFFFF" } }
92
+ />
93
+ </ TouchableOpacity >
38
94
</ View >
39
95
</ View >
40
- < View style = { { padding :5 } } >
41
- < FieldComponent />
42
-
96
+ < View style = { { padding : 5 } } >
97
+ < FieldComponent />
43
98
</ View >
44
-
45
-
46
- < ScrollView style = { { marginTop :10 } } showsVerticalScrollIndicator = { false } >
47
- { articles . map ( ( article , index ) => < ArticleCard key = { index } article = { article } /> ) }
99
+
100
+ < ScrollView
101
+ style = { { marginTop : 10 } }
102
+ showsVerticalScrollIndicator = { false }
103
+ >
104
+ < ArticleCard />
48
105
</ ScrollView >
49
106
</ ScrollView >
50
107
</ SafeAreaView >
51
108
) ;
52
- }
109
+ }
0 commit comments