@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlayer-ui/react-native-template-authentication-typescript",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-alpha.1",
4
4
  "author": "brightlayer-ui <brightlayer-ui@eaton.com>",
5
5
  "keywords": [
6
6
  "react native",
@@ -76,8 +76,10 @@ GEM
76
76
  netrc (0.11.0)
77
77
  nkf (0.2.0)
78
78
  public_suffix (4.0.7)
79
- rexml (3.2.6)
79
+ rexml (3.2.8)
80
+ strscan (>= 3.0.9)
80
81
  ruby-macho (2.5.1)
82
+ strscan (3.1.0)
81
83
  typhoeus (1.4.1)
82
84
  ethon (>= 0.9.0)
83
85
  tzinfo (2.0.6)
@@ -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
@@ -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
+ });
@@ -12,7 +12,7 @@
12
12
  "test": "jest"
13
13
  },
14
14
  "dependencies": {
15
- "@brightlayer-ui/react-native-auth-workflow": "6.0.0-alpha.2",
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, NavItem } from '@brightlayer-ui/react-native-components';
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: NavItem[] = [
29
- {
30
- title: `${t('TOOLBAR_MENU.HOME_PAGE')}`,
31
- itemID: 'Homepage',
32
- icon: Homepage,
33
- },
34
- {
35
- title: `${t('DRAWER_MENU.DASHBOARD')}`,
36
- itemID: 'Dashboard',
37
- icon: Dashboard,
38
- },
39
- {
40
- title: `${t('DRAWER_MENU.LOCATIONS')}`,
41
- itemID: 'Locations',
42
- icon: Notifications,
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;
@@ -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@6.0.0-alpha.2":
1195
- version "6.0.0-alpha.2"
1196
- resolved "https://registry.yarnpkg.com/@brightlayer-ui/react-native-auth-workflow/-/react-native-auth-workflow-6.0.0-alpha.2.tgz#c7dbad553f784a803a1221d981a5f25a1b787650"
1197
- integrity sha512-adcGDW+9Z+ST01gPy36U6DXfJEp4RXKV/ldrdkMuMBZghqgWwYc0woMuwVtJY2daaG91VsT8hWftNRiehdDiuw==
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"