fln-espranza 1.1.18 → 1.1.19

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.
Files changed (94) hide show
  1. package/.expo/README.md +15 -15
  2. package/.expo/settings.json +8 -8
  3. package/assets/images/bg-profile.jpg +0 -0
  4. package/assets/images/bg-stat.png +0 -0
  5. package/assets/images/empty.png +0 -0
  6. package/assets/images/icon-placeholder-schedule.png +0 -0
  7. package/components/Avatar.tsx +3 -2
  8. package/components/Drawer.tsx +150 -97
  9. package/components/EBadge.tsx +50 -19
  10. package/components/EButton.tsx +10 -15
  11. package/components/EButtonIcon.tsx +3 -3
  12. package/components/EDateAndTimeCard.tsx +18 -17
  13. package/components/EDateInput.tsx +15 -14
  14. package/components/EEmptyPlaceholder.tsx +21 -0
  15. package/components/EInfoBox.tsx +3 -3
  16. package/components/EInput.tsx +7 -6
  17. package/components/ELabel.tsx +1 -1
  18. package/components/EListClusterMeeting.tsx +47 -0
  19. package/components/EListPerson.tsx +30 -10
  20. package/components/EListSchool.tsx +2 -2
  21. package/components/ENotFoundPlaceholder.tsx +43 -0
  22. package/components/EOption.tsx +98 -0
  23. package/components/EPageDescription.tsx +1 -2
  24. package/components/EPillButton.tsx +24 -17
  25. package/components/EProfile.tsx +40 -26
  26. package/components/EProfileScreenLayout.tsx +111 -0
  27. package/components/EProgressBar.tsx +47 -0
  28. package/components/EQuestionSerialNumberLabel.tsx +17 -0
  29. package/components/EQuestionText.tsx +14 -0
  30. package/components/EStat.tsx +44 -0
  31. package/components/EStatReport.tsx +49 -0
  32. package/components/EText.tsx +2 -1
  33. package/components/ETextArea.tsx +53 -0
  34. package/components/ETimeInput.tsx +3 -4
  35. package/components/ETimeLineCard.tsx +29 -29
  36. package/components/MenuItems.tsx +1 -1
  37. package/components/ModalLayout.tsx +13 -12
  38. package/components/PageHeader.tsx +66 -73
  39. package/components/PageHeaderSecondary.tsx +4 -2
  40. package/components/ProfileHeader.tsx +85 -0
  41. package/components/SecondaryBaseLayout.tsx +29 -32
  42. package/components/icons/EIconAdd.jsx +19 -0
  43. package/components/icons/EIconAddCircle.jsx +21 -0
  44. package/components/icons/EIconApplicationStatus.jsx +20 -0
  45. package/components/icons/EIconArrowDown.jsx +20 -0
  46. package/components/icons/EIconArrowLeft.jsx +21 -0
  47. package/components/icons/EIconArrowRight.jsx +21 -0
  48. package/components/icons/EIconArrowUp.jsx +20 -0
  49. package/components/icons/EIconBadge.jsx +20 -0
  50. package/components/icons/EIconBell.jsx +19 -0
  51. package/components/icons/EIconCalendar.jsx +21 -0
  52. package/components/icons/EIconCalendarCheck.jsx +24 -0
  53. package/components/icons/EIconCamera.jsx +20 -0
  54. package/components/icons/EIconCameraRotate.jsx +23 -0
  55. package/components/icons/EIconCheck.jsx +19 -0
  56. package/components/icons/EIconCheckCircle.jsx +20 -0
  57. package/components/icons/EIconCheckFill.jsx +19 -0
  58. package/components/icons/EIconChevronDown.jsx +19 -0
  59. package/components/icons/EIconChevronLeft.jsx +19 -0
  60. package/components/icons/EIconChevronRight.jsx +19 -0
  61. package/components/icons/EIconChevronUp.jsx +19 -0
  62. package/components/icons/EIconClock.jsx +19 -0
  63. package/components/icons/EIconClose.jsx +19 -0
  64. package/components/icons/EIconDashboard.jsx +20 -0
  65. package/components/icons/EIconDocumentCheck.jsx +14 -0
  66. package/components/icons/EIconEdit.jsx +19 -0
  67. package/components/icons/EIconFemale.jsx +20 -0
  68. package/components/icons/EIconFile.jsx +21 -0
  69. package/components/icons/EIconInfo.jsx +20 -0
  70. package/components/icons/EIconLogout.jsx +19 -0
  71. package/components/icons/EIconMale.jsx +21 -0
  72. package/components/icons/EIconMenu.jsx +19 -0
  73. package/components/icons/EIconMinus.jsx +19 -0
  74. package/components/icons/EIconPin.jsx +19 -0
  75. package/components/icons/EIconProfile.jsx +19 -0
  76. package/components/icons/EIconSchool.jsx +24 -0
  77. package/components/icons/EIconSearch.jsx +19 -0
  78. package/components/icons/EIconSettings.jsx +20 -0
  79. package/components/icons/EIconShare.jsx +21 -0
  80. package/components/icons/EIconStudent.jsx +24 -0
  81. package/components/icons/EIconSubject.jsx +21 -0
  82. package/components/icons/EIconTeach.jsx +21 -0
  83. package/components/icons/EIconTrash.jsx +19 -0
  84. package/components/icons/EIconUserCard.jsx +19 -0
  85. package/components/icons/EIconUserCheck.jsx +20 -0
  86. package/components/icons/EIconUsers.jsx +19 -0
  87. package/components/index.tsx +5 -1
  88. package/index.ts +185 -72
  89. package/lib/tailwind.js +7 -7
  90. package/lib/useChangeLanguage.ts +60 -0
  91. package/package.json +26 -26
  92. package/tailwind.config.js +32 -32
  93. package/utils/Color.ts +14 -14
  94. package/components/ProgressBar.tsx +0 -33
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ import { ImageBackground, TouchableOpacity, View } from "react-native";
3
+ import tw from "../../../lib/tailwind";
4
+ import EText from "./EText";
5
+ import { Colors } from "fln-espranza/utils/Color";
6
+
7
+ interface IProps {
8
+ stat: string;
9
+ target: string;
10
+ label: string;
11
+ statColor: string;
12
+ iconR?: JSX.Element;
13
+ }
14
+
15
+ export default function EStat({
16
+ stat,
17
+ target,
18
+ label,
19
+ iconR,
20
+ statColor
21
+ }: IProps) {
22
+
23
+ const percentage = Math.round((parseFloat(stat) / parseFloat(target)) * 100);
24
+ const pending = Number(stat) <= Number(target) ? parseFloat(target) - parseFloat(stat) : 0;
25
+
26
+ return (
27
+ <TouchableOpacity
28
+ style={[tw`bg-slate-00 flex-1 overflow-hidden items-center py-3`]}
29
+ activeOpacity={0.8}
30
+ >
31
+ <View style={tw` flex-row flex-1 justify-center`}>
32
+ <EText style={tw`text-xl font-bold ${statColor} -tracking-0.25 `}>
33
+ {stat}
34
+ </EText>
35
+ <EText style={tw`ml-0.5 pt-1 text-slate-800 opacity-50 font-semibold -tracking-0.25`}>
36
+ / {target}
37
+ </EText>
38
+ {iconR}
39
+ </View>
40
+ <EText size="base" style={tw`font-bold text-slate-700 mb-0.5 mt-0.1`}>{label}</EText>
41
+ <EText size="sm" style={tw` text-slate-800 opacity-60`}>{pending} remaining</EText>
42
+ </TouchableOpacity>
43
+ );
44
+ }
@@ -0,0 +1,49 @@
1
+ import React from "react";
2
+ import { ImageBackground, TouchableOpacity, View } from "react-native";
3
+ import tw from "../../../lib/tailwind";
4
+ import EText from "./EText";
5
+ import { Colors } from "fln-espranza/utils/Color";
6
+
7
+ interface IProps {
8
+ stat: string;
9
+ target: string;
10
+ label: string;
11
+ statColor?: string;
12
+ iconR?: JSX.Element;
13
+ }
14
+
15
+ export default function EStatReport({
16
+ stat,
17
+ target,
18
+ label,
19
+ iconR,
20
+ statColor
21
+ }: IProps) {
22
+
23
+ const percentage = Math.round((parseFloat(stat) / parseFloat(target)) * 100);
24
+ const pending = Number(stat) <= Number(target) ? parseFloat(target) - parseFloat(stat) : 0;
25
+
26
+ return (
27
+ <TouchableOpacity
28
+ style={[tw`bg-slate-00 flex-1 overflow-hidden items-center py-3`, {
29
+ // shadowColor: '#155e75',
30
+ // shadowOffset: { width: 0, height: 8 },
31
+ // shadowOpacity: .1,
32
+ // shadowRadius: 16,
33
+ }]}
34
+ activeOpacity={0.8}
35
+ >
36
+ <View style={tw` mb-2 flex-row flex-1 justify-center`}>
37
+ <EText style={tw`text-3xl font-bold ${statColor} -tracking-0.25 `}>
38
+ {stat}
39
+ </EText>
40
+ <EText style={tw`ml-0.5 pt-1 text-slate-800 opacity-50 font-semibold -tracking-0.25`}>
41
+ / {target}
42
+ </EText>
43
+ {iconR}
44
+ </View>
45
+ <EText size="lg" style={tw`font-bold text-slate-700 mb-0.5`}>{label}</EText>
46
+ <EText size="sm" style={tw` text-slate-800 opacity-60`}>{pending} remaining</EText>
47
+ </TouchableOpacity>
48
+ );
49
+ }
@@ -2,6 +2,7 @@ import { Text, TextProps } from "react-native";
2
2
  import React from "react";
