@brightlayer-ui/react-native-template-authentication-typescript 3.0.0-alpha.0 → 3.0.0-alpha.1
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/package.json +1 -1
- package/template/Gemfile.lock +3 -1
- package/template/_gitignore +74 -0
- package/template/jest.config.js +9 -0
- package/template/jestSetupFile.js +38 -0
- package/template/package.json +2 -1
- package/template/src/navigation/navigation-drawer.tsx +23 -18
- package/template/yarn.lock +9 -4
package/package.json
CHANGED
package/template/Gemfile.lock
CHANGED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# OSX
|
|
2
|
+
#
|
|
3
|
+
.DS_Store
|
|
4
|
+
|
|
5
|
+
# Xcode
|
|
6
|
+
#
|
|
7
|
+
build/
|
|
8
|
+
*.pbxuser
|
|
9
|
+
!default.pbxuser
|
|
10
|
+
*.mode1v3
|
|
11
|
+
!default.mode1v3
|
|
12
|
+
*.mode2v3
|
|
13
|
+
!default.mode2v3
|
|
14
|
+
*.perspectivev3
|
|
15
|
+
!default.perspectivev3
|
|
16
|
+
xcuserdata
|
|
17
|
+
*.xccheckout
|
|
18
|
+
*.moved-aside
|
|
19
|
+
DerivedData
|
|
20
|
+
*.hmap
|
|
21
|
+
*.ipa
|
|
22
|
+
*.xcuserstate
|
|
23
|
+
**/.xcode.env.local
|
|
24
|
+
|
|
25
|
+
# Android/IntelliJ
|
|
26
|
+
#
|
|
27
|
+
build/
|
|
28
|
+
.idea
|
|
29
|
+
.gradle
|
|
30
|
+
local.properties
|
|
31
|
+
*.iml
|
|
32
|
+
*.hprof
|
|
33
|
+
.cxx/
|
|
34
|
+
*.keystore
|
|
35
|
+
!debug.keystore
|
|
36
|
+
|
|
37
|
+
# node.js
|
|
38
|
+
#
|
|
39
|
+
node_modules/
|
|
40
|
+
npm-debug.log
|
|
41
|
+
yarn-error.log
|
|
42
|
+
|
|
43
|
+
# fastlane
|
|
44
|
+
#
|
|
45
|
+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
|
|
46
|
+
# screenshots whenever they are needed.
|
|
47
|
+
# For more information about the recommended setup visit:
|
|
48
|
+
# https://docs.fastlane.tools/best-practices/source-control/
|
|
49
|
+
|
|
50
|
+
**/fastlane/report.xml
|
|
51
|
+
**/fastlane/Preview.html
|
|
52
|
+
**/fastlane/screenshots
|
|
53
|
+
**/fastlane/test_output
|
|
54
|
+
|
|
55
|
+
# Bundle artifact
|
|
56
|
+
*.jsbundle
|
|
57
|
+
|
|
58
|
+
# Ruby / CocoaPods
|
|
59
|
+
**/Pods/
|
|
60
|
+
/vendor/bundle/
|
|
61
|
+
|
|
62
|
+
# Temporary files created by Metro to check the health of the file watcher
|
|
63
|
+
.metro-health-check*
|
|
64
|
+
|
|
65
|
+
# testing
|
|
66
|
+
/coverage
|
|
67
|
+
|
|
68
|
+
# Yarn
|
|
69
|
+
.yarn/*
|
|
70
|
+
!.yarn/patches
|
|
71
|
+
!.yarn/plugins
|
|
72
|
+
!.yarn/releases
|
|
73
|
+
!.yarn/sdks
|
|
74
|
+
!.yarn/versions
|
package/template/jest.config.js
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
preset: 'react-native',
|
|
3
|
+
transformIgnorePatterns: [
|
|
4
|
+
'node_modules/(?!(|react-native|@react-native/*|@brightlayer-ui/react-native-components|react-native-select-dropdown|react-native-vector-icons|react-native-reanimated|react-native-animatable|react-native-iphone-x-helper|react-native-modal|react-native-safe-area-context|react-native-keyboard-aware-scroll-view|react-native-collapsible|@react-native/polyfills|react-native-status-bar-height|react-native-webview|react-native-webview/*)/)',
|
|
5
|
+
],
|
|
6
|
+
setupFiles: ['./jestSetupFile.js', './node_modules/react-native-gesture-handler/jestSetup.js'],
|
|
7
|
+
moduleNameMapper: {
|
|
8
|
+
'\\.svg': '<rootDir>/__mocks__/svgMock.js',
|
|
9
|
+
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
|
|
10
|
+
'\\.(css|less)$': 'identity-obj-proxy',
|
|
11
|
+
},
|
|
3
12
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import 'react-native-gesture-handler/jestSetup';
|
|
2
|
+
|
|
3
|
+
jest.useFakeTimers();
|
|
4
|
+
|
|
5
|
+
// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing
|
|
6
|
+
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
|
|
7
|
+
|
|
8
|
+
import mockSafeAreaContext from 'react-native-safe-area-context/jest/mock';
|
|
9
|
+
jest.mock('react-i18next', () => ({
|
|
10
|
+
useTranslation: () => ({ t: (key) => key }),
|
|
11
|
+
...jest.requireActual('react-i18next'),
|
|
12
|
+
}));
|
|
13
|
+
jest.mock('@react-native-async-storage/async-storage', () =>
|
|
14
|
+
require('@react-native-async-storage/async-storage/jest/async-storage-mock')
|
|
15
|
+
);
|
|
16
|
+
jest.mock('react-native-reanimated', () => require('react-native-reanimated/mock'));
|
|
17
|
+
jest.mock('react-native-safe-area-context', () => mockSafeAreaContext);
|
|
18
|
+
jest.mock('react-native-webview', () => {
|
|
19
|
+
const { View } = require('react-native');
|
|
20
|
+
return {
|
|
21
|
+
WebView: View,
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
jest.mock('react-native', () => {
|
|
25
|
+
const RN = jest.requireActual('react-native');
|
|
26
|
+
|
|
27
|
+
RN.NativeModules.SettingsManager = {
|
|
28
|
+
settings: {
|
|
29
|
+
AppleLocale: 'en-US',
|
|
30
|
+
AppleLanguages: ['fr-FR', 'en-US'],
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
return RN;
|
|
34
|
+
});
|
|
35
|
+
jest.mock('react-native-keyboard-aware-scroll-view', () => {
|
|
36
|
+
const KeyboardAwareScrollView = ({ children }) => children;
|
|
37
|
+
return { KeyboardAwareScrollView };
|
|
38
|
+
});
|
package/template/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "jest"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@brightlayer-ui/react-native-auth-workflow": "6.0.0
|
|
15
|
+
"@brightlayer-ui/react-native-auth-workflow": "^6.0.0",
|
|
16
16
|
"@brightlayer-ui/react-native-components": "^8.0.2",
|
|
17
17
|
"@brightlayer-ui/react-native-themes": "^7.0.0",
|
|
18
18
|
"@brightlayer-ui/react-native-vector-icons": "^2.2.0",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
59
59
|
"globals": "^15.1.0",
|
|
60
60
|
"jest": "^29.6.3",
|
|
61
|
+
"jest-transform-stub": "^2.0.0",
|
|
61
62
|
"prettier": "2.8.8",
|
|
62
63
|
"react-test-renderer": "18.2.0",
|
|
63
64
|
"typescript": "5.0.4",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Drawer, DrawerBody, DrawerHeader, DrawerNavGroup
|
|
1
|
+
import { Drawer, DrawerBody, DrawerHeader, DrawerNavGroup } from '@brightlayer-ui/react-native-components';
|
|
2
2
|
import React, { useState, useCallback, useEffect } from 'react';
|
|
3
3
|
import { RootStackParamList } from './index';
|
|
4
4
|
import { DrawerActions } from '@react-navigation/native';
|
|
@@ -14,9 +14,11 @@ export const NavigationDrawer: React.FC<NavDrawerProps> = ({ navigation }) => {
|
|
|
14
14
|
const [selected, setSelected] = useState('Home');
|
|
15
15
|
const { t } = useTranslation();
|
|
16
16
|
const navigationState = navigation.getState();
|
|
17
|
+
|
|
17
18
|
const Homepage: IconFamily = { family: 'material', name: 'home', direction: 'ltr' };
|
|
18
19
|
const Dashboard: IconFamily = { family: 'material', name: 'dashboard', direction: 'ltr' };
|
|
19
20
|
const Notifications: IconFamily = { family: 'material', name: 'notifications', direction: 'ltr' };
|
|
21
|
+
|
|
20
22
|
const selectItem = useCallback(
|
|
21
23
|
(id: any) => {
|
|
22
24
|
navigation.navigate(id);
|
|
@@ -25,23 +27,26 @@ export const NavigationDrawer: React.FC<NavDrawerProps> = ({ navigation }) => {
|
|
|
25
27
|
[navigation]
|
|
26
28
|
);
|
|
27
29
|
|
|
28
|
-
const navGroupItems
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
const navGroupItems = React.useMemo(
|
|
31
|
+
() => [
|
|
32
|
+
{
|
|
33
|
+
title: `${t('TOOLBAR_MENU.HOME_PAGE')}`,
|
|
34
|
+
itemID: 'Homepage',
|
|
35
|
+
icon: Homepage,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
title: `${t('DRAWER_MENU.DASHBOARD')}`,
|
|
39
|
+
itemID: 'Dashboard',
|
|
40
|
+
icon: Dashboard,
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: `${t('DRAWER_MENU.LOCATIONS')}`,
|
|
44
|
+
itemID: 'Locations',
|
|
45
|
+
icon: Notifications,
|
|
46
|
+
},
|
|
47
|
+
], // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
|
+
[]
|
|
49
|
+
);
|
|
45
50
|
|
|
46
51
|
useEffect(() => {
|
|
47
52
|
const id = navGroupItems[navigationState.index]?.itemID;
|
package/template/yarn.lock
CHANGED
|
@@ -1191,10 +1191,10 @@
|
|
|
1191
1191
|
resolved "https://registry.yarnpkg.com/@brightlayer-ui/prettier-config/-/prettier-config-1.0.3.tgz#e40a7ae7435c6fd5118acbf249080e0aa81e93af"
|
|
1192
1192
|
integrity sha512-EYm3+V7Qd+oYEF+8FadsXAZqXryEHHbGnrV1BMp9selhABjceqUqXPVE4Sn3SKWQdBNJ3En2A3EzgrzRbvRTaw==
|
|
1193
1193
|
|
|
1194
|
-
"@brightlayer-ui/react-native-auth-workflow
|
|
1195
|
-
version "6.0.0
|
|
1196
|
-
resolved "https://registry.yarnpkg.com/@brightlayer-ui/react-native-auth-workflow/-/react-native-auth-workflow-6.0.0
|
|
1197
|
-
integrity sha512-
|
|
1194
|
+
"@brightlayer-ui/react-native-auth-workflow@^6.0.0":
|
|
1195
|
+
version "6.0.0"
|
|
1196
|
+
resolved "https://registry.yarnpkg.com/@brightlayer-ui/react-native-auth-workflow/-/react-native-auth-workflow-6.0.0.tgz#c47908851deefb12024dd40549fb1d0874d941ef"
|
|
1197
|
+
integrity sha512-bS00LNOQytAxVFuSMnx5dLynhVbtwLCaBOqKC0K6AHfSkzhwqv8/J9+cNmJKoZTxBgJlTNYo452obMgC/YAMzQ==
|
|
1198
1198
|
dependencies:
|
|
1199
1199
|
color "^4.2.3"
|
|
1200
1200
|
lodash.clonedeep "^4.5.0"
|
|
@@ -4867,6 +4867,11 @@ jest-snapshot@^29.7.0:
|
|
|
4867
4867
|
pretty-format "^29.7.0"
|
|
4868
4868
|
semver "^7.5.3"
|
|
4869
4869
|
|
|
4870
|
+
jest-transform-stub@^2.0.0:
|
|
4871
|
+
version "2.0.0"
|
|
4872
|
+
resolved "https://registry.yarnpkg.com/jest-transform-stub/-/jest-transform-stub-2.0.0.tgz#19018b0851f7568972147a5d60074b55f0225a7d"
|
|
4873
|
+
integrity sha512-lspHaCRx/mBbnm3h4uMMS3R5aZzMwyNpNIJLXj4cEsV0mIUtS4IjYJLSoyjRCtnxb6RIGJ4NL2quZzfIeNhbkg==
|
|
4874
|
+
|
|
4870
4875
|
jest-util@^29.7.0:
|
|
4871
4876
|
version "29.7.0"
|
|
4872
4877
|
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.7.0.tgz#23c2b62bfb22be82b44de98055802ff3710fc0bc"
|