@fadyshawky/react-native-magic 2.2.0 → 2.3.0
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/LICENSE +21 -0
- package/README.md +90 -55
- package/index.js +4 -0
- package/package.json +9 -3
- package/scripts/askPackageName.js +10 -5
- package/template/.env.development +8 -6
- package/template/.env.example +15 -5
- package/template/.env.production +8 -6
- package/template/.env.staging +8 -6
- package/template/.eslintrc.js +14 -0
- package/template/.husky/pre-commit +1 -0
- package/template/App.tsx +47 -16
- package/template/__tests__/App.test.tsx +28 -10
- package/template/babel.config.js +20 -1
- package/template/docs/ARCHITECTURE.md +40 -10
- package/template/docs/BEST_PRACTICES.md +10 -1
- package/template/docs/CUSTOMIZATION.md +118 -5
- package/template/docs/design-system.html +1164 -0
- package/template/docs/wireframes.html +411 -0
- package/template/index.js +10 -0
- package/template/jest.config.js +16 -1
- package/template/jest.setup.js +61 -0
- package/template/package-lock.json +12178 -8293
- package/template/package.json +53 -19
- package/template/react-native.config.js +3 -0
- package/template/resources/fonts/.gitkeep +0 -0
- package/template/scripts/ci-sync-env.cjs +71 -0
- package/template/src/assets/brand/logo-mark.svg +8 -0
- package/template/src/assets/brand/logo-mono.svg +9 -0
- package/template/src/assets/brand/logo-primary.svg +15 -0
- package/template/src/assets/brand/wordmark-dark.svg +18 -0
- package/template/src/common/components/AppBottomSheet.tsx +87 -0
- package/template/src/common/components/AppSwitch.tsx +75 -0
- package/template/src/common/components/AppTextInput.tsx +161 -0
- package/template/src/common/components/Avatar.tsx +75 -0
- package/template/src/common/components/Badge.tsx +66 -0
- package/template/src/common/components/CardScroller.tsx +58 -0
- package/template/src/common/components/Cards.tsx +13 -7
- package/template/src/common/components/Carousel.tsx +196 -0
- package/template/src/common/components/Checkbox.tsx +85 -0
- package/template/src/common/components/Chip.tsx +55 -0
- package/template/src/common/components/Dropdown.tsx +202 -0
- package/template/src/common/components/ErrorBoundary.tsx +82 -0
- package/template/src/common/components/FlatListWrapper.tsx +8 -8
- package/template/src/common/components/ListItem.tsx +90 -0
- package/template/src/common/components/LoadingComponent.tsx +8 -2
- package/template/src/common/components/Logo.tsx +77 -0
- package/template/src/common/components/ModalDialog.tsx +141 -0
- package/template/src/common/components/NetworkBanner.tsx +47 -0
- package/template/src/common/components/OTPInput.tsx +0 -1
- package/template/src/common/components/PrimaryButton.tsx +0 -14
- package/template/src/common/components/PrimaryTextInput.tsx +66 -130
- package/template/src/common/components/RadioGroup.tsx +95 -0
- package/template/src/common/components/SafeText.tsx +4 -3
- package/template/src/common/components/SearchBar.tsx +7 -5
- package/template/src/common/components/SegmentedControl.tsx +77 -0
- package/template/src/common/components/Skeleton.tsx +47 -0
- package/template/src/common/components/TryAgain.tsx +4 -2
- package/template/src/common/helpers/arrayHelpers.ts +2 -2
- package/template/src/common/helpers/defaultKeyIdExtractor.ts +1 -1
- package/template/src/common/helpers/regexHelpers.ts +1 -2
- package/template/src/common/helpers/stringsHelpers.ts +0 -1
- package/template/src/common/hooks/useBackHandler.ts +5 -2
- package/template/src/common/hooks/useEventRegister.ts +1 -1
- package/template/src/common/hooks/useFlatListActions.ts +1 -1
- package/template/src/common/hooks/useWhyDidYouUpdate.ts +1 -1
- package/template/src/common/localization/LocalizationProvider.tsx +1 -1
- package/template/src/common/localization/RTLInitializer.tsx +1 -1
- package/template/src/common/localization/dateFormatter.ts +0 -1
- package/template/src/common/localization/intlFormatter.ts +0 -1
- package/template/src/common/localization/localization.ts +2 -2
- package/template/src/common/localization/translations/homeLocalization.ts +14 -0
- package/template/src/common/localization/translations/loginLocalization.ts +8 -0
- package/template/src/common/localization/translations/mainNavigationLocalization.ts +2 -0
- package/template/src/common/localization/translations/profileLocalization.ts +16 -0
- package/template/src/common/utils/index.tsx +0 -6
- package/template/src/common/validations/commonValidations.ts +2 -2
- package/template/src/core/api/errorHandler.ts +1 -1
- package/template/src/core/api/responseHandlers.ts +1 -3
- package/template/src/core/api/serverHeaders.ts +61 -12
- package/template/src/core/notifications/notificationAuth.ts +6 -0
- package/template/src/core/notifications/notificationService.ts +125 -0
- package/template/src/core/notifications/routeFromNotificationData.ts +32 -0
- package/template/src/core/store/categories/categoriesActions.ts +25 -0
- package/template/src/core/store/categories/categoriesSlice.ts +51 -0
- package/template/src/core/store/categories/categoriesState.ts +19 -0
- package/template/src/core/store/rootReducer.ts +2 -0
- package/template/src/core/store/store.tsx +6 -1
- package/template/src/core/store/user/userActions.ts +75 -14
- package/template/src/core/store/user/userSlice.ts +49 -26
- package/template/src/core/store/user/userState.ts +6 -4
- package/template/src/core/theme/ThemeProvider.tsx +5 -3
- package/template/src/core/theme/brand.ts +50 -0
- package/template/src/core/theme/colors.ts +113 -99
- package/template/src/core/theme/commonConsts.ts +2 -2
- package/template/src/core/theme/commonStyles.ts +1 -1
- package/template/src/core/theme/themes.ts +2 -0
- package/template/src/core/theme/types.ts +4 -2
- package/template/src/core/utils/stringUtils.ts +1 -1
- package/template/src/design-system/index.ts +2 -0
- package/template/src/design-system/tokens/brand.ts +6 -0
- package/template/src/design-system/tokens/index.ts +3 -0
- package/template/src/design-system/tokens/palette.ts +4 -0
- package/template/src/design-system/tokens/typography-spacing.ts +2 -0
- package/template/src/navigation/AuthStack.tsx +1 -4
- package/template/src/navigation/HeaderComponents.tsx +6 -3
- package/template/src/navigation/MainStack.tsx +18 -6
- package/template/src/navigation/RootNavigation.tsx +4 -7
- package/template/src/navigation/TabBar.tsx +7 -6
- package/template/src/navigation/types.ts +10 -31
- package/template/src/screens/Login/Login.tsx +47 -47
- package/template/src/screens/OTP/OTPScreen.tsx +6 -9
- package/template/src/screens/components/ComponentsScreen.tsx +301 -0
- package/template/src/screens/home/HomeScreen.tsx +143 -1
- package/template/src/screens/home/hooks/useHomeData.ts +19 -5
- package/template/src/screens/index.tsx +1 -0
- package/template/src/screens/profile/Profile.tsx +139 -2
- package/template/src/screens/splash/Splash.tsx +44 -11
- package/template/src/sheetManager/sheets.tsx +1 -1
- package/template/tsconfig.json +14 -2
- package/template/types/globals.d.ts +43 -0
- package/template/types/index.ts +2 -6
- package/template/types/modules.d.ts +9 -0
- package/template/types/react-native-config.d.ts +0 -2
- package/.vscode/settings.json +0 -8
- package/CHANGELOG.md +0 -119
- package/CODE_OF_CONDUCT.md +0 -83
- package/CONTRIBUTING.md +0 -60
- package/local.properties +0 -1
- package/template/src/common/components/ImageCropPickerButton.tsx +0 -107
- package/template/src/common/components/PhotoTakingButton.tsx +0 -94
- package/template/src/common/helpers/imageHelpers.ts +0 -5
- package/template/src/common/helpers/inAppReviewHelper.ts +0 -30
- package/template/src/common/helpers/orientationHelpers.ts +0 -25
- package/template/src/common/helpers/shareHelpers.ts +0 -47
- package/template/src/common/utils/FeesCaalculation.tsx +0 -37
- package/template/src/common/utils/printData.tsx +0 -161
- package/template/src/common/validations/examples/TextInputWithValidation.tsx +0 -229
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>React Native Magic — Wireframes</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
|
+
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;700&display=swap" rel="stylesheet" />
|
|
10
|
+
<style>
|
|
11
|
+
:root{
|
|
12
|
+
--indigo:#2F6BFF; --indigo-200:#6193FF; --cyan:#6193FF; --cyan-soft:#A6C4FF; --violet:#6353F2;
|
|
13
|
+
--bg:#06080F; --surface:#0D1124; --raised:#1A2142;
|
|
14
|
+
--white:#FFFFFF; --near-white:#F4F6FE; --n-200:#D7DCEC; --n-300:#D7DCEC; --muted:#828BB0; --n-500:#59618A; --n-600:#343C63;
|
|
15
|
+
--error:#DC2A52;
|
|
16
|
+
--grad:linear-gradient(135deg,#1B45B8,#3E7BFF);
|
|
17
|
+
--glow-indigo:0 8px 18px rgba(47,107,255,.5);
|
|
18
|
+
--glow-cyan:0 8px 18px rgba(97,147,255,.42);
|
|
19
|
+
--hairline:rgba(130,139,176,.10);
|
|
20
|
+
--hairline-strong:rgba(130,139,176,.20);
|
|
21
|
+
--font:"Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
22
|
+
}
|
|
23
|
+
*{box-sizing:border-box;}
|
|
24
|
+
body{
|
|
25
|
+
margin:0; font-family:var(--font); color:var(--n-200);
|
|
26
|
+
background:
|
|
27
|
+
radial-gradient(1100px 700px at 84% -6%, rgba(97,147,255,.10), transparent 60%),
|
|
28
|
+
radial-gradient(1200px 800px at 4% 0%, rgba(47,107,255,.18), transparent 55%),
|
|
29
|
+
radial-gradient(900px 900px at 50% 118%, rgba(99,83,242,.10), transparent 60%),
|
|
30
|
+
var(--bg);
|
|
31
|
+
background-attachment:fixed;
|
|
32
|
+
-webkit-font-smoothing:antialiased;
|
|
33
|
+
}
|
|
34
|
+
::selection{background:rgba(47,107,255,.32); color:#fff;}
|
|
35
|
+
.wrap{max-width:1180px; margin:0 auto; padding:0 28px;}
|
|
36
|
+
|
|
37
|
+
/* header */
|
|
38
|
+
header{padding:70px 0 30px;}
|
|
39
|
+
.eyebrow{font-size:12px; font-weight:500; letter-spacing:.22em; text-transform:uppercase; color:var(--cyan-soft);
|
|
40
|
+
margin:0 0 14px; display:inline-flex; align-items:center; gap:9px;}
|
|
41
|
+
.eyebrow::before{content:""; width:22px; height:1px; background:linear-gradient(90deg,var(--cyan),transparent);}
|
|
42
|
+
header h1{font-size:44px; line-height:1.08; font-weight:700; color:var(--white); margin:14px 0 0; letter-spacing:-.02em;}
|
|
43
|
+
header h1 .grad{background:var(--grad); -webkit-background-clip:text; background-clip:text; color:transparent;}
|
|
44
|
+
header p{font-size:16px; color:var(--muted); max-width:600px; margin:16px 0 0;}
|
|
45
|
+
.legend{display:flex; flex-wrap:wrap; gap:16px; margin-top:24px;}
|
|
46
|
+
.lg{display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--n-300);}
|
|
47
|
+
.lg .anno-dot{width:13px; height:13px; border-radius:50%; border:1.5px dashed var(--cyan); background:rgba(97,147,255,.12);}
|
|
48
|
+
.lg .grad-dot{width:13px; height:13px; border-radius:4px; background:var(--grad);}
|
|
49
|
+
|
|
50
|
+
/* phones grid */
|
|
51
|
+
.screens{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:34px 28px; padding:34px 0 90px; align-items:start;}
|
|
52
|
+
.screen-col{display:flex; flex-direction:column; align-items:center;}
|
|
53
|
+
.screen-label{margin-bottom:18px; text-align:center;}
|
|
54
|
+
.screen-label .nm{font-size:16px; font-weight:500; color:var(--white);}
|
|
55
|
+
.screen-label .sub{font-size:12px; color:var(--muted); margin-top:4px; line-height:1.4; max-width:230px;}
|
|
56
|
+
|
|
57
|
+
/* phone frame */
|
|
58
|
+
.phone{
|
|
59
|
+
position:relative; width:320px; height:680px; border-radius:42px; padding:13px;
|
|
60
|
+
background:linear-gradient(160deg,#1A2142,#06080F);
|
|
61
|
+
box-shadow:0 26px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.07), 0 0 0 1px rgba(47,107,255,.18);
|
|
62
|
+
flex-shrink:0;
|
|
63
|
+
}
|
|
64
|
+
.notch{position:absolute; top:13px; left:50%; transform:translateX(-50%); width:128px; height:26px;
|
|
65
|
+
background:#03050C; border-radius:0 0 16px 16px; z-index:5;}
|
|
66
|
+
.screen{
|
|
67
|
+
position:relative; width:100%; height:100%; border-radius:30px; overflow:hidden;
|
|
68
|
+
background:radial-gradient(120% 60% at 50% -8%, rgba(47,107,255,.18), transparent 60%), var(--bg);
|
|
69
|
+
display:flex; flex-direction:column;
|
|
70
|
+
}
|
|
71
|
+
.statusbar{display:flex; justify-content:space-between; align-items:center; padding:14px 22px 6px; font-size:11px; color:var(--n-300); font-weight:500;}
|
|
72
|
+
.statusbar .ico-row{display:flex; gap:6px; align-items:center;}
|
|
73
|
+
.statusbar .bar-ico{width:16px; height:9px; border:1px solid var(--n-300); border-radius:2px; position:relative;}
|
|
74
|
+
.statusbar .bar-ico::after{content:""; position:absolute; inset:1.5px; right:5px; background:var(--n-300); border-radius:1px;}
|
|
75
|
+
|
|
76
|
+
.scr-body{flex:1; display:flex; flex-direction:column; padding:8px 20px 0; position:relative;}
|
|
77
|
+
|
|
78
|
+
/* annotation callouts */
|
|
79
|
+
.anno{position:absolute; z-index:30; display:flex; align-items:center; gap:0; pointer-events:none;}
|
|
80
|
+
.anno .bub{font-size:10.5px; line-height:1.3; color:#0A1230; background:rgba(166,196,255,.96); padding:5px 9px; border-radius:9px;
|
|
81
|
+
box-shadow:0 4px 12px rgba(0,0,0,.4); font-weight:500; max-width:128px; white-space:normal;}
|
|
82
|
+
.anno .lead{height:1.5px; width:26px; background:linear-gradient(90deg,rgba(166,196,255,.9),rgba(166,196,255,.2));}
|
|
83
|
+
.anno .lead.l{background:linear-gradient(270deg,rgba(166,196,255,.9),rgba(166,196,255,.2));}
|
|
84
|
+
.anno.right{flex-direction:row;} .anno.left{flex-direction:row-reverse;}
|
|
85
|
+
.anno .tip{width:7px; height:7px; border-radius:50%; background:var(--cyan-soft); box-shadow:0 0 8px var(--cyan-soft); flex-shrink:0;}
|
|
86
|
+
|
|
87
|
+
/* shared UI bits */
|
|
88
|
+
.logo-sm{display:inline-flex;}
|
|
89
|
+
.h-greet{font-size:13px; color:var(--muted);}
|
|
90
|
+
.h-name{font-size:19px; color:var(--white); font-weight:700; margin-top:2px; letter-spacing:-.01em;}
|
|
91
|
+
.top-bar{display:flex; align-items:center; justify-content:space-between; padding:6px 0 18px;}
|
|
92
|
+
.avatar-sm{width:40px; height:40px; border-radius:13px; background:rgba(26,33,66,.85); border:1px solid var(--hairline-strong);
|
|
93
|
+
display:flex; align-items:center; justify-content:center; color:var(--cyan-soft); font-weight:700; font-size:14px;}
|
|
94
|
+
.bell{width:40px; height:40px; border-radius:13px; background:rgba(26,33,66,.85); border:1px solid var(--hairline-strong);
|
|
95
|
+
display:flex; align-items:center; justify-content:center;}
|
|
96
|
+
.bell svg{width:19px; height:19px;}
|
|
97
|
+
|
|
98
|
+
.hero-card{border-radius:20px; padding:20px; background:linear-gradient(135deg,#1B45B8,#3E7BFF); color:#FFFFFF; box-shadow:var(--glow-indigo); position:relative; overflow:hidden;}
|
|
99
|
+
.hero-card::after{content:""; position:absolute; right:-30px; top:-30px; width:120px; height:120px; border-radius:50%; background:rgba(255,255,255,.18);}
|
|
100
|
+
.hero-card .lab{font-size:12px; opacity:.78; font-weight:500;}
|
|
101
|
+
.hero-card .amt{font-size:30px; font-weight:700; margin-top:6px; letter-spacing:-.01em;}
|
|
102
|
+
.hero-card .row{display:flex; justify-content:space-between; align-items:flex-end; margin-top:18px; position:relative; z-index:1; gap:12px;}
|
|
103
|
+
.hero-card .chip{font-size:11px; background:rgba(255,255,255,.18); padding:6px 12px; border-radius:1000px; font-weight:500; white-space:nowrap; flex-shrink:0;}
|
|
104
|
+
.hero-card .hsub{font-size:12px; opacity:.82; line-height:1.4; font-weight:400;}
|
|
105
|
+
|
|
106
|
+
.sec-title{font-size:13px; color:var(--white); font-weight:500; letter-spacing:.02em; margin:22px 0 12px; display:flex; justify-content:space-between; align-items:center;}
|
|
107
|
+
.sec-title .more{font-size:11px; color:var(--cyan-soft); font-weight:400;}
|
|
108
|
+
|
|
109
|
+
.cat-card{display:flex; align-items:center; gap:13px; padding:13px; border-radius:15px; background:rgba(13,17,36,.6);
|
|
110
|
+
border:1px solid var(--hairline); margin-bottom:11px;}
|
|
111
|
+
.cat-ico{width:42px; height:42px; border-radius:13px; display:flex; align-items:center; justify-content:center; flex-shrink:0;}
|
|
112
|
+
.cat-ico svg{width:21px; height:21px;}
|
|
113
|
+
.cat-ico.grad-ico{background:var(--grad); color:#fff; font-weight:700; font-size:16px; box-shadow:var(--glow-indigo);}
|
|
114
|
+
.cat-body{flex:1; min-width:0;}
|
|
115
|
+
.cat-body .t{font-size:14px; color:var(--white); font-weight:500;}
|
|
116
|
+
.cat-body .d{font-size:11.5px; color:var(--muted); margin-top:2px;}
|
|
117
|
+
.chev{color:var(--n-500); font-size:17px;}
|
|
118
|
+
|
|
119
|
+
/* shimmer */
|
|
120
|
+
.sh-card{display:flex; align-items:center; gap:13px; padding:13px; border-radius:15px; background:rgba(13,17,36,.4); border:1px solid var(--hairline);}
|
|
121
|
+
.sh{background:linear-gradient(90deg,rgba(47,107,255,.10) 0%,rgba(47,107,255,.24) 50%,rgba(47,107,255,.10) 100%); background-size:200% 100%; animation:shim 1.5s ease-in-out infinite; border-radius:7px;}
|
|
122
|
+
.sh.chip{width:42px; height:42px; border-radius:13px; flex-shrink:0;}
|
|
123
|
+
.sh.l1{height:11px; width:62%;} .sh.l2{height:9px; width:38%; margin-top:8px;}
|
|
124
|
+
@keyframes shim{0%{background-position:200% 0;}100%{background-position:-200% 0;}}
|
|
125
|
+
|
|
126
|
+
/* inputs */
|
|
127
|
+
.w-field{margin-bottom:14px;}
|
|
128
|
+
.w-field label{font-size:11.5px; color:var(--n-300); font-weight:500; display:block; margin-bottom:6px;}
|
|
129
|
+
.w-input{height:50px; border-radius:14px; background:rgba(6,8,15,.6); border:1.5px solid var(--hairline-strong);
|
|
130
|
+
display:flex; align-items:center; gap:10px; padding:0 15px; font-size:14px; color:var(--white);}
|
|
131
|
+
.w-input.focus{border-color:var(--cyan); box-shadow:0 0 0 4px rgba(97,147,255,.14);}
|
|
132
|
+
.w-input .ico{color:var(--muted); font-size:15px;}
|
|
133
|
+
.w-input .ph{color:var(--n-500);}
|
|
134
|
+
.w-input .dots{letter-spacing:3px; color:var(--white);}
|
|
135
|
+
|
|
136
|
+
.w-btn{height:52px; border-radius:15px; background:var(--grad); color:#FFFFFF; font-weight:500; font-size:15px;
|
|
137
|
+
display:flex; align-items:center; justify-content:center; gap:9px; box-shadow:var(--glow-indigo); border:0; width:100%; font-family:var(--font); margin-top:6px;}
|
|
138
|
+
.w-btn.danger{background:linear-gradient(135deg,#E23A5F,#DC2A52); box-shadow:0 8px 18px rgba(220,42,82,.4); color:#fff;}
|
|
139
|
+
|
|
140
|
+
/* splash */
|
|
141
|
+
.splash{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:26px; position:relative;}
|
|
142
|
+
.splash .glow-ring{position:absolute; width:220px; height:220px; border-radius:50%;
|
|
143
|
+
background:radial-gradient(circle, rgba(97,147,255,.16), transparent 70%); top:42%; transform:translateY(-50%);}
|
|
144
|
+
.splash .name{font-size:22px; font-weight:700; color:var(--white); letter-spacing:.02em; z-index:1;}
|
|
145
|
+
.splash .tag{font-size:11px; letter-spacing:.34em; text-transform:uppercase; color:var(--cyan-soft); margin-top:-16px; z-index:1;}
|
|
146
|
+
.loader{width:120px; height:3px; border-radius:1000px; background:rgba(47,107,255,.18); overflow:hidden; position:relative; z-index:1;}
|
|
147
|
+
.loader::after{content:""; position:absolute; left:0; top:0; height:100%; width:42%; border-radius:1000px; background:var(--grad);
|
|
148
|
+
animation:slide 1.4s ease-in-out infinite; box-shadow:var(--glow-cyan);}
|
|
149
|
+
@keyframes slide{0%{left:-42%;}100%{left:100%;}}
|
|
150
|
+
|
|
151
|
+
/* login */
|
|
152
|
+
.login-top{display:flex; flex-direction:column; align-items:center; padding:30px 0 6px;}
|
|
153
|
+
.login-h{font-size:26px; font-weight:700; color:var(--white); text-align:center; margin:22px 0 4px; letter-spacing:-.01em;}
|
|
154
|
+
.login-sub{font-size:13px; color:var(--muted); text-align:center; margin-bottom:26px;}
|
|
155
|
+
.forgot{text-align:right; font-size:12px; color:var(--cyan-soft); margin:2px 2px 18px;}
|
|
156
|
+
.lang-toggle{display:flex; align-items:center; justify-content:center; gap:0; margin-top:auto; padding:18px 0 22px;}
|
|
157
|
+
.lang-pill{display:inline-flex; border:1px solid var(--hairline-strong); border-radius:1000px; overflow:hidden; background:rgba(6,8,15,.5);}
|
|
158
|
+
.lang-pill span{padding:7px 16px; font-size:12px; font-weight:500; color:var(--muted);}
|
|
159
|
+
.lang-pill span.on{background:var(--grad); color:#FFFFFF;}
|
|
160
|
+
|
|
161
|
+
/* profile */
|
|
162
|
+
.prof-head{display:flex; flex-direction:column; align-items:center; padding:14px 0 8px;}
|
|
163
|
+
.prof-av{width:84px; height:84px; border-radius:28px; background:linear-gradient(150deg,rgba(47,107,255,.4),rgba(97,147,255,.25)),var(--raised);
|
|
164
|
+
border:1px solid rgba(47,107,255,.5); display:flex; align-items:center; justify-content:center; color:var(--white); font-size:28px; font-weight:700;
|
|
165
|
+
box-shadow:var(--glow-indigo);}
|
|
166
|
+
.info-card{border-radius:16px; padding:16px 16px; background:rgba(13,17,36,.6); border:1px solid var(--hairline); margin:18px 0 8px; text-align:center;}
|
|
167
|
+
.info-card .pn{font-size:17px; color:var(--white); font-weight:700;}
|
|
168
|
+
.info-card .pm{font-size:13px; color:var(--cyan-soft); margin-top:4px;}
|
|
169
|
+
.prow{display:flex; align-items:center; gap:13px; padding:15px 14px; border-radius:14px; background:rgba(13,17,36,.5); border:1px solid var(--hairline); margin-bottom:11px;}
|
|
170
|
+
.prow .pico{width:38px; height:38px; border-radius:12px; background:rgba(47,107,255,.14); border:1px solid rgba(47,107,255,.32);
|
|
171
|
+
display:flex; align-items:center; justify-content:center; color:var(--indigo-200); flex-shrink:0;}
|
|
172
|
+
.prow .pico svg{width:19px; height:19px;}
|
|
173
|
+
.prow .pbody{flex:1;}
|
|
174
|
+
.prow .pt{font-size:13.5px; color:var(--white); font-weight:500;}
|
|
175
|
+
.prow .pv{font-size:11.5px; color:var(--muted); margin-top:2px;}
|
|
176
|
+
.seg{display:inline-flex; border:1px solid var(--hairline-strong); border-radius:1000px; overflow:hidden;}
|
|
177
|
+
.seg b{font-size:10px; padding:4px 9px; font-weight:500; color:var(--n-500);}
|
|
178
|
+
.seg b.on{background:rgba(47,107,255,.25); color:var(--white);}
|
|
179
|
+
|
|
180
|
+
.home-scroll{overflow:hidden;}
|
|
181
|
+
|
|
182
|
+
@media (max-width:1180px){ .screens{grid-template-columns:repeat(2,minmax(0,1fr)); justify-items:center; gap:48px 24px;} }
|
|
183
|
+
@media (max-width:720px){ .screens{grid-template-columns:1fr;} header h1{font-size:34px;} }
|
|
184
|
+
@media (max-width:380px){ .phone{transform:scale(.92); transform-origin:top center;} }
|
|
185
|
+
</style>
|
|
186
|
+
</head>
|
|
187
|
+
<body>
|
|
188
|
+
|
|
189
|
+
<svg width="0" height="0" style="position:absolute"><defs>
|
|
190
|
+
<linearGradient id="ig" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#3E7BFF"/><stop offset="1" stop-color="#A6C4FF"/></linearGradient>
|
|
191
|
+
</defs></svg>
|
|
192
|
+
|
|
193
|
+
<header>
|
|
194
|
+
<div class="wrap">
|
|
195
|
+
<div class="eyebrow">Flows & Screens</div>
|
|
196
|
+
<h1>React Native <span class="grad">Magic</span> — Wireframes</h1>
|
|
197
|
+
<p>Four core screens for any app scaffolded from the template — Splash, Sign in, Home, and Profile — annotated with key elements and on-brand styling.</p>
|
|
198
|
+
<div class="legend">
|
|
199
|
+
<div class="lg"><span class="anno-dot"></span> Annotation callout</div>
|
|
200
|
+
<div class="lg"><span class="grad-dot"></span> Signature gradient surface</div>
|
|
201
|
+
<div class="lg">320 × 680 frame</div>
|
|
202
|
+
</div>
|
|
203
|
+
</div>
|
|
204
|
+
</header>
|
|
205
|
+
|
|
206
|
+
<div class="wrap">
|
|
207
|
+
<div class="screens">
|
|
208
|
+
|
|
209
|
+
<!-- ============ SPLASH ============ -->
|
|
210
|
+
<div class="screen-col">
|
|
211
|
+
<div class="screen-label"><div class="nm">Splash</div><div class="sub">First paint while the app boots and restores session.</div></div>
|
|
212
|
+
<div class="phone">
|
|
213
|
+
<div class="notch"></div>
|
|
214
|
+
<div class="screen">
|
|
215
|
+
<div class="statusbar"><span>9:41</span><div class="ico-row"><span>⏹</span><span class="bar-ico"></span></div></div>
|
|
216
|
+
<div class="scr-body">
|
|
217
|
+
<div class="anno right" style="top:200px; left:236px;"><span class="tip"></span><span class="lead"></span><span class="bub">Centered brand logo with blue halo</span></div>
|
|
218
|
+
<div class="anno left" style="top:486px; left:-16px;"><span class="tip"></span><span class="lead l"></span><span class="bub">Thin indeterminate loader</span></div>
|
|
219
|
+
<div class="splash">
|
|
220
|
+
<div class="glow-ring"></div>
|
|
221
|
+
<svg width="92" height="92" viewBox="0 0 120 120" fill="none" role="img" aria-label="App logo">
|
|
222
|
+
<defs><linearGradient id="chipSplash" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#0A1230"/><stop offset="1" stop-color="#1B45B8"/></linearGradient></defs>
|
|
223
|
+
<rect width="120" height="120" rx="30" fill="url(#chipSplash)"/>
|
|
224
|
+
<rect x="25" y="24" width="13" height="72" rx="3" fill="#6BA0FF"/>
|
|
225
|
+
<rect x="25" y="24" width="33" height="13" rx="3" fill="#6BA0FF"/>
|
|
226
|
+
<rect x="25" y="52" width="26" height="12" rx="3" fill="#6BA0FF"/>
|
|
227
|
+
<path d="M101 42 C101 32 91 28 83 28 C73 28 67 35 67 44 C67 52 75 56 84 59 C93 62 101 66 101 76 C101 86 91 91 83 91 C73 91 67 85 66 77" fill="none" stroke="#6BA0FF" stroke-width="13" stroke-linecap="round" stroke-linejoin="round"/>
|
|
228
|
+
</svg>
|
|
229
|
+
<div style="text-align:center; z-index:1;">
|
|
230
|
+
<div class="name">React Native Magic</div>
|
|
231
|
+
</div>
|
|
232
|
+
<div class="tag" style="margin-top:-12px;">app name placeholder</div>
|
|
233
|
+
<div class="loader"></div>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
</div>
|
|
238
|
+
</div>
|
|
239
|
+
|
|
240
|
+
<!-- ============ LOGIN ============ -->
|
|
241
|
+
<div class="screen-col">
|
|
242
|
+
<div class="screen-label"><div class="nm">Sign in</div><div class="sub">Token-gated auth with a language toggle.</div></div>
|
|
243
|
+
<div class="phone">
|
|
244
|
+
<div class="notch"></div>
|
|
245
|
+
<div class="screen">
|
|
246
|
+
<div class="statusbar"><span>9:41</span><div class="ico-row"><span>⏹</span><span class="bar-ico"></span></div></div>
|
|
247
|
+
<div class="scr-body">
|
|
248
|
+
<div class="anno right" style="top:96px; left:232px;"><span class="tip"></span><span class="lead"></span><span class="bub">Logo anchored top</span></div>
|
|
249
|
+
<div class="anno left" style="top:330px; left:-18px;"><span class="tip"></span><span class="lead l"></span><span class="bub">PrimaryTextInput fields</span></div>
|
|
250
|
+
<div class="anno right" style="top:470px; left:232px;"><span class="tip"></span><span class="lead"></span><span class="bub">Gradient primary CTA</span></div>
|
|
251
|
+
|
|
252
|
+
<div class="login-top">
|
|
253
|
+
<svg width="58" height="58" viewBox="0 0 120 120" fill="none" role="img" aria-label="App logo">
|
|
254
|
+
<defs><linearGradient id="chipLogin" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#0A1230"/><stop offset="1" stop-color="#1B45B8"/></linearGradient></defs>
|
|
255
|
+
<rect width="120" height="120" rx="30" fill="url(#chipLogin)"/>
|
|
256
|
+
<rect x="25" y="24" width="13" height="72" rx="3" fill="#6BA0FF"/>
|
|
257
|
+
<rect x="25" y="24" width="33" height="13" rx="3" fill="#6BA0FF"/>
|
|
258
|
+
<rect x="25" y="52" width="26" height="12" rx="3" fill="#6BA0FF"/>
|
|
259
|
+
<path d="M101 42 C101 32 91 28 83 28 C73 28 67 35 67 44 C67 52 75 56 84 59 C93 62 101 66 101 76 C101 86 91 91 83 91 C73 91 67 85 66 77" fill="none" stroke="#6BA0FF" stroke-width="13" stroke-linecap="round" stroke-linejoin="round"/>
|
|
260
|
+
</svg>
|
|
261
|
+
</div>
|
|
262
|
+
<div class="login-h">Welcome back</div>
|
|
263
|
+
<div class="login-sub">Sign in to continue</div>
|
|
264
|
+
|
|
265
|
+
<div class="w-field">
|
|
266
|
+
<label>Phone or email</label>
|
|
267
|
+
<div class="w-input"><span class="ico">✉</span><span class="ph">you@example.com</span></div>
|
|
268
|
+
</div>
|
|
269
|
+
<div class="w-field">
|
|
270
|
+
<label>Password</label>
|
|
271
|
+
<div class="w-input focus"><span class="ico">🔒</span><span class="dots">••••••••</span></div>
|
|
272
|
+
</div>
|
|
273
|
+
<div class="forgot" style="text-align:center;">Need help?</div>
|
|
274
|
+
<button class="w-btn">Sign in →</button>
|
|
275
|
+
|
|
276
|
+
<div class="lang-toggle">
|
|
277
|
+
<div class="lang-pill"><span class="on">EN</span><span>AR</span></div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
</div>
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
<!-- ============ HOME ============ -->
|
|
285
|
+
<div class="screen-col">
|
|
286
|
+
<div class="screen-label"><div class="nm">Home</div><div class="sub">Greeting, gradient hero card, and an items list.</div></div>
|
|
287
|
+
<div class="phone">
|
|
288
|
+
<div class="notch"></div>
|
|
289
|
+
<div class="screen">
|
|
290
|
+
<div class="statusbar"><span>9:41</span><div class="ico-row"><span>⏹</span><span class="bar-ico"></span></div></div>
|
|
291
|
+
<div class="scr-body home-scroll">
|
|
292
|
+
<div class="anno left" style="top:64px; left:-20px;"><span class="tip"></span><span class="lead l"></span><span class="bub">Small logo + greeting</span></div>
|
|
293
|
+
<div class="anno right" style="top:178px; left:230px;"><span class="tip"></span><span class="lead"></span><span class="bub">Gradient hero card</span></div>
|
|
294
|
+
<div class="anno left" style="top:470px; left:-22px;"><span class="tip"></span><span class="lead l"></span><span class="bub">FlashList rows + loading state</span></div>
|
|
295
|
+
|
|
296
|
+
<div class="top-bar">
|
|
297
|
+
<div style="display:flex; align-items:center; gap:11px;">
|
|
298
|
+
<span class="logo-sm">
|
|
299
|
+
<svg width="34" height="34" viewBox="0 0 120 120" fill="none" role="img" aria-label="App logo">
|
|
300
|
+
<defs><linearGradient id="chipHome" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#0A1230"/><stop offset="1" stop-color="#1B45B8"/></linearGradient></defs>
|
|
301
|
+
<rect width="120" height="120" rx="30" fill="url(#chipHome)"/>
|
|
302
|
+
<rect x="25" y="24" width="13" height="72" rx="3" fill="#6BA0FF"/>
|
|
303
|
+
<rect x="25" y="24" width="33" height="13" rx="3" fill="#6BA0FF"/>
|
|
304
|
+
<rect x="25" y="52" width="26" height="12" rx="3" fill="#6BA0FF"/>
|
|
305
|
+
<path d="M101 42 C101 32 91 28 83 28 C73 28 67 35 67 44 C67 52 75 56 84 59 C93 62 101 66 101 76 C101 86 91 91 83 91 C73 91 67 85 66 77" fill="none" stroke="#6BA0FF" stroke-width="13" stroke-linecap="round" stroke-linejoin="round"/>
|
|
306
|
+
</svg>
|
|
307
|
+
</span>
|
|
308
|
+
<div><div class="h-greet">Welcome,</div><div class="h-name">Hi, Alex</div></div>
|
|
309
|
+
</div>
|
|
310
|
+
<div style="display:flex; align-items:center; gap:10px;">
|
|
311
|
+
<span class="bell" aria-label="Notifications"><svg viewBox="0 0 24 24" fill="none" stroke="#A6C4FF" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M10 5a2 2 0 0 1 4 0 7 7 0 0 1 4 6v3a4 4 0 0 0 2 3H4a4 4 0 0 0 2-3v-3a7 7 0 0 1 4-6"/><path d="M9 17v1a3 3 0 0 0 6 0v-1"/></svg></span>
|
|
312
|
+
<div class="avatar-sm">AD</div>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
|
|
316
|
+
<div class="hero-card">
|
|
317
|
+
<div class="lab">GET STARTED</div>
|
|
318
|
+
<div class="amt" style="font-size:23px;">Build something great</div>
|
|
319
|
+
<div class="row">
|
|
320
|
+
<span class="hsub">Your starter is ready to ship.</span>
|
|
321
|
+
<span class="chip">Explore →</span>
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
|
|
325
|
+
<div class="sec-title">Items <span class="more">See all</span></div>
|
|
326
|
+
|
|
327
|
+
<div class="cat-card">
|
|
328
|
+
<div class="cat-ico grad-ico">A</div>
|
|
329
|
+
<div class="cat-body"><div class="t">Item one</div><div class="d">A short description line</div></div>
|
|
330
|
+
<span class="chev">›</span>
|
|
331
|
+
</div>
|
|
332
|
+
|
|
333
|
+
<div class="cat-card">
|
|
334
|
+
<div class="cat-ico grad-ico">B</div>
|
|
335
|
+
<div class="cat-body"><div class="t">Item two</div><div class="d">A short description line</div></div>
|
|
336
|
+
<span class="chev">›</span>
|
|
337
|
+
</div>
|
|
338
|
+
|
|
339
|
+
<div class="cat-card">
|
|
340
|
+
<div class="cat-ico grad-ico">C</div>
|
|
341
|
+
<div class="cat-body"><div class="t">Item three</div><div class="d">A short description line</div></div>
|
|
342
|
+
<span class="chev">›</span>
|
|
343
|
+
</div>
|
|
344
|
+
|
|
345
|
+
<div class="sh-card">
|
|
346
|
+
<div class="sh chip"></div>
|
|
347
|
+
<div style="flex:1;"><div class="sh l1"></div><div class="sh l2"></div></div>
|
|
348
|
+
</div>
|
|
349
|
+
</div>
|
|
350
|
+
</div>
|
|
351
|
+
</div>
|
|
352
|
+
</div>
|
|
353
|
+
|
|
354
|
+
<!-- ============ PROFILE ============ -->
|
|
355
|
+
<div class="screen-col">
|
|
356
|
+
<div class="screen-label"><div class="nm">Profile</div><div class="sub">Identity, settings rows, and sign-out.</div></div>
|
|
357
|
+
<!-- profile-frame -->
|
|
358
|
+
<div class="phone">
|
|
359
|
+
<div class="notch"></div>
|
|
360
|
+
<div class="screen">
|
|
361
|
+
<div class="statusbar"><span>9:41</span><div class="ico-row"><span>⏹</span><span class="bar-ico"></span></div></div>
|
|
362
|
+
<div class="scr-body">
|
|
363
|
+
<div class="anno right" style="top:104px; left:232px;"><span class="tip"></span><span class="lead"></span><span class="bub">Initials avatar</span></div>
|
|
364
|
+
<div class="anno left" style="top:300px; left:-18px;"><span class="tip"></span><span class="lead l"></span><span class="bub">Language & theme toggles</span></div>
|
|
365
|
+
<div class="anno right" style="top:560px; left:232px;"><span class="tip"></span><span class="lead"></span><span class="bub">Destructive log-out</span></div>
|
|
366
|
+
|
|
367
|
+
<div class="prof-head">
|
|
368
|
+
<div class="prof-av">AD</div>
|
|
369
|
+
</div>
|
|
370
|
+
<div class="info-card">
|
|
371
|
+
<div class="pn">Alex Doe</div>
|
|
372
|
+
<div class="pm">@alexdoe</div>
|
|
373
|
+
</div>
|
|
374
|
+
|
|
375
|
+
<div style="margin-top:14px;">
|
|
376
|
+
<div class="prow">
|
|
377
|
+
<div class="pico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/></svg></div>
|
|
378
|
+
<div class="pbody"><div class="pt">Edit profile</div><div class="pv">Name, avatar & details</div></div>
|
|
379
|
+
<span class="chev">›</span>
|
|
380
|
+
</div>
|
|
381
|
+
|
|
382
|
+
<div class="prow">
|
|
383
|
+
<div class="pico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 18 0 9 9 0 1 0 -18 0"/><path d="M3.6 9h16.8M3.6 15h16.8M11.5 3a17 17 0 0 0 0 18M12.5 3a17 17 0 0 1 0 18"/></svg></div>
|
|
384
|
+
<div class="pbody"><div class="pt">Language</div><div class="pv">English</div></div>
|
|
385
|
+
<div class="seg"><b class="on">EN</b><b>AR</b></div>
|
|
386
|
+
</div>
|
|
387
|
+
|
|
388
|
+
<div class="prow">
|
|
389
|
+
<div class="pico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M5.6 18.4l1.4-1.4M17 7l1.4-1.4"/></svg></div>
|
|
390
|
+
<div class="pbody"><div class="pt">Appearance</div><div class="pv">System</div></div>
|
|
391
|
+
<div class="seg"><b class="on">Sys</b><b>Light</b><b>Dark</b></div>
|
|
392
|
+
</div>
|
|
393
|
+
|
|
394
|
+
<div class="prow">
|
|
395
|
+
<div class="pico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M10 5a2 2 0 0 1 4 0 7 7 0 0 1 4 6v3a4 4 0 0 0 2 3H4a4 4 0 0 0 2-3v-3a7 7 0 0 1 4-6"/><path d="M9 17v1a3 3 0 0 0 6 0v-1"/></svg></div>
|
|
396
|
+
<div class="pbody"><div class="pt">Notifications</div><div class="pv">Push enabled</div></div>
|
|
397
|
+
<span class="chev">›</span>
|
|
398
|
+
</div>
|
|
399
|
+
</div>
|
|
400
|
+
|
|
401
|
+
<button class="w-btn danger" style="margin-top:14px;">Log out</button>
|
|
402
|
+
</div>
|
|
403
|
+
</div>
|
|
404
|
+
</div>
|
|
405
|
+
</div>
|
|
406
|
+
|
|
407
|
+
</div>
|
|
408
|
+
</div>
|
|
409
|
+
|
|
410
|
+
</body>
|
|
411
|
+
</html>
|
package/template/index.js
CHANGED
|
@@ -2,9 +2,19 @@
|
|
|
2
2
|
* @format
|
|
3
3
|
*/
|
|
4
4
|
import 'react-native-gesture-handler';
|
|
5
|
+
import messaging from '@react-native-firebase/messaging';
|
|
5
6
|
import {AppRegistry} from 'react-native';
|
|
6
7
|
import App from './App';
|
|
7
8
|
import {name as appName} from './app.json';
|
|
9
|
+
import {queueNotificationRouteFromBackgroundData} from './src/core/notifications/notificationService';
|
|
8
10
|
import './src/sheetManager/sheets';
|
|
9
11
|
|
|
12
|
+
// Background / headless FCM handler. Must be registered BEFORE AppRegistry.
|
|
13
|
+
// Queues the route so it can be applied once the UI is ready and the user is logged in.
|
|
14
|
+
messaging().setBackgroundMessageHandler(async remoteMessage => {
|
|
15
|
+
if (remoteMessage?.data) {
|
|
16
|
+
queueNotificationRouteFromBackgroundData(remoteMessage.data);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
10
20
|
AppRegistry.registerComponent(appName, () => App);
|
package/template/jest.config.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
preset: 'react-native',
|
|
2
|
+
preset: '@react-native/jest-preset',
|
|
3
|
+
setupFiles: ['./jest.setup.js'],
|
|
4
|
+
moduleNameMapper: {
|
|
5
|
+
'^@core/(.*)$': '<rootDir>/src/core/$1',
|
|
6
|
+
'^@common/(.*)$': '<rootDir>/src/common/$1',
|
|
7
|
+
'^@navigation/(.*)$': '<rootDir>/src/navigation/$1',
|
|
8
|
+
'^@screens/(.*)$': '<rootDir>/src/screens/$1',
|
|
9
|
+
'^@sheetManager/(.*)$': '<rootDir>/src/sheetManager/$1',
|
|
10
|
+
'^@design-system$': '<rootDir>/src/design-system',
|
|
11
|
+
'^@design-system/(.*)$': '<rootDir>/src/design-system/$1',
|
|
12
|
+
'^@types/(.*)$': '<rootDir>/src/types/$1',
|
|
13
|
+
'^@utils/(.*)$': '<rootDir>/src/utils/$1',
|
|
14
|
+
},
|
|
15
|
+
transformIgnorePatterns: [
|
|
16
|
+
'node_modules/(?!(jest-)?@?react-native|@react-native-community|@react-navigation|@react-native-firebase|@gorhom|@shopify/flash-list|react-native-reanimated|react-native-worklets)',
|
|
17
|
+
],
|
|
3
18
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* eslint-env jest */
|
|
2
|
+
|
|
3
|
+
require('react-native-gesture-handler/jestSetup');
|
|
4
|
+
|
|
5
|
+
jest.mock('@react-native-async-storage/async-storage', () =>
|
|
6
|
+
require('@react-native-async-storage/async-storage/jest/async-storage-mock'),
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
jest.mock('react-native-safe-area-context', () => {
|
|
10
|
+
const mock = require('react-native-safe-area-context/jest/mock');
|
|
11
|
+
return mock.default || mock;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
jest.mock('react-native-config', () => ({
|
|
15
|
+
API_BASE_URL: 'http://localhost:3000',
|
|
16
|
+
ENVIRONMENT: 'test',
|
|
17
|
+
APP_ID: 'com.test.app',
|
|
18
|
+
ANDROID_APP_ID: 'com.test.app',
|
|
19
|
+
BUNDLE_ID: 'com.test.app',
|
|
20
|
+
STORYBOOK: 'false',
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
jest.mock('@react-native-firebase/messaging', () => {
|
|
24
|
+
const messaging = () => ({
|
|
25
|
+
requestPermission: jest.fn().mockResolvedValue(1),
|
|
26
|
+
getToken: jest.fn().mockResolvedValue('test-fcm-token'),
|
|
27
|
+
onMessage: jest.fn().mockReturnValue(() => {}),
|
|
28
|
+
onNotificationOpenedApp: jest.fn().mockReturnValue(() => {}),
|
|
29
|
+
getInitialNotification: jest.fn().mockResolvedValue(null),
|
|
30
|
+
onTokenRefresh: jest.fn().mockReturnValue(() => {}),
|
|
31
|
+
setBackgroundMessageHandler: jest.fn(),
|
|
32
|
+
});
|
|
33
|
+
messaging.setBackgroundMessageHandler = jest.fn();
|
|
34
|
+
return {__esModule: true, default: messaging};
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
jest.mock('@react-native-community/netinfo', () => ({
|
|
38
|
+
__esModule: true,
|
|
39
|
+
default: {
|
|
40
|
+
addEventListener: jest.fn().mockReturnValue(() => {}),
|
|
41
|
+
fetch: jest.fn().mockResolvedValue({
|
|
42
|
+
isConnected: true,
|
|
43
|
+
isInternetReachable: true,
|
|
44
|
+
}),
|
|
45
|
+
},
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
jest.mock('react-native-snackbar', () => ({
|
|
49
|
+
__esModule: true,
|
|
50
|
+
default: {
|
|
51
|
+
show: jest.fn(),
|
|
52
|
+
dismiss: jest.fn(),
|
|
53
|
+
LENGTH_SHORT: 1,
|
|
54
|
+
LENGTH_LONG: 2,
|
|
55
|
+
LENGTH_INDEFINITE: 3,
|
|
56
|
+
},
|
|
57
|
+
}));
|
|
58
|
+
|
|
59
|
+
jest.mock('react-native-reanimated', () =>
|
|
60
|
+
require('react-native-reanimated/mock'),
|
|
61
|
+
);
|