3
3
  import tw from "../lib/tailwind";
4
4
 
5
+
5
6
  interface ETextProps extends TextProps {
6
7
  size?: "xs" | "sm" | "base" | "lg" | "xl" | "2xl" | "3xl" | "title";
7
8
  muted?: boolean;
@@ -30,7 +31,7 @@ export default function EText({
30
31
  size === "2xl" && "font-bold text-2xl",
31
32
  size === "3xl" && "font-bold text-3xl",
32
33
  size === "title" && "font-extrabold text-title text-2xl",
33
- muted && "opacity-40"
34
+ muted && "opacity-60"
34
35
  ),
35
36
  style,
36
37
  ]}
@@ -0,0 +1,53 @@
1
+ import { View, Text, TextInput, TextInputProps } from "react-native";
2
+ import React, { useState } from "react";
3
+ import EText from "./EText";
4
+ import tw from "../lib/tailwind";
5
+
6
+ interface EInputProps extends TextInputProps {
7
+ label?: string;
8
+ size?: "lg";
9
+ hasBackground?: boolean;
10
+ icon?: JSX.Element;
11
+ }
12
+
13
+ export default function ETextArea({
14
+ label,
15
+ size,
16
+ hasBackground,
17
+ icon,
18
+ ...props
19
+ }: EInputProps) {
20
+ const [hasFocus, setHasFocus] = useState(false);
21
+ return (
22
+ <View style={[tw``, {}]}>
23
+ {label ? (
24
+ <EText size="sm" style={[tw`font-semibold text-slate-800`, {
25
+ // color: Colors["text-primary"]
26
+ }]}>
27
+ {label}
28
+ </EText>
29
+ ) : null}
30
+
31
+ <View
32
+ style={tw` mt-2 `}
33
+ >
34
+ <TextInput
35
+ style={[tw`h-24 rounded-lg p-4 border border-slate-300 ${
36
+ hasFocus ? "border-black " : ""
37
+ }`, {
38
+ textAlignVertical: 'top'
39
+ }]}
40
+ {...props}
41
+ multiline = {true}
42
+ onFocus={() => setHasFocus(!hasFocus)}
43
+ onBlur={() => setHasFocus(!hasFocus)}
44
+ />
45
+ {
46
+ icon ?
47
+ <>{icon}</>
48
+ : null
49
+ }
50
+ </View>
51
+ </View>
52
+ );
53
+ }
@@ -2,7 +2,6 @@ import moment from 'moment'
2
2
  import React, { useState } from 'react'
