|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+import React, { useState } from 'react';
|
|
|
2
|
+import { View, StyleSheet, TextInput, Text, ScrollView } from 'react-native';
|
|
|
3
|
+import { Appbar, Menu, Avatar, useTheme, Button } from 'react-native-paper';
|
|
|
4
|
+import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
|
5
|
+import dpuser from "@/assets/images/userdp.png";
|
|
|
6
|
+
|
|
|
7
|
+const Request = () => {
|
|
|
8
|
+ const { colors, fonts } = useTheme();
|
|
|
9
|
+ const [menuVisible, setMenuVisible] = useState(false);
|
|
|
10
|
+ const [searchInput, setSearchInput] = useState("")
|
|
|
11
|
+
|
|
|
12
|
+ const renderNotificationAction = () => {
|
|
|
13
|
+ return (
|
|
|
14
|
+ <View style={{marginBottom:30, borderBottomWidth:1, paddingBottom:15, borderBottomColor:"rgba(57, 104, 104, 0.3)"}}>
|
|
|
15
|
+ <View style={{ flexDirection: "row", marginBottom: 10 }}>
|
|
|
16
|
+ <Avatar.Image size={60} source={dpuser}></Avatar.Image>
|
|
|
17
|
+ <View style={{ flex: 1, justifyContent: "center", paddingStart: 15, position:"relative", justifyContent:"space-evenly" }}>
|
|
|
18
|
+ <Text style={{ fontWeight: "700", position:"absolute", top:5, right:0, color:"rgba(0,0,0,0.3)" }}>7:55AM</Text>
|
|
|
19
|
+ <Text style={{ fontWeight: "700" }}>Invest Pahang</Text>
|
|
|
20
|
+ <Text style={{ fontWeight: "700" }}>ID No : Ariffudin@PSK</Text>
|
|
|
21
|
+ </View>
|
|
|
22
|
+ </View>
|
|
|
23
|
+ <Text style={{ fontWeight: "700", marginBottom:10 }}>Muhammad Ariffudin is working from home today</Text>
|
|
|
24
|
+ <View style={{flexDirection:"row", justifyContent:"space-evenly", gap:10}}>
|
|
|
25
|
+ <Button mode='outlined' style={{paddingHorizontal:35, borderColor:colors.primary }} onPress={()=>{console.log("click")}}>Reject</Button>
|
|
|
26
|
+ <Button mode='contained' style={{paddingHorizontal:35}} onPress={()=>{console.log("click")}}>Accept</Button>
|
|
|
27
|
+ </View>
|
|
|
28
|
+ </View>
|
|
|
29
|
+ )
|
|
|
30
|
+ }
|
|
|
31
|
+
|
|
|
32
|
+ const renderNotificationResult = (result) => {
|
|
|
33
|
+ return (
|
|
|
34
|
+ <View style={{marginBottom:30, borderBottomWidth:1, paddingBottom:15, borderBottomColor:"rgba(57, 104, 104, 0.3)"}}>
|
|
|
35
|
+ <View style={{ flexDirection: "row", marginBottom: 10 }}>
|
|
|
36
|
+ <Avatar.Image size={60} source={dpuser}></Avatar.Image>
|
|
|
37
|
+ <View style={{ flex: 1, justifyContent: "center", paddingStart: 15, position:"relative", justifyContent:"space-evenly" }}>
|
|
|
38
|
+ <Text style={{ fontWeight: "700", position:"absolute", top:5, right:0, color:"rgba(0,0,0,0.3)" }}>7:55AM</Text>
|
|
|
39
|
+ <Text style={{ fontWeight: "700" }}>Invest Pahang</Text>
|
|
|
40
|
+ <Text style={{ fontWeight: "700" }}>ID No : Ariffudin@PSK</Text>
|
|
|
41
|
+ </View>
|
|
|
42
|
+ </View>
|
|
|
43
|
+ <Text style={{ fontWeight: "700", marginBottom:10 }}>Muhammad Ariffudin is working from home today</Text>
|
|
|
44
|
+ <View style={{flexDirection:"row"}}>
|
|
|
45
|
+ {(result) ?
|
|
|
46
|
+ <Text style={[fonts.titleSmall, {color:colors.primary}]}><Icon name="done" size={20} style={{verticalAlign:"middle", marginEnd:10}} />Request Accepted</Text> :
|
|
|
47
|
+ <Text style={[fonts.titleSmall, {color:colors.error}]}><Icon name="close" size={20} style={{verticalAlign:"middle", marginEnd:10}} />Request Decline</Text>
|
|
|
48
|
+ }
|
|
|
49
|
+ </View>
|
|
|
50
|
+ </View>
|
|
|
51
|
+ )
|
|
|
52
|
+ }
|
|
|
53
|
+
|
|
|
54
|
+ return (
|
|
|
55
|
+ <View style={[styles.container, { backgroundColor: colors.background }]}>
|
|
|
56
|
+ <Appbar.Header>
|
|
|
57
|
+
|
|
|
58
|
+ <Avatar.Image size={50} source={dpuser}></Avatar.Image>
|
|
|
59
|
+
|
|
|
60
|
+ <View style={styles.titleContainer}>
|
|
|
61
|
+ <Appbar.Content title="Request" titleStyle={[fonts.titleLarge, styles.title]} />
|
|
|
62
|
+ </View>
|
|
|
63
|
+
|
|
|
64
|
+ {/* Menu Component */}
|
|
|
65
|
+ <Menu
|
|
|
66
|
+ visible={menuVisible}
|
|
|
67
|
+ onDismiss={() => setMenuVisible(false)}
|
|
|
68
|
+ anchor={
|
|
|
69
|
+ <Appbar.Action icon="dots-vertical" onPress={() => setMenuVisible(true)} />
|
|
|
70
|
+ }
|
|
|
71
|
+ >
|
|
|
72
|
+ <Menu.Item onPress={() => console.log('Profile Clicked')} title="Profile" />
|
|
|
73
|
+ <Menu.Item onPress={() => console.log('Settings Clicked')} title="Settings" />
|
|
|
74
|
+ <Menu.Item onPress={() => console.log('Logout Clicked')} title="Logout" />
|
|
|
75
|
+ </Menu>
|
|
|
76
|
+ </Appbar.Header>
|
|
|
77
|
+
|
|
|
78
|
+ <View style={styles.tabContainer}>
|
|
|
79
|
+ <Text style={[styles.tabButton, fonts.titleMedium, { fontWeight: "bold" }]}>General </Text>
|
|
|
80
|
+ <Text style={[styles.tabButton, fonts.titleMedium, { fontWeight: "bold" }, { borderBottomWidth: 2, borderBottomColor: colors.secondary, color: colors.secondary }]}>Request <Text style={styles.badge}>1</Text></Text>
|
|
|
81
|
+ </View>
|
|
|
82
|
+
|
|
|
83
|
+
|
|
|
84
|
+ <View style={styles.searchSection}>
|
|
|
85
|
+ <TextInput
|
|
|
86
|
+ style={styles.input}
|
|
|
87
|
+ placeholder="Search"
|
|
|
88
|
+ onChangeText={setSearchInput}
|
|
|
89
|
+ value={searchInput}
|
|
|
90
|
+ underlineColorAndroid="transparent"
|
|
|
91
|
+ placeholderTextColor="#D9D9D9"
|
|
|
92
|
+ />
|
|
|
93
|
+ <Icon name="search" size={20} color="#888" style={styles.icon} />
|
|
|
94
|
+ </View>
|
|
|
95
|
+
|
|
|
96
|
+ <View style={{flex:1}}>
|
|
|
97
|
+ <ScrollView>
|
|
|
98
|
+ {[1,2].map(() => renderNotificationAction())}
|
|
|
99
|
+ {[1].map(() => renderNotificationResult(true))}
|
|
|
100
|
+ {[1].map(() => renderNotificationResult(false))}
|
|
|
101
|
+ </ScrollView>
|
|
|
102
|
+ </View>
|
|
|
103
|
+
|
|
|
104
|
+ </View>
|
|
|
105
|
+ );
|
|
|
106
|
+};
|
|
|
107
|
+
|
|
|
108
|
+const styles = StyleSheet.create({
|
|
|
109
|
+ container: {
|
|
|
110
|
+ flex: 1,
|
|
|
111
|
+ padding: 20,
|
|
|
112
|
+ width: '100%',
|
|
|
113
|
+ },
|
|
|
114
|
+ badge: {
|
|
|
115
|
+ backgroundColor: "#BB5C3F",
|
|
|
116
|
+ color: "#FFF",
|
|
|
117
|
+ borderRadius: 100,
|
|
|
118
|
+ paddingVertical: 4,
|
|
|
119
|
+ paddingHorizontal: 6,
|
|
|
120
|
+ fontSize: 10,
|
|
|
121
|
+ fontWeight: "400",
|
|
|
122
|
+ verticalAlign: "middle",
|
|
|
123
|
+ marginStart: 5
|
|
|
124
|
+ },
|
|
|
125
|
+ tabContainer: {
|
|
|
126
|
+ flexDirection: "row",
|
|
|
127
|
+ marginBottom: 20
|
|
|
128
|
+ },
|
|
|
129
|
+ tabButton: {
|
|
|
130
|
+ fontWeight: "bold",
|
|
|
131
|
+ paddingVertical: 15,
|
|
|
132
|
+ width: "50%",
|
|
|
133
|
+ textAlign: "center",
|
|
|
134
|
+ active: {
|
|
|
135
|
+ borderBottomWidth: 2,
|
|
|
136
|
+ }
|
|
|
137
|
+ },
|
|
|
138
|
+ titleContainer: {
|
|
|
139
|
+ flex: 1,
|
|
|
140
|
+ alignItems: 'center',
|
|
|
141
|
+ },
|
|
|
142
|
+ title: {
|
|
|
143
|
+ fontWeight: 'bold',
|
|
|
144
|
+ },
|
|
|
145
|
+ searchSection: {
|
|
|
146
|
+ flexDirection: 'row',
|
|
|
147
|
+ justifyContent: 'center',
|
|
|
148
|
+ alignItems: 'center',
|
|
|
149
|
+ marginBottom: 20
|
|
|
150
|
+ },
|
|
|
151
|
+ icon: {
|
|
|
152
|
+ padding: 10,
|
|
|
153
|
+ position: "absolute",
|
|
|
154
|
+ right: 10,
|
|
|
155
|
+ color: "#D9D9D9"
|
|
|
156
|
+ },
|
|
|
157
|
+ input: {
|
|
|
158
|
+ height: 40,
|
|
|
159
|
+ flex: 1,
|
|
|
160
|
+ borderWidth: 1,
|
|
|
161
|
+ paddingVertical: 10,
|
|
|
162
|
+ paddingHorizontal: 20,
|
|
|
163
|
+ borderRadius: 100,
|
|
|
164
|
+ borderColor: "#C0CFD0"
|
|
|
165
|
+ }
|
|
|
166
|
+});
|
|
|
167
|
+
|
|
|
168
|
+export default Request;
|