@campxdev/react-native-blueprint 0.1.23 → 0.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/global.css +3 -3
- package/lib/global.css +1 -1
- package/lib/module/assets/icons/Image.png +0 -0
- package/lib/module/components/DataDisplay/Avatar/Avatar.js +1 -1
- package/lib/module/components/DataDisplay/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/DataDisplay/Banner/Banner.figma.js +17 -3
- package/lib/module/components/DataDisplay/Banner/Banner.figma.js.map +1 -1
- package/lib/module/components/DataDisplay/Banner/Banner.js +138 -34
- package/lib/module/components/DataDisplay/Banner/Banner.js.map +1 -1
- package/lib/module/components/DataDisplay/CalendarItem/CalendarItem.js +2 -2
- package/lib/module/components/DataDisplay/CalendarItem/CalendarItem.js.map +1 -1
- package/lib/module/components/DataDisplay/Card/Card.figma.js +11 -4
- package/lib/module/components/DataDisplay/Card/Card.figma.js.map +1 -1
- package/lib/module/components/DataDisplay/Card/Card.js +119 -65
- package/lib/module/components/DataDisplay/Card/Card.js.map +1 -1
- package/lib/module/components/DataDisplay/ChatBubble/ChatBubble.figma.js +54 -0
- package/lib/module/components/DataDisplay/ChatBubble/ChatBubble.figma.js.map +1 -0
- package/lib/module/components/DataDisplay/ChatBubble/ChatBubble.js +318 -0
- package/lib/module/components/DataDisplay/ChatBubble/ChatBubble.js.map +1 -0
- package/lib/module/components/DataDisplay/ChatBubble/index.js +4 -0
- package/lib/module/components/DataDisplay/ChatBubble/index.js.map +1 -0
- package/lib/module/components/DataDisplay/FeedCard/AttachmentDetails.js +69 -0
- package/lib/module/components/DataDisplay/FeedCard/AttachmentDetails.js.map +1 -0
- package/lib/module/components/DataDisplay/FeedCard/FeedCard.figma.js +19 -17
- package/lib/module/components/DataDisplay/FeedCard/FeedCard.figma.js.map +1 -1
- package/lib/module/components/DataDisplay/FeedCard/FeedCard.js +30 -19
- package/lib/module/components/DataDisplay/FeedCard/FeedCard.js.map +1 -1
- package/lib/module/components/DataDisplay/Greeting/Greeting.figma.js +5 -5
- package/lib/module/components/DataDisplay/Greeting/Greeting.figma.js.map +1 -1
- package/lib/module/components/DataDisplay/Greeting/Greeting.js +46 -70
- package/lib/module/components/DataDisplay/Greeting/Greeting.js.map +1 -1
- package/lib/module/components/DataDisplay/ProfileCard/ProfileCard.figma.js +16 -0
- package/lib/module/components/DataDisplay/ProfileCard/ProfileCard.figma.js.map +1 -0
- package/lib/module/components/DataDisplay/ProfileCard/ProfileCard.js +111 -0
- package/lib/module/components/DataDisplay/ProfileCard/ProfileCard.js.map +1 -0
- package/lib/module/components/DataDisplay/ProfileCard/index.js +4 -0
- package/lib/module/components/DataDisplay/ProfileCard/index.js.map +1 -0
- package/lib/module/components/Input/Button/Button.js +77 -129
- package/lib/module/components/Input/Button/Button.js.map +1 -1
- package/lib/module/components/Navigation/Appbar/AppBar.figma.js +18 -6
- package/lib/module/components/Navigation/Appbar/AppBar.figma.js.map +1 -1
- package/lib/module/components/Navigation/Appbar/AppBar.js +36 -9
- package/lib/module/components/Navigation/Appbar/AppBar.js.map +1 -1
- package/lib/module/components/Navigation/Popover/Popover.js +1 -1
- package/lib/module/components/Navigation/Popover/Popover.js.map +1 -1
- package/lib/module/components/ui/index.js +2 -0
- package/lib/module/components/ui/index.js.map +1 -1
- package/lib/module/lib/theme.js +2 -2
- package/lib/module/patterns/pattern-components/AccountPattern/AccountPattern.figma.js +196 -0
- package/lib/module/patterns/pattern-components/AccountPattern/AccountPattern.figma.js.map +1 -0
- package/lib/module/patterns/pattern-components/AccountPattern/AccountPattern.js +255 -0
- package/lib/module/patterns/pattern-components/AccountPattern/AccountPattern.js.map +1 -0
- package/lib/module/patterns/pattern-components/AccountPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/AccountPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/CalendarPattern/CalendarPattern.figma.js +1 -1
- package/lib/module/patterns/pattern-components/CardListPattern/CardListPattern.js +2 -4
- package/lib/module/patterns/pattern-components/CardListPattern/CardListPattern.js.map +1 -1
- package/lib/module/patterns/pattern-components/FeedPattern/FeedPattern.figma.js +144 -0
- package/lib/module/patterns/pattern-components/FeedPattern/FeedPattern.figma.js.map +1 -0
- package/lib/module/patterns/pattern-components/FeedPattern/FeedPattern.js +213 -0
- package/lib/module/patterns/pattern-components/FeedPattern/FeedPattern.js.map +1 -0
- package/lib/module/patterns/pattern-components/FeedPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/FeedPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.figma.js +70 -0
- package/lib/module/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.figma.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.js +260 -0
- package/lib/module/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeFacultyPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/HomeFacultyPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeParentPattern/HomeParentPattern.figma.js +82 -0
- package/lib/module/patterns/pattern-components/HomeParentPattern/HomeParentPattern.figma.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeParentPattern/HomeParentPattern.js +256 -0
- package/lib/module/patterns/pattern-components/HomeParentPattern/HomeParentPattern.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeParentPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/HomeParentPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.figma.js +73 -0
- package/lib/module/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.figma.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.js +283 -0
- package/lib/module/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.js.map +1 -0
- package/lib/module/patterns/pattern-components/HomeStudentPattern/index.js +4 -0
- package/lib/module/patterns/pattern-components/HomeStudentPattern/index.js.map +1 -0
- package/lib/module/patterns/pattern-components/index.js +5 -0
- package/lib/module/patterns/pattern-components/index.js.map +1 -1
- package/package.json +27 -1
- package/src/assets/icons/Image.png +0 -0
- package/src/components/DataDisplay/Avatar/Avatar.tsx +24 -21
- package/src/components/DataDisplay/Banner/Banner.figma.tsx +18 -3
- package/src/components/DataDisplay/Banner/Banner.tsx +153 -26
- package/src/components/DataDisplay/CalendarItem/CalendarItem.tsx +2 -2
- package/src/components/DataDisplay/Card/Card.figma.tsx +7 -3
- package/src/components/DataDisplay/Card/Card.tsx +152 -101
- package/src/components/DataDisplay/ChatBubble/ChatBubble.figma.tsx +54 -0
- package/src/components/DataDisplay/ChatBubble/ChatBubble.tsx +404 -0
- package/src/components/DataDisplay/ChatBubble/index.ts +8 -0
- package/src/components/DataDisplay/FeedCard/AttachmentDetails.tsx +96 -0
- package/src/components/DataDisplay/FeedCard/FeedCard.figma.tsx +17 -15
- package/src/components/DataDisplay/FeedCard/FeedCard.tsx +66 -35
- package/src/components/DataDisplay/Greeting/Greeting.figma.tsx +5 -5
- package/src/components/DataDisplay/Greeting/Greeting.tsx +58 -96
- package/src/components/DataDisplay/ProfileCard/ProfileCard.figma.tsx +17 -0
- package/src/components/DataDisplay/ProfileCard/ProfileCard.tsx +173 -0
- package/src/components/DataDisplay/ProfileCard/index.ts +1 -0
- package/src/components/Input/Button/Button.tsx +71 -157
- package/src/components/Navigation/Appbar/AppBar.figma.tsx +18 -6
- package/src/components/Navigation/Appbar/AppBar.tsx +58 -13
- package/src/components/Navigation/Popover/Popover.tsx +3 -3
- package/src/components/ui/index.ts +2 -0
- package/src/lib/theme.ts +2 -2
- package/src/patterns/pattern-components/AccountPattern/AccountPattern.figma.tsx +193 -0
- package/src/patterns/pattern-components/AccountPattern/AccountPattern.tsx +301 -0
- package/src/patterns/pattern-components/AccountPattern/index.ts +1 -0
- package/src/patterns/pattern-components/CalendarPattern/CalendarPattern.figma.tsx +1 -1
- package/src/patterns/pattern-components/CardListPattern/CardListPattern.tsx +4 -9
- package/src/patterns/pattern-components/FeedPattern/FeedPattern.figma.tsx +146 -0
- package/src/patterns/pattern-components/FeedPattern/FeedPattern.tsx +264 -0
- package/src/patterns/pattern-components/FeedPattern/index.ts +2 -0
- package/src/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.figma.tsx +66 -0
- package/src/patterns/pattern-components/HomeFacultyPattern/HomeFacultyPattern.tsx +326 -0
- package/src/patterns/pattern-components/HomeFacultyPattern/index.ts +2 -0
- package/src/patterns/pattern-components/HomeParentPattern/HomeParentPattern.figma.tsx +75 -0
- package/src/patterns/pattern-components/HomeParentPattern/HomeParentPattern.tsx +328 -0
- package/src/patterns/pattern-components/HomeParentPattern/index.ts +2 -0
- package/src/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.figma.tsx +66 -0
- package/src/patterns/pattern-components/HomeStudentPattern/HomeStudentPattern.tsx +355 -0
- package/src/patterns/pattern-components/HomeStudentPattern/index.ts +2 -0
- package/src/patterns/pattern-components/index.ts +5 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { View, ScrollView, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { FeedCard } from '../../../components/DataDisplay/FeedCard/FeedCard';
|
|
5
|
+
import { FloatingActionButton } from '../../../components/Navigation/FloatingAction/Floating-Action';
|
|
6
|
+
import {
|
|
7
|
+
ChipsRow,
|
|
8
|
+
type ChipItem,
|
|
9
|
+
} from '../../../components/DataDisplay/ChipsRow/ChipsRow';
|
|
10
|
+
|
|
11
|
+
/* ============================================================================
|
|
12
|
+
* Types
|
|
13
|
+
* ============================================================================ */
|
|
14
|
+
|
|
15
|
+
export type FeedItem = {
|
|
16
|
+
id: string;
|
|
17
|
+
type: 'post' | 'announcement';
|
|
18
|
+
authorName: string;
|
|
19
|
+
postTitle: string;
|
|
20
|
+
subtitle?: string;
|
|
21
|
+
postContent?: string;
|
|
22
|
+
showMedia?: boolean;
|
|
23
|
+
showHeader?: boolean;
|
|
24
|
+
showPostContent?: boolean;
|
|
25
|
+
showBody?: boolean;
|
|
26
|
+
showBadges?: boolean;
|
|
27
|
+
showFooterActions?: boolean;
|
|
28
|
+
showLeading?: boolean;
|
|
29
|
+
showSubtitle?: boolean;
|
|
30
|
+
showSecondaryButton?: boolean;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type FeedChip = ChipItem;
|
|
34
|
+
|
|
35
|
+
export type FeedPatternProps = {
|
|
36
|
+
// Chips filter section
|
|
37
|
+
showChipsFilter?: boolean;
|
|
38
|
+
chips?: FeedChip[];
|
|
39
|
+
onChipSelect?: (chipId: string) => void;
|
|
40
|
+
|
|
41
|
+
// Feed items section
|
|
42
|
+
feedItems?: FeedItem[];
|
|
43
|
+
onFeedItemPress?: (itemId: string) => void;
|
|
44
|
+
|
|
45
|
+
// Floating Action Button
|
|
46
|
+
showFloatingActionButton?: boolean;
|
|
47
|
+
onFloatingActionPress?: () => void;
|
|
48
|
+
|
|
49
|
+
// Styling
|
|
50
|
+
style?: StyleProp<ViewStyle>;
|
|
51
|
+
testID?: string;
|
|
52
|
+
className?: never;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/* ============================================================================
|
|
56
|
+
* Component
|
|
57
|
+
* ============================================================================ */
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* FeedPattern Component
|
|
61
|
+
*
|
|
62
|
+
* A comprehensive feed layout pattern that displays:
|
|
63
|
+
* - Horizontal scrollable chips for filtering
|
|
64
|
+
* - Vertical scrollable feed of posts and announcements
|
|
65
|
+
* - Multiple FeedCard variations (with/without media, badges, footer actions)
|
|
66
|
+
* - Floating action button for creating new posts
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```tsx
|
|
70
|
+
* <FeedPattern
|
|
71
|
+
* showChipsFilter={true}
|
|
72
|
+
* showFloatingActionButton={true}
|
|
73
|
+
* feedItems={[...]}
|
|
74
|
+
* />
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export function FeedPattern({
|
|
78
|
+
// Chips filter section
|
|
79
|
+
showChipsFilter = true,
|
|
80
|
+
chips = [
|
|
81
|
+
{ id: '1', label: 'Announcements', state: 'selected' as const },
|
|
82
|
+
{ id: '2', label: 'Posts', state: 'default' as const },
|
|
83
|
+
{ id: '3', label: 'Events', state: 'default' as const },
|
|
84
|
+
{ id: '4', label: 'Updates', state: 'default' as const },
|
|
85
|
+
],
|
|
86
|
+
onChipSelect,
|
|
87
|
+
|
|
88
|
+
// Feed items section
|
|
89
|
+
feedItems = [
|
|
90
|
+
{
|
|
91
|
+
id: '1',
|
|
92
|
+
type: 'announcement',
|
|
93
|
+
authorName: 'Author Name',
|
|
94
|
+
postTitle: 'Post Title',
|
|
95
|
+
subtitle: 'Subtitle of the card goes here',
|
|
96
|
+
postContent:
|
|
97
|
+
'The card may contain body content which can be truncated to 1-2 lines. Swap Content in Props.',
|
|
98
|
+
showHeader: true,
|
|
99
|
+
showPostContent: true,
|
|
100
|
+
showBody: true,
|
|
101
|
+
showBadges: true,
|
|
102
|
+
showFooterActions: true,
|
|
103
|
+
showLeading: true,
|
|
104
|
+
showSubtitle: true,
|
|
105
|
+
showSecondaryButton: true,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
id: '2',
|
|
109
|
+
type: 'post',
|
|
110
|
+
authorName: 'Author Name',
|
|
111
|
+
postTitle: 'Post Title',
|
|
112
|
+
subtitle: 'Subtitle of the card goes here',
|
|
113
|
+
postContent:
|
|
114
|
+
'The card may contain body content which can be truncated to 1-2 lines. Swap Content in Props.',
|
|
115
|
+
showMedia: true,
|
|
116
|
+
showHeader: true,
|
|
117
|
+
showPostContent: true,
|
|
118
|
+
showBadges: true,
|
|
119
|
+
showLeading: true,
|
|
120
|
+
showSubtitle: true,
|
|
121
|
+
showSecondaryButton: true,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: '3',
|
|
125
|
+
type: 'announcement',
|
|
126
|
+
authorName: 'Author Name',
|
|
127
|
+
postTitle: 'Post Title',
|
|
128
|
+
subtitle: 'Subtitle of the card goes here',
|
|
129
|
+
postContent:
|
|
130
|
+
'The card may contain body content which can be truncated to 1-2 lines. Swap Content in Props.',
|
|
131
|
+
showPostContent: true,
|
|
132
|
+
showBody: true,
|
|
133
|
+
showLeading: true,
|
|
134
|
+
showSubtitle: true,
|
|
135
|
+
showSecondaryButton: true,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: '4',
|
|
139
|
+
type: 'post',
|
|
140
|
+
authorName: 'Author Name',
|
|
141
|
+
postTitle: 'Post Title',
|
|
142
|
+
subtitle: 'Subtitle of the card goes here',
|
|
143
|
+
postContent:
|
|
144
|
+
'The card may contain body content which can be truncated to 1-2 lines. Swap Content in Props.',
|
|
145
|
+
showMedia: true,
|
|
146
|
+
showHeader: true,
|
|
147
|
+
showBadges: true,
|
|
148
|
+
showLeading: true,
|
|
149
|
+
showSubtitle: true,
|
|
150
|
+
showSecondaryButton: true,
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
id: '5',
|
|
154
|
+
type: 'announcement',
|
|
155
|
+
authorName: 'Author Name',
|
|
156
|
+
postTitle: 'Post Title',
|
|
157
|
+
subtitle: 'Subtitle of the card goes here',
|
|
158
|
+
postContent:
|
|
159
|
+
'The card may contain body content which can be truncated to 1-2 lines. Swap Content in Props.',
|
|
160
|
+
showHeader: true,
|
|
161
|
+
showPostContent: true,
|
|
162
|
+
showBody: true,
|
|
163
|
+
showBadges: true,
|
|
164
|
+
showFooterActions: true,
|
|
165
|
+
showLeading: true,
|
|
166
|
+
showSubtitle: true,
|
|
167
|
+
showSecondaryButton: true,
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
id: '6',
|
|
171
|
+
type: 'post',
|
|
172
|
+
authorName: 'Author Name',
|
|
173
|
+
postTitle: 'Post Title',
|
|
174
|
+
subtitle: 'Subtitle of the card goes here',
|
|
175
|
+
postContent:
|
|
176
|
+
'The card may contain body content which can be truncated to 1-2 lines. Swap Content in Props.',
|
|
177
|
+
showMedia: true,
|
|
178
|
+
showHeader: true,
|
|
179
|
+
showPostContent: true,
|
|
180
|
+
showBody: true,
|
|
181
|
+
showBadges: true,
|
|
182
|
+
showFooterActions: true,
|
|
183
|
+
showLeading: true,
|
|
184
|
+
showSubtitle: true,
|
|
185
|
+
showSecondaryButton: true,
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
onFeedItemPress,
|
|
189
|
+
|
|
190
|
+
// Floating Action Button
|
|
191
|
+
showFloatingActionButton = true,
|
|
192
|
+
onFloatingActionPress,
|
|
193
|
+
|
|
194
|
+
// Styling
|
|
195
|
+
style,
|
|
196
|
+
testID,
|
|
197
|
+
}: FeedPatternProps) {
|
|
198
|
+
return (
|
|
199
|
+
<View
|
|
200
|
+
testID={testID ?? 'feed-pattern'}
|
|
201
|
+
style={[{ flex: 1, backgroundColor: '#f7f8fa' }, style]}
|
|
202
|
+
>
|
|
203
|
+
{/* Floating Action Button */}
|
|
204
|
+
{showFloatingActionButton && (
|
|
205
|
+
<View className="absolute bottom-8 right-5 z-50">
|
|
206
|
+
<FloatingActionButton
|
|
207
|
+
variant="default"
|
|
208
|
+
size="md"
|
|
209
|
+
onPress={onFloatingActionPress}
|
|
210
|
+
/>
|
|
211
|
+
</View>
|
|
212
|
+
)}
|
|
213
|
+
|
|
214
|
+
<ScrollView
|
|
215
|
+
showsVerticalScrollIndicator={false}
|
|
216
|
+
contentContainerStyle={{ paddingVertical: 20 }}
|
|
217
|
+
>
|
|
218
|
+
{/* Chips Filter Section */}
|
|
219
|
+
{showChipsFilter && chips.length > 0 && (
|
|
220
|
+
<View style={{ marginBottom: 16 }}>
|
|
221
|
+
<ChipsRow
|
|
222
|
+
chips={chips}
|
|
223
|
+
gap={8}
|
|
224
|
+
contentPadding={20}
|
|
225
|
+
showsScrollIndicator={false}
|
|
226
|
+
onChipPress={(chip) => onChipSelect?.(chip.id)}
|
|
227
|
+
/>
|
|
228
|
+
</View>
|
|
229
|
+
)}
|
|
230
|
+
|
|
231
|
+
{/* Feed Items Section */}
|
|
232
|
+
<View style={{ gap: 16, paddingHorizontal: 20 }}>
|
|
233
|
+
{feedItems.map((item) => (
|
|
234
|
+
<View key={item.id} onTouchEnd={() => onFeedItemPress?.(item.id)}>
|
|
235
|
+
<FeedCard
|
|
236
|
+
type={item.type}
|
|
237
|
+
authorName={item.authorName}
|
|
238
|
+
postTitle={item.postTitle}
|
|
239
|
+
subtitle={item.subtitle}
|
|
240
|
+
postContent={item.postContent}
|
|
241
|
+
showMedia={item.showMedia}
|
|
242
|
+
showHeader={item.showHeader}
|
|
243
|
+
showPostContent={item.showPostContent}
|
|
244
|
+
showBody={item.showBody}
|
|
245
|
+
showBadges={item.showBadges}
|
|
246
|
+
showFooterActions={item.showFooterActions}
|
|
247
|
+
showLeading={item.showLeading}
|
|
248
|
+
showSubtitle={item.showSubtitle}
|
|
249
|
+
showSecondaryButton={item.showSecondaryButton}
|
|
250
|
+
/>
|
|
251
|
+
</View>
|
|
252
|
+
))}
|
|
253
|
+
</View>
|
|
254
|
+
|
|
255
|
+
{/* Bottom Spacer */}
|
|
256
|
+
<View style={{ height: 150 }} />
|
|
257
|
+
</ScrollView>
|
|
258
|
+
</View>
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
FeedPattern.displayName = 'FeedPattern';
|
|
263
|
+
|
|
264
|
+
export type { FeedPatternProps };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { HomeFacultyPattern } from './HomeFacultyPattern';
|
|
3
|
+
|
|
4
|
+
const FIGMA_URL =
|
|
5
|
+
'https://www.figma.com/design/YTb27Onq7Zk8OV16fHptxJ/Campx-App?node-id=231-5885';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* HomeFacultyPattern - Faculty home screen layout pattern
|
|
9
|
+
*
|
|
10
|
+
* Use cases:
|
|
11
|
+
* - Faculty dashboard home screens
|
|
12
|
+
* - Educational app faculty portals
|
|
13
|
+
* - Instructor management interfaces
|
|
14
|
+
* - Faculty resource discovery screens
|
|
15
|
+
*
|
|
16
|
+
* Features:
|
|
17
|
+
* - Personalized greeting with schedule quick access
|
|
18
|
+
* - Action center for pending items, requests, and feedback
|
|
19
|
+
* - Next class preparation section with attendance marking
|
|
20
|
+
* - Quick access dashboard (Requests, My Kiosk, Mentees, New Post)
|
|
21
|
+
* - Campus life shortcuts (Clubs, Events)
|
|
22
|
+
* - Faculty announcements and updates feed
|
|
23
|
+
* - All sections are independently configurable
|
|
24
|
+
*
|
|
25
|
+
* Customization:
|
|
26
|
+
* - Show/hide individual sections
|
|
27
|
+
* - Customize titles, subtitles, and content
|
|
28
|
+
* - Configure button callbacks
|
|
29
|
+
* - Adapt data based on backend responses
|
|
30
|
+
*/
|
|
31
|
+
figma.connect(HomeFacultyPattern, FIGMA_URL, {
|
|
32
|
+
example: () => (
|
|
33
|
+
<HomeFacultyPattern
|
|
34
|
+
showGreeting={true}
|
|
35
|
+
greetingUserName="Mathers"
|
|
36
|
+
greetingText="Good Morning"
|
|
37
|
+
greetingSubtitle="You have 3 Classes today"
|
|
38
|
+
showScheduleButton={true}
|
|
39
|
+
showActionCenter={true}
|
|
40
|
+
actionCenterTitle="Action Center"
|
|
41
|
+
actionCenterSubtitle="Actions that need your attention"
|
|
42
|
+
actionCenterItems={[
|
|
43
|
+
'Class Reassignment Request',
|
|
44
|
+
'Pending Feedback Submission',
|
|
45
|
+
]}
|
|
46
|
+
showNextClass={true}
|
|
47
|
+
nextClassTitle="Microprocessors Lab"
|
|
48
|
+
nextClassTime="10:00 AM - 11:00 AM"
|
|
49
|
+
showMarkAttendanceButton={true}
|
|
50
|
+
showResourcesButton={true}
|
|
51
|
+
showQuickAccess={true}
|
|
52
|
+
quickAccessItems={[
|
|
53
|
+
{ title: 'Requests', subtitle: '1 Request Pending' },
|
|
54
|
+
{ title: 'My Kiosk', subtitle: 'Employee Portal' },
|
|
55
|
+
{ title: 'Mentees', subtitle: '12 Students' },
|
|
56
|
+
{ title: 'New Post', subtitle: 'Notice Board' },
|
|
57
|
+
]}
|
|
58
|
+
showCampusLife={true}
|
|
59
|
+
showAnnouncements={true}
|
|
60
|
+
announcementTitle="Faculty Development Program"
|
|
61
|
+
announcementAuthor="Admin"
|
|
62
|
+
announcementSubtitle="23 March, 2026 from 02:00 PM to 03:00 PM"
|
|
63
|
+
announcementContent="Examination Timetable has been updated and Published. Students are requested to register before 24th of this Month."
|
|
64
|
+
/>
|
|
65
|
+
),
|
|
66
|
+
});
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { View, ScrollView, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { Greeting } from '../../../components/DataDisplay/Greeting/Greeting';
|
|
5
|
+
import { Banner } from '../../../components/DataDisplay/Banner/Banner';
|
|
6
|
+
import { Card } from '../../../components/DataDisplay/Card/Card';
|
|
7
|
+
import { FeedCard } from '../../../components/DataDisplay/FeedCard/FeedCard';
|
|
8
|
+
import { Text } from '../../../components/Input/Text/Text';
|
|
9
|
+
import { Button } from '../../../components/Input/Button/Button';
|
|
10
|
+
|
|
11
|
+
/* ============================================================================
|
|
12
|
+
* Types
|
|
13
|
+
* ============================================================================ */
|
|
14
|
+
|
|
15
|
+
export type HomeFacultyPatternProps = {
|
|
16
|
+
// Header section
|
|
17
|
+
showGreeting?: boolean;
|
|
18
|
+
greetingUserName?: string;
|
|
19
|
+
greetingText?: string;
|
|
20
|
+
greetingSubtitle?: string;
|
|
21
|
+
showScheduleButton?: boolean;
|
|
22
|
+
onSchedulePress?: () => void;
|
|
23
|
+
|
|
24
|
+
// Action Center section
|
|
25
|
+
showActionCenter?: boolean;
|
|
26
|
+
actionCenterTitle?: string;
|
|
27
|
+
actionCenterSubtitle?: string;
|
|
28
|
+
actionCenterItems?: string[];
|
|
29
|
+
|
|
30
|
+
// Next Class section
|
|
31
|
+
showNextClass?: boolean;
|
|
32
|
+
nextClassTitle?: string;
|
|
33
|
+
nextClassTime?: string;
|
|
34
|
+
showMarkAttendanceButton?: boolean;
|
|
35
|
+
showResourcesButton?: boolean;
|
|
36
|
+
|
|
37
|
+
// Quick Access section
|
|
38
|
+
showQuickAccess?: boolean;
|
|
39
|
+
quickAccessItems?: Array<{
|
|
40
|
+
title: string;
|
|
41
|
+
subtitle: string;
|
|
42
|
+
}>;
|
|
43
|
+
|
|
44
|
+
// Campus Life section
|
|
45
|
+
showCampusLife?: boolean;
|
|
46
|
+
|
|
47
|
+
// Announcements section
|
|
48
|
+
showAnnouncements?: boolean;
|
|
49
|
+
announcementTitle?: string;
|
|
50
|
+
announcementAuthor?: string;
|
|
51
|
+
announcementSubtitle?: string;
|
|
52
|
+
announcementContent?: string;
|
|
53
|
+
|
|
54
|
+
// Styling
|
|
55
|
+
style?: StyleProp<ViewStyle>;
|
|
56
|
+
testID?: string;
|
|
57
|
+
className?: never;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/* ============================================================================
|
|
61
|
+
* Component
|
|
62
|
+
* ============================================================================ */
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* HomeFacultyPattern Component
|
|
66
|
+
*
|
|
67
|
+
* A comprehensive faculty home screen layout pattern that displays:
|
|
68
|
+
* - Personalized greeting with schedule quick access
|
|
69
|
+
* - Action center for pending items and requests
|
|
70
|
+
* - Next class preparation section with attendance marking
|
|
71
|
+
* - Quick access dashboard (Requests, My Kiosk, Mentees, New Post)
|
|
72
|
+
* - Campus life shortcuts (Clubs, Events)
|
|
73
|
+
* - Announcements feed for faculty updates
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```tsx
|
|
77
|
+
* <HomeFacultyPattern
|
|
78
|
+
* showGreeting={true}
|
|
79
|
+
* showActionCenter={true}
|
|
80
|
+
* showNextClass={true}
|
|
81
|
+
* showQuickAccess={true}
|
|
82
|
+
* showAnnouncements={true}
|
|
83
|
+
* />
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export function HomeFacultyPattern({
|
|
87
|
+
// Header section
|
|
88
|
+
showGreeting = true,
|
|
89
|
+
greetingUserName = 'Mathers',
|
|
90
|
+
greetingText = 'Good Morning',
|
|
91
|
+
greetingSubtitle = 'You have 3 Classes today',
|
|
92
|
+
_showScheduleButton = true,
|
|
93
|
+
onSchedulePress,
|
|
94
|
+
|
|
95
|
+
// Action Center section
|
|
96
|
+
showActionCenter = true,
|
|
97
|
+
actionCenterTitle = 'Action Center',
|
|
98
|
+
actionCenterSubtitle = 'Actions that need your attention',
|
|
99
|
+
actionCenterItems = [
|
|
100
|
+
'Class Reassignment Request',
|
|
101
|
+
'Pending Feedback Submission',
|
|
102
|
+
],
|
|
103
|
+
|
|
104
|
+
// Next Class section
|
|
105
|
+
showNextClass = true,
|
|
106
|
+
nextClassTitle = 'Microprocessors Lab',
|
|
107
|
+
nextClassTime = '10:00 AM - 11:00 AM',
|
|
108
|
+
showMarkAttendanceButton = true,
|
|
109
|
+
showResourcesButton = true,
|
|
110
|
+
|
|
111
|
+
// Quick Access section
|
|
112
|
+
showQuickAccess = true,
|
|
113
|
+
quickAccessItems = [
|
|
114
|
+
{ title: 'Requests', subtitle: '1 Request Pending' },
|
|
115
|
+
{ title: 'My Kiosk', subtitle: 'Employee Portal' },
|
|
116
|
+
{ title: 'Mentees', subtitle: '12 Students' },
|
|
117
|
+
{ title: 'New Post', subtitle: 'Notice Board' },
|
|
118
|
+
],
|
|
119
|
+
|
|
120
|
+
// Campus Life section
|
|
121
|
+
showCampusLife = true,
|
|
122
|
+
|
|
123
|
+
// Announcements section
|
|
124
|
+
showAnnouncements = true,
|
|
125
|
+
announcementTitle = 'Faculty Development Program',
|
|
126
|
+
announcementAuthor = 'Admin',
|
|
127
|
+
announcementSubtitle = '23 March, 2026 from 02:00 PM to 03:00 PM',
|
|
128
|
+
announcementContent = 'Examination Timetable has been updated and Published. Students are requested to register before 24th of this Month.',
|
|
129
|
+
|
|
130
|
+
// Styling
|
|
131
|
+
style,
|
|
132
|
+
testID,
|
|
133
|
+
}: HomeFacultyPatternProps) {
|
|
134
|
+
return (
|
|
135
|
+
<ScrollView
|
|
136
|
+
testID={testID ?? 'home-faculty-pattern'}
|
|
137
|
+
style={style}
|
|
138
|
+
className="flex-1 bg-surface-page"
|
|
139
|
+
showsVerticalScrollIndicator={false}
|
|
140
|
+
>
|
|
141
|
+
<View className="gap-8 py-5 px-5">
|
|
142
|
+
{/* Header Section: Greeting */}
|
|
143
|
+
{showGreeting && (
|
|
144
|
+
<View className="gap-4">
|
|
145
|
+
<Greeting
|
|
146
|
+
userName={greetingUserName}
|
|
147
|
+
greetingText={greetingText}
|
|
148
|
+
subtitle={greetingSubtitle}
|
|
149
|
+
ctaLayout="icon"
|
|
150
|
+
showNextUp={false}
|
|
151
|
+
onSchedulePress={onSchedulePress}
|
|
152
|
+
/>
|
|
153
|
+
</View>
|
|
154
|
+
)}
|
|
155
|
+
|
|
156
|
+
{/* Action Center Section */}
|
|
157
|
+
{showActionCenter && (
|
|
158
|
+
<View className="gap-4">
|
|
159
|
+
<Banner
|
|
160
|
+
style="solid"
|
|
161
|
+
title={actionCenterTitle}
|
|
162
|
+
subtitle={actionCenterSubtitle}
|
|
163
|
+
showBadge={true}
|
|
164
|
+
badge1Text={`${actionCenterItems.length}`}
|
|
165
|
+
actionItem1={actionCenterItems[0] || 'Class Reassignment Request'}
|
|
166
|
+
showActionItem2={actionCenterItems.length > 1}
|
|
167
|
+
actionItem2={
|
|
168
|
+
actionCenterItems[1] || 'Pending Feedback Submission'
|
|
169
|
+
}
|
|
170
|
+
showMoreLabel={actionCenterItems.length > 2}
|
|
171
|
+
moreLabel={`+ ${actionCenterItems.length - 2} more`}
|
|
172
|
+
showActionItems={true}
|
|
173
|
+
showTrailing={true}
|
|
174
|
+
/>
|
|
175
|
+
</View>
|
|
176
|
+
)}
|
|
177
|
+
|
|
178
|
+
{/* Next Class Section */}
|
|
179
|
+
{showNextClass && (
|
|
180
|
+
<View className="gap-2">
|
|
181
|
+
<Text className="text-sm font-semibold text-text-secondary px-5">
|
|
182
|
+
Your Next Class
|
|
183
|
+
</Text>
|
|
184
|
+
|
|
185
|
+
<View className="gap-2 px-5">
|
|
186
|
+
<Card
|
|
187
|
+
size="lg"
|
|
188
|
+
title={nextClassTitle}
|
|
189
|
+
subtitle={nextClassTime}
|
|
190
|
+
showSubtitle={true}
|
|
191
|
+
showMedia={false}
|
|
192
|
+
showLeading={false}
|
|
193
|
+
showBadges={false}
|
|
194
|
+
showFooterActions={false}
|
|
195
|
+
/>
|
|
196
|
+
|
|
197
|
+
<View className="flex-row gap-2">
|
|
198
|
+
{showMarkAttendanceButton && (
|
|
199
|
+
<Button variant="default" size="default" className="flex-1">
|
|
200
|
+
Mark Attendance
|
|
201
|
+
</Button>
|
|
202
|
+
)}
|
|
203
|
+
{showResourcesButton && (
|
|
204
|
+
<Button variant="secondary" size="default" className="flex-1">
|
|
205
|
+
Resources
|
|
206
|
+
</Button>
|
|
207
|
+
)}
|
|
208
|
+
</View>
|
|
209
|
+
|
|
210
|
+
<Text className="text-center text-sm font-semibold text-text-primary py-3">
|
|
211
|
+
View All Classes →
|
|
212
|
+
</Text>
|
|
213
|
+
</View>
|
|
214
|
+
</View>
|
|
215
|
+
)}
|
|
216
|
+
|
|
217
|
+
{/* Quick Access Section */}
|
|
218
|
+
{showQuickAccess && (
|
|
219
|
+
<View className="gap-2">
|
|
220
|
+
<Text className="text-sm font-semibold text-text-secondary px-5">
|
|
221
|
+
Quick Access
|
|
222
|
+
</Text>
|
|
223
|
+
|
|
224
|
+
<View className="flex-row flex-wrap gap-2 px-5 justify-between">
|
|
225
|
+
{quickAccessItems.map((item, index) => (
|
|
226
|
+
<View key={index} style={{ width: '48%' }}>
|
|
227
|
+
<Card
|
|
228
|
+
size="sm"
|
|
229
|
+
title={item.title}
|
|
230
|
+
subtitle={item.subtitle}
|
|
231
|
+
showSubtitle={true}
|
|
232
|
+
showMedia={false}
|
|
233
|
+
showLeading={true}
|
|
234
|
+
showBadges={false}
|
|
235
|
+
showFooterActions={false}
|
|
236
|
+
leadingType="avatar"
|
|
237
|
+
avatarInitials={item.title.slice(0, 2).toUpperCase()}
|
|
238
|
+
/>
|
|
239
|
+
</View>
|
|
240
|
+
))}
|
|
241
|
+
</View>
|
|
242
|
+
</View>
|
|
243
|
+
)}
|
|
244
|
+
|
|
245
|
+
{/* Campus Life Section */}
|
|
246
|
+
{showCampusLife && (
|
|
247
|
+
<View className="gap-2">
|
|
248
|
+
<Text className="text-sm font-semibold text-text-secondary px-5">
|
|
249
|
+
Campus Life
|
|
250
|
+
</Text>
|
|
251
|
+
|
|
252
|
+
<View className="flex-row gap-2 px-5">
|
|
253
|
+
<View style={{ flex: 1 }}>
|
|
254
|
+
<Card
|
|
255
|
+
size="sm"
|
|
256
|
+
title="Clubs"
|
|
257
|
+
subtitle="22 Clubs Available"
|
|
258
|
+
showSubtitle={true}
|
|
259
|
+
showMedia={false}
|
|
260
|
+
showLeading={true}
|
|
261
|
+
showBadges={false}
|
|
262
|
+
showFooterActions={false}
|
|
263
|
+
leadingType="avatar"
|
|
264
|
+
avatarInitials="CL"
|
|
265
|
+
/>
|
|
266
|
+
</View>
|
|
267
|
+
|
|
268
|
+
<View style={{ flex: 1 }}>
|
|
269
|
+
<Card
|
|
270
|
+
size="sm"
|
|
271
|
+
title="Events"
|
|
272
|
+
subtitle="2 New Events"
|
|
273
|
+
showSubtitle={true}
|
|
274
|
+
showMedia={false}
|
|
275
|
+
showLeading={true}
|
|
276
|
+
showBadges={false}
|
|
277
|
+
showFooterActions={false}
|
|
278
|
+
leadingType="avatar"
|
|
279
|
+
avatarInitials="EV"
|
|
280
|
+
/>
|
|
281
|
+
</View>
|
|
282
|
+
</View>
|
|
283
|
+
</View>
|
|
284
|
+
)}
|
|
285
|
+
|
|
286
|
+
{/* Announcements Section */}
|
|
287
|
+
{showAnnouncements && (
|
|
288
|
+
<View className="gap-2">
|
|
289
|
+
<View className="flex-row justify-between items-center px-5">
|
|
290
|
+
<Text className="text-sm font-semibold text-text-secondary">
|
|
291
|
+
Announcements
|
|
292
|
+
</Text>
|
|
293
|
+
<Text className="text-xs">→</Text>
|
|
294
|
+
</View>
|
|
295
|
+
|
|
296
|
+
<View className="px-5">
|
|
297
|
+
<FeedCard
|
|
298
|
+
type="announcement"
|
|
299
|
+
authorName={announcementAuthor}
|
|
300
|
+
postTitle={announcementTitle}
|
|
301
|
+
subtitle={announcementSubtitle}
|
|
302
|
+
postContent={announcementContent}
|
|
303
|
+
showMedia={true}
|
|
304
|
+
showHeader={true}
|
|
305
|
+
showPostContent={true}
|
|
306
|
+
showBody={true}
|
|
307
|
+
showFooterActions={true}
|
|
308
|
+
showLeading={true}
|
|
309
|
+
showSubtitle={true}
|
|
310
|
+
showBadges={false}
|
|
311
|
+
showSecondaryButton={false}
|
|
312
|
+
/>
|
|
313
|
+
</View>
|
|
314
|
+
</View>
|
|
315
|
+
)}
|
|
316
|
+
|
|
317
|
+
{/* Bottom Spacer */}
|
|
318
|
+
<View style={{ height: 96 }} />
|
|
319
|
+
</View>
|
|
320
|
+
</ScrollView>
|
|
321
|
+
);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
HomeFacultyPattern.displayName = 'HomeFacultyPattern';
|
|
325
|
+
|
|
326
|
+
export type { HomeFacultyPatternProps };
|