3
3
  import { View, TouchableOpacity } from 'react-native'
4
4
  import { ClockIcon } from 'react-native-heroicons/outline'
5
- import { onChange } from 'react-native-reanimated'
6
5
  import DateTimePicker from '@react-native-community/datetimepicker';
7
6
  import tw from '../../../lib/tailwind'
8
7
  import EText from './EText';
@@ -12,7 +11,7 @@ interface IProps {
12
11
  label: string;
13
12
  value: string;
14
13
  onChange: (value: string) => void;
15
- style?: string;
14
+ style?: any;
16
15
  }
17
16
 
18
17
  export default function ETimeInput( { label, value,style, onChange }: IProps ) {
@@ -28,13 +27,13 @@ export default function ETimeInput( { label, value,style, onChange }: IProps ) {
28
27
 
29
28
  return (
30
29
 
31
- <View style={tw`flex-1 ${ style ? style : ""}`}>
30
+ <View style={[tw`mb-4 `, style]}>
32
31
  <ELabel label={label} />
33
32
  <TouchableOpacity
34
33
  style={tw`h-12 rounded-lg px-4 flex-row justify-between items-center border border-slate-300 lowercase my-2 bg-white`}
35
34
  onPress={() => setShow(true)}
36
35
  >
37
- <EText size={"sm"} style={tw`font-normal`}>
36
+ <EText size={"sm"} style={tw`font-normal text-slate-400`}>
38
37
  {
39
38
  // value ? value : moment(date).format("hh:mm A")
40
39
  value ? value : "Select Time"
@@ -1,32 +1,34 @@
1
1
  import React from 'react'
2
2
  import { Dimensions, TouchableOpacity, View } from 'react-native'
3
- import { ChevronRightIcon } from 'react-native-heroicons/solid';
4
3
  import tw from '../lib/tailwind'
5
4
  import { Colors } from '../utils/Color';
6
5
  import EBadge from './EBadge'
7
- import EButton from './EButton';
8
- import EDateAndTimeCard from './EDateAndTimeCard'
9
- import EText from './EText'
6
+ import EText from './EText';
7
+ import EIconChevronRight from './icons/EIconChevronRight';
8
+ import { CheckCircleIcon } from 'react-native-heroicons/solid';
10
9
 
11
10
  interface IProps {
12
11
  title: string;
13
12
  description: string;
14
13
  completed: boolean;
15
- skipButton?: boolean;
16
14
  onPress?: () => void;
15
+ buttonText?: string;
16
+ disabled: boolean;
17
+ badgeText?: string;
17
18
  }
18
19
 
19
- export default function ETimeLineCard({ title, description, completed, skipButton, onPress }: IProps) {
20
+ export default function ETimeLineCard({ title, description, completed, disabled, onPress, buttonText, badgeText }: IProps) {
20
21
  return (
21
22
  <TouchableOpacity
22
- onPress={() => onPress && onPress()}
23
+ onPress={() => onPress && onPress()}
23
24
  style={[
24
25
  tw` rounded-lg p-4 mb-3 w-full border border}`,
25
26
  {
26
- backgroundColor: completed ? Colors['primary-light'] : Colors['white'],
27
+ backgroundColor: completed ? Colors['primary-light'] : Colors['white'],
27
28
  borderColor: completed ? Colors['primary-base'] : Colors['border'],
28
29
  }
29
30
  ]}
31
+ disabled={disabled}
30
32
  >
31
33
 
32
34
  <View style={tw`flex-row justify-between `}>
@@ -34,35 +36,33 @@ export default function ETimeLineCard({ title, description, completed, skipButto
34
36
  <EText size="lg" style={[tw`font-bold`, { color: Colors['text-primary'] }]}>
35
37
  {title}
36
38
  </EText>
37
- <EText size='sm' style={[tw`font-normal mt-1`, {color: Colors['text-body']}]}>
39
+ <EText size='sm' style={[tw`font-normal mt-1`, { color: Colors['text-body'] }]}>
38
40
  {description}
39
41
  </EText>
40
42
  </View>
41
43
  <View style={tw`ml-4`}>
42
- <ChevronRightIcon style={[tw``,{ color: Colors['text-body']}]} size={16} />
44
+
45
+ <EBadge
46
+ color={completed ? `[${Colors['primary-base']}]` : `[${Colors.warning}]`}
47
+ size='sm'
48
+ >
49
+ {
50
+ badgeText ? badgeText : completed ? "Complete" : "Pending"}
51
+ </EBadge>
43
52
  </View>
44
53
  </View>
45
54
 
46
- <View style={tw`mt-6 flex-row items-center justify-between`}>
47
- <EBadge
48
- completed={completed}
49
- text={completed ? "Complete" : "Pending"}
50
- color={completed ? Colors['primary-base'] : Colors.warning}
51
- textColor={completed ? "text-white" : ""}
52
- size="xs"
53
- padding='py-1 px-3'
54
- fontWeight='font-bold'
55
- />
56
-
57
- {
58
- skipButton ? (
59
- <TouchableOpacity>
60
- <EText size="sm" style={[tw`ml-2 font-semibold`, {color: Colors['primary-base']}]}>
61
- Skip
55
+ {
56
+ !disabled ? (
57
+ <View style={tw`mt-6 flex-row items-center justify-between`}>
58
+ <TouchableOpacity style={tw`flex-row`} onPress={onPress}>
59
+ <EText size="sm" style={[tw`ml-2 font-semibold`, { color: Colors['primary-base'] }]}>
60
+ {buttonText}
62
61
  </EText>
63
- </TouchableOpacity>) : null
64
- }
65
- </View>
62
+ <EIconChevronRight size={20} style={[tw`ml-2`, { color: Colors['primary-base'] }]} />
63
+ </TouchableOpacity>
64
+ </View>) : <></>
65
+ }
66
66
  </TouchableOpacity>
67
67
  )
68
68
  }
@@ -32,7 +32,7 @@ export default function MenuItems({ title, icon, onPress }: IProps) {
32
32
  <EText
33
33
  size="base"
34
34
  style={[
35
- tw`font-medium `,
35
+ tw`font-semibold `,
36
36
  {
37
37
  color: Colors["text-primary"],
38
38
  },
@@ -1,10 +1,5 @@
1
- import {
2
- View,
3
- Dimensions,
4
- ScrollView,
5
- Platform,
6
- } from "react-native";
7
- import React, { } from "react";
1
+ import { View, Dimensions, ScrollView, Platform } from "react-native";
2
+ import React from "react";
8
3
  import Constants from "expo-constants";
9
4
  import tw from "../lib/tailwind";
10
5
  import EButtonIcon from "./EButtonIcon";
@@ -44,7 +39,9 @@ export default function ModalLayout({
44
39
  {/* HEADER */}
45
40
  <View
46
41
  style={[
47
- tw`absolute top-0 right-0 left-0 px-6 pr-3 pt-2 z-10 w-full bg-white ${title ? 'pb-1' : 'pb-0'}`,
42
+ tw`absolute top-0 right-0 left-0 px-6 pr-3 pt-2 z-10 w-full bg-white ${
43
+ title ? "pb-2 shadow-md" : "pb-0"
44
+ }`,
48
45
  // {height: 64},
49
46
  ]}
50
47
  >
@@ -54,7 +51,7 @@ export default function ModalLayout({
54
51
  button={
55
52
  <EButtonIcon
56
53
  type="close"
57
- iconColor="slate-800"
54
+ iconColor="slate-900"
58
55
  onPress={() => navigation.goBack()}
59
56
  />
60
57
  }
@@ -73,9 +70,13 @@ export default function ModalLayout({
73
70
  >
74
71
  {children}
75
72
  </ScrollView>
76
- {bottomButton ? <View style={tw` px-6 mb-4 `}>
77
- {bottomButton}
78
- </View> : <></>}
73
+ {bottomButton ? (
74
+ <View style={tw` px-6 mb-4 pt-2 border-t border-slate-300`}>
75
+ {bottomButton}
76
+ </View>
77
+ ) : (
78
+ <></>
79
+ )}
79
80
  </View>
80
81
  );
81
82
  }
@@ -1,11 +1,11 @@
1
- import { View, Animated, Dimensions, Image } from "react-native";
2
- import React, { useEffect, useRef } from "react";
1
+ import { View, Animated, Dimensions, TouchableOpacity } from "react-native";
2
+ import React, { JSX, useEffect, useRef } from "react";
3
3
  import tw from "../lib/tailwind";
4
4
  import { useNavigation } from "@react-navigation/native";
5
- import EButtonIcon from "./EButtonIcon";
6
5
  import EText from "./EText";
7
6
  import Constants from "expo-constants";
8
- import { MenuIcon } from "react-native-heroicons/outline";
7
+ import EIconArrowLeft from "./icons/EIconArrowLeft";
8
+ import EIconMenu from "./icons/EIconMenu";
9
9
 
10
10
  const SCREEN_WIDTH = Dimensions.get("window").width;
11
11
  const HEADER_HEIGHT = 90;
@@ -18,6 +18,7 @@ interface PageHeaderProps {
18
18
  iconEnd?: JSX.Element;
19
19
  border?: boolean;
20
20
  menuButton?: boolean;
21
+ hideBackBtn?: boolean;
21
22
  }
22
23
 
23
24
  export default function PageHeader({
@@ -28,6 +29,7 @@ export default function PageHeader({
28
29
  iconEnd,
29
30
  border,
30
31
  menuButton,
32
+ hideBackBtn,
31
33
  }: PageHeaderProps) {
32
34
  const navigation = useNavigation();
33
35
 
@@ -48,82 +50,73 @@ export default function PageHeader({
48
50
  }).start();
49
51
  });
50
52
  return (
51
- <View style={[tw`${curved ? "-mb-2" : ""} ${border ? "border-b border-slate-300" : ""} `, {}]}>
52
- <View style={tw`overflow-hidden`}>
53
- <Animated.View
54
- style={[
55
- tw`flex-row pr-4 pl-3 pb-3`,
56
- {
57
- paddingTop: Constants.statusBarHeight + 8,
58
- transform: [{ translateX }],
59
- opacity,
60
- },
61
- ]}
62
- >
63
- <Animated.View
64
- style={[tw`-mt-2 left-3 absolute `, { transform: [{ translateX }], opacity, paddingTop: Constants.statusBarHeight + 8 }]}
65
- >
66
- {menuButton ?
67
- <MenuIcon
53
+ // <View
54
+ // style={[
55
+ // tw`${"border-none border-slate-300 bg-white shadow-lg py-3"} `,
56
+ // {},
57
+ // ]}
58
+ // >
59
+ <View style={tw`overflow-hidden`}>
60
+ <View
61
+ style={[
62
+ tw`flex-row items-center px-3`,
63
+ {
64
+ paddingTop: Constants.statusBarHeight + 8,
65
+ },
66
+ ]}
67
+ >
68
+ {/* LEFT ICON */}
69
+ {hideBackBtn ? (
70
+ <></>
71
+ ) : (
72
+ <View style={[tw``]}>
73
+ {menuButton ? (
74
+ <TouchableOpacity
75
+ activeOpacity={0.6}
68
76
  onPress={() => navigation?.openDrawer()}
69
- size={24}
70
- // onPress={() => navigation.navigate("Dashboard")}
71
- style={tw`text-slate-900 mt-2`}
72
- />
73
- :
74
-
75
- <EButtonIcon
76
- iconColor={curved ? "white" : "tint-slate-900"}
77
- size={24}
78
- // onPress={() => navigation.navigate("Dashboard")}
77
+ >
78
+ <EIconMenu size={24} style={tw`text-slate-800`} />
79
+ </TouchableOpacity>
80
+ ) : (
81
+ <TouchableOpacity
82
+ activeOpacity={0.6}
79
83
  onPress={() => navigation.goBack()}
80
- />
81
- }
82
- </Animated.View>
83
- <View style={tw`flex-1 items-center`}>
84
+ style={tw`p-1`}
85
+ >
86
+ <EIconArrowLeft
87
+ iconColor={curved ? "white" : "tint-slate-900"}
88
+ size={24}
89
+ style={tw`text-slate-800`}
90
+ />
91
+ </TouchableOpacity>
92
+ )}
93
+ </View>
94
+ )}
95
+ {/* TITLE */}
96
+ <View style={tw`flex-1 items-start px-3`}>
97
+ <EText
98
+ size="base"
99
+ style={tw.style("text-slate-700 font-bold")}
100
+ numberOfLines={1}
101
+ >
102
+ {title}
103
+ </EText>
104
+ {subtitle ? (
84
105
  <EText
85
- size="base"
86
- style={tw.style("text-black font-semibold ", curved && "text-white ")}
106
+ style={tw.style(
107
+ "text-slate-700 opacity-40 font-semibold mt-0.25"
108
+ )}
87
109
  >
88
- {title}
110
+ {subtitle}
89
111
  </EText>
90
- {subtitle ? (
91
- <EText
92
- style={tw.style(
93
- "text-slate-800 opacity-40 font-semibold mt-0.25",
94
- curved && "text-white "
95
- )}
96
- >
97
- {subtitle}
98
- </EText>
99
- ) : null}
100
- </View>
101
-
102
- {iconEnd ? (
103
- <View style={[tw`mt-0.5 items-center justify-center`, {}]}>
104
- {iconEnd}
105
- </View>
106
112
  ) : null}
107
- </Animated.View>
108
- {children ? <View style={tw.style("pb-6")}>{children}</View> : null}
109
- </View>
110
-
111
- {/* MASK */}
112
- {curved ? (
113
- <View
114
- style={[
115
- tw``,
116
- { height: 32, width: SCREEN_WIDTH, backgroundColor: "#0547FA" },
117
- ]}
118
- >
119
- <View
120
- style={[
121
- tw`bg-white -z-0`,
122
- { height: 64, width: SCREEN_WIDTH, borderTopLeftRadius: 32 },
123
- ]}
124
- />
125
113
  </View>
126
- ) : null}
114
+
115
+ {/* RIGHT ICON */}
116
+ {iconEnd ? <View style={[tw``, {}]}>{iconEnd}</View> : null}
117
+ </View>
118
+ {children ? <View style={tw.style("pb-6")}>{children}</View> : null}
127
119
  </View>
120
+ // </View>
128
121
  );
129
122
  }
@@ -26,7 +26,9 @@ export default function PageHeaderSecondary({
26
26
  >
27
27
  <View style={tw` flex-1 justify-center items-center`}>
28
28
  {title ? (
29
- <EText size="base" style={tw`font-semibold`}>
29
+ <EText
30
+ size="lg"
31
+ style={tw`text-slate-800 font-bold`}>
30
32
  {title}
31
33
  </EText>
32
34
  ) : null}
@@ -36,7 +38,7 @@ export default function PageHeaderSecondary({
36
38
  </EText>
37
39
  ) : null}
38
40
  </View>
39
- <View style={[tw`absolute right-3`, {
41
+ <View style={[tw`absolute right-0`, {
40
42
  paddingTop: Platform.OS === "android" ? insets.top + 8 : 8,
41
43
  }]}>{button}</View>
42
44
  </View>
@@ -0,0 +1,85 @@
1
+ import { useNavigation } from "@react-navigation/native";
2
+ import React, { useRef } from "react";
3
+ import { Animated, ImageBackground, View } from "react-native";
4
+ import EButtonIcon from "./EButtonIcon";
5
+ import Avatar from "./Avatar";
6
+ import EText from "./EText";
7
+ import tw from "../lib/tailwind"
8
+ import Constants from "expo-constants";
9
+
10
+ interface IProps {
11
+ name: string;
12
+ titleText?: string;
13
+ title: string;
14
+ }
15
+
16
+ export default function ProfileHeader({ name, title, titleText }: IProps) {
17
+ const translateX = useRef(new Animated.Value(60)).current;
18
+ const opacity = useRef(new Animated.Value(0)).current;
19
+ const navigation = useNavigation();
20
+
21
+ React.useEffect(() => {
22
+ Animated.spring(translateX, {
23
+ toValue: 0,
24
+ stiffness: 40,
25
+ damping: 10,
26
+ useNativeDriver: true,
27
+ }).start();
28
+ Animated.spring(opacity, {
29
+ toValue: 1,
30
+ delay: 250,
31
+ useNativeDriver: true,
32
+ }).start();
33
+ });
34
+
35
+ return (
36
+ <View style={tw`flex-1 overflow-hidden h-full`}>
37
+ <ImageBackground
38
+ style={[tw`h-full w-full`, {}]}
39
+ source={require("../assets/images/bg-profile.jpg")}
40
+ >
41
+ <Animated.View
42
+ style={[
43
+ tw`flex-row pr-4 pl-3 pb-3`,
44
+ {
45
+ paddingTop: Constants.statusBarHeight + 8,
46
+ transform: [{ translateX }],
47
+ opacity,
48
+ },
49
+ ]}
50
+ >
51
+ <Animated.View
52
+ style={[
53
+ tw`-mt-2 left-3 absolute `,
54
+ {
55
+ transform: [{ translateX }],
56
+ opacity,
57
+ paddingTop: Constants.statusBarHeight + 8,
58
+ },
59
+ ]}
60
+ >
61
+ <EButtonIcon
62
+ iconColor={"tint-white"}
63
+ size={20}
64
+ onPress={() => navigation.goBack()}
65
+ />
66
+ </Animated.View>
67
+ </Animated.View>
68
+ <View style={[tw`flex items-center mt-5 rounded-4xl `, {}]}>
69
+ <Avatar size="5xl" source={""} nameFirstLetter={name?.split("")[0]} />
70
+ <View style={tw`mt-6 mb-8 items-center`}>
71
+ <EText size="base" style={tw`font-bold text-white capitalize`}>
72
+ {name.toLocaleLowerCase().trim()}
73
+ </EText>
74
+ <EText
75
+ size="sm"
76
+ style={tw`mt-0.5 font-normal opacity-50 text-white`}
77
+ >
78
+ {titleText ? titleText : "Unique Code"} : {title}
79
+ </EText>
80
+ </View>
81
+ </View>
82
+ </ImageBackground>
83
+ </View>
84
+ );
85
+ }