@brightlayer-ui/react-native-template-authentication-typescript 2.1.0 → 3.0.0-alpha.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/README.md +22 -17
- package/package.json +3 -3
- package/template/.bundle/config +2 -0
- package/template/.eslintrc.js +57 -0
- package/template/.prettierrc.js +7 -0
- package/template/.watchmanconfig +1 -0
- package/template/App.tsx +85 -47
- package/template/Gemfile +9 -0
- package/template/Gemfile.lock +105 -0
- package/template/README.md +79 -0
- package/template/__tests__/App.test.tsx +17 -0
- package/template/android/app/build.gradle +120 -0
- package/template/android/app/debug.keystore +0 -0
- package/template/android/app/proguard-rules.pro +10 -0
- package/template/android/app/src/debug/AndroidManifest.xml +9 -0
- package/template/android/app/src/main/AndroidManifest.xml +25 -0
- package/template/android/app/src/main/java/com/workflow/MainActivity.kt +28 -0
- package/template/android/app/src/main/java/com/workflow/MainApplication.kt +43 -0
- package/template/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/template/android/app/src/main/res/values/strings.xml +3 -0
- package/template/android/app/src/main/res/values/styles.xml +9 -0
- package/template/android/build.gradle +21 -0
- package/template/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/template/android/gradle.properties +41 -0
- package/template/android/gradlew +249 -0
- package/template/android/gradlew.bat +92 -0
- package/template/android/link-assets-manifest.json +25 -0
- package/template/android/settings.gradle +4 -0
- package/template/app.json +4 -0
- package/template/assets/fonts/OpenSans-Bold.ttf +0 -0
- package/template/assets/fonts/OpenSans-ExtraBold.ttf +0 -0
- package/template/assets/fonts/OpenSans-Light.ttf +0 -0
- package/template/assets/fonts/OpenSans-Regular.ttf +0 -0
- package/template/assets/fonts/OpenSans-SemiBold.ttf +0 -0
- package/template/assets/images/Logo.png +0 -0
- package/template/babel.config.js +1 -2
- package/template/eslint.config.mjs +10 -0
- package/template/index.js +11 -0
- package/template/ios/.xcode.env +11 -0
- package/template/ios/Podfile +40 -0
- package/template/ios/Podfile.lock +1496 -0
- package/template/ios/blankTemplate/AppDelegate.h +6 -0
- package/template/ios/blankTemplate/AppDelegate.mm +31 -0
- package/template/ios/blankTemplate/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/template/ios/blankTemplate/Images.xcassets/Contents.json +6 -0
- package/template/ios/blankTemplate/Info.plist +75 -0
- package/template/ios/blankTemplate/LaunchScreen.storyboard +47 -0
- package/template/ios/blankTemplate/PrivacyInfo.xcprivacy +37 -0
- package/template/ios/blankTemplate/main.m +10 -0
- package/template/ios/blankTemplate.xcodeproj/project.pbxproj +741 -0
- package/template/ios/blankTemplate.xcodeproj/xcshareddata/xcschemes/blankTemplate.xcscheme +88 -0
- package/template/ios/blankTemplate.xcworkspace/contents.xcworkspacedata +10 -0
- package/template/ios/blankTemplate.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/template/ios/blankTemplateTests/Info.plist +24 -0
- package/template/ios/blankTemplateTests/blankTemplateTests.m +66 -0
- package/template/ios/link-assets-manifest.json +25 -0
- package/template/jest.config.js +3 -0
- package/template/metro.config.js +7 -25
- package/template/package.json +70 -0
- package/template/src/actions/AuthUIActions.tsx +10 -11
- package/template/src/actions/RegistrationUIActions.tsx +37 -30
- package/template/src/assets/images/eaton_stacked_logo.png +0 -0
- package/template/src/components/AuthCustomScreen.tsx +50 -0
- package/template/src/components/CustomScreen.tsx +77 -0
- package/template/src/components/DebugComponent.tsx +49 -0
- package/template/src/components/ForgotPasswordScreenBaseExample.tsx +42 -0
- package/template/src/components/ResetPasswordScreenBaseExample.tsx +41 -0
- package/template/src/components/UserMenuExample.tsx +117 -0
- package/template/src/contexts/AppContextProvider.tsx +28 -0
- package/template/src/contexts/ThemeContext.ts +15 -0
- package/template/src/navigation/index.tsx +205 -22
- package/template/src/navigation/navigation-drawer.tsx +38 -25
- package/template/src/screens/ChangePassword.tsx +15 -0
- package/template/src/screens/Dashboard.tsx +137 -0
- package/template/src/screens/Homepage.tsx +135 -0
- package/template/src/screens/Locations.tsx +137 -0
- package/template/src/screens/Login.tsx +17 -0
- package/template/src/screens/Registration.tsx +4 -0
- package/template/src/screens/RegistrationInvite.tsx +5 -0
- package/template/src/screens/index.ts +12 -0
- package/template/src/store/local-storage.ts +4 -4
- package/template/translations/dictionary/chinese.ts +29 -0
- package/template/translations/dictionary/english.ts +29 -0
- package/template/translations/dictionary/french.ts +29 -0
- package/template/translations/dictionary/index.ts +19 -0
- package/template/translations/dictionary/portuguese.ts +29 -0
- package/template/translations/dictionary/spanish.ts +29 -0
- package/template/translations/dictionary/types.ts +27 -0
- package/template/translations/i18n.ts +58 -0
- package/template/tsconfig.json +60 -0
- package/template/yarn.lock +7341 -0
- package/template.config.js +4 -0
- package/CHANGELOG.md +0 -69
- package/dependencies.json +0 -31
- package/images/Logo.svg +0 -11
- package/template/__mocks__/svgMock.js +0 -8
- package/template/jestSetupFile.js +0 -17
- package/template/react-native.config.js +0 -3
- package/template/src/navigation/DeepLinking.ts +0 -62
- package/template/src/screens/home.tsx +0 -198
- package/template/src/screens/index.tsx +0 -3
- package/template/src/screens/pageOne.tsx +0 -91
- package/template/src/screens/pageTwo.tsx +0 -92
- /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-Bold.ttf +0 -0
- /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-ExtraBold.ttf +0 -0
- /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-Light.ttf +0 -0
- /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-Regular.ttf +0 -0
- /package/{fonts → template/android/app/src/main/assets/fonts}/OpenSans-SemiBold.ttf +0 -0
package/README.md
CHANGED
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
This is an official Brightlayer UI template used internally by the [Brightlayer UI CLI](https://www.npmjs.com/package/@brightlayer-ui/cli).
|
|
6
5
|
|
|
7
6
|
This template installs and configures the Brightlayer UI [react-native-auth-workflow](https://www.npmjs.com/package/@brightlayer-ui/react-native-auth-workflow) package to automatically wrap your main application with functions and screens for Login, Registration, Change Password, etc. This uses the same configurations as the sample project for that package — you will need to replace the API integrations with implementations specific to your API. This template also includes the installation and initial setup of routing using [React Navigation](https://reactnavigation.org/). It includes several placeholder routes/screens and a [Drawer](https://brightlayer-ui-components.github.io/react-native/?path=/info/components-documentation--drawer) navigator from the Brightlayer UI [React Native Component Library](https://www.npmjs.com/package/@brightlayer-ui/react-native-components).
|
|
8
7
|
|
|
9
8
|
## Usage
|
|
10
|
-
|
|
9
|
+
To create a new project using the Authenication Template simply run :
|
|
11
10
|
```sh
|
|
12
|
-
npx -
|
|
11
|
+
npx react-native init MyApp --template @brightlayer-ui/react-native-template-authentication-typescript
|
|
13
12
|
```
|
|
14
13
|
|
|
15
14
|
## Project Structure
|
|
@@ -18,19 +17,25 @@ Projects created using this template will start out with the following file stru
|
|
|
18
17
|
```
|
|
19
18
|
|── /ios // ios project folder
|
|
20
19
|
|── /android // android project folder
|
|
21
|
-
|── /actions
|
|
22
|
-
| |── AuthUIActions.tsx // handles the implementation of the authentication related actions (such as login and forgot password)
|
|
23
|
-
| └── RegistrationUIActions.tsx // handles the implementation of the registration related actions (such as loading the EULA and registration by invitation)
|
|
24
|
-
|── /assets // fonts and images used by the application
|
|
25
20
|
|── App.tsx // app entry point
|
|
26
|
-
|──
|
|
27
|
-
| |──
|
|
28
|
-
|
|
|
29
|
-
|
|
30
|
-
|──
|
|
31
|
-
| |──
|
|
32
|
-
| |──
|
|
33
|
-
| └──
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
|── src
|
|
22
|
+
| |── actions
|
|
23
|
+
| | |── AuthUIActions.tsx // handles the implementation of the authentication related actions (such as login and forgot password)
|
|
24
|
+
| | └── RegistrationUIActions.tsx // handles the implementation of the registration related actions (such as loading the EULA and registration by invitation)
|
|
25
|
+
| |── assets // fonts and images used by the application
|
|
26
|
+
| |── constants
|
|
27
|
+
| | |── index.ts // application constants
|
|
28
|
+
| | └── sampleEula.ts // sample Eula
|
|
29
|
+
| |── contexts
|
|
30
|
+
| | |── AppContextProvider.tsx // handles context for Auth
|
|
31
|
+
| | └── ThemeContext.ts // handles context for theme
|
|
32
|
+
| |── screens // sample application pages
|
|
33
|
+
| |── navigation
|
|
34
|
+
| | |── index.tsx // sets up routing
|
|
35
|
+
| | └── navigation-drawer.tsx // sets up Drawer
|
|
36
|
+
| └── store
|
|
37
|
+
| └── local-storage.ts // mock implementation for storing/retrieving user authentication session data
|
|
38
|
+
└──/translations
|
|
39
|
+
|── /dictionary // translation dictionary for i18next
|
|
40
|
+
|── i18n.ts // configuration for i18next
|
|
36
41
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightlayer-ui/react-native-template-authentication-typescript",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.0",
|
|
4
4
|
"author": "brightlayer-ui <brightlayer-ui@eaton.com>",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react native",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"description": "A template with pre-configured login workflow and routing for React Native projects created with the Brightlayer UI CLI.",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/etn-ccis/blui-react-native-cli-templates.git"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
17
|
"publish:package": "set npm_config_yes=true && npx -p @brightlayer-ui/publish blui-publish",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"node": ">=10"
|
|
23
23
|
},
|
|
24
24
|
"bugs": {
|
|
25
|
-
"url": "https://github.com/
|
|
25
|
+
"url": "https://github.com/etn-ccis/blui-react-native-cli-templates/issues"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
parser: '@typescript-eslint/parser',
|
|
4
|
+
extends: ['@brightlayer-ui/eslint-config/tsx'],
|
|
5
|
+
parserOptions: {
|
|
6
|
+
project: './tsconfig.json',
|
|
7
|
+
},
|
|
8
|
+
plugins: ['react-hooks'],
|
|
9
|
+
rules: {
|
|
10
|
+
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
|
|
11
|
+
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
|
|
12
|
+
'react/display-name': 'off',
|
|
13
|
+
'@typescript-eslint/naming-convention': [
|
|
14
|
+
'error',
|
|
15
|
+
{
|
|
16
|
+
selector: 'default',
|
|
17
|
+
format: ['camelCase', 'PascalCase'],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
selector: 'variable',
|
|
21
|
+
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
selector: 'property',
|
|
25
|
+
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
selector: 'property',
|
|
29
|
+
format: null,
|
|
30
|
+
modifiers: ['requiresQuotes'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
selector: 'enumMember',
|
|
34
|
+
format: ['UPPER_CASE'],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
selector: 'parameter',
|
|
38
|
+
format: ['camelCase'],
|
|
39
|
+
leadingUnderscore: 'allow',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
selector: 'memberLike',
|
|
43
|
+
modifiers: ['private'],
|
|
44
|
+
format: ['camelCase'],
|
|
45
|
+
leadingUnderscore: 'require',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
selector: 'typeLike',
|
|
49
|
+
format: ['PascalCase'],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
selector: 'import',
|
|
53
|
+
format: ['camelCase', 'PascalCase'],
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/template/App.tsx
CHANGED
|
@@ -5,60 +5,98 @@
|
|
|
5
5
|
|
|
6
6
|
This code is licensed under the BSD-3 license found in the LICENSE file in the root directory of this source tree and at https://opensource.org/licenses/BSD-3-Clause.
|
|
7
7
|
**/
|
|
8
|
-
import
|
|
8
|
+
import 'react-native-gesture-handler';
|
|
9
|
+
import React, { useEffect, useState } from 'react';
|
|
9
10
|
import { Provider as ThemeProvider } from 'react-native-paper';
|
|
10
11
|
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
11
|
-
import * as BLUIThemes from '@brightlayer-ui/react-native-themes';
|
|
12
12
|
import { MainRouter } from './src/navigation';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
import { authLinkMapping, resolveInitialState } from './src/navigation/DeepLinking';
|
|
23
|
-
|
|
24
|
-
export const AuthUIConfiguration: React.FC = (props) => {
|
|
25
|
-
const securityContextActions = useSecurityActions();
|
|
26
|
-
return (
|
|
27
|
-
<AuthUIContextProvider
|
|
28
|
-
authActions={ProjectAuthUIActions(securityContextActions)}
|
|
29
|
-
registrationActions={ProjectRegistrationUIActions}
|
|
30
|
-
showSelfRegistration={true}
|
|
31
|
-
allowDebugMode={true}
|
|
32
|
-
contactEmail={'something@email.com'}
|
|
33
|
-
contactPhone={'1-800-123-4567'}
|
|
34
|
-
contactPhoneLink={'1-800-123-4567'}
|
|
35
|
-
// projectImage={require('./src/assets/images/some_image.png')}
|
|
36
|
-
>
|
|
37
|
-
{props.children}
|
|
38
|
-
</AuthUIContextProvider>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
13
|
+
import { ThemeContext, ThemeType } from './src/contexts/ThemeContext';
|
|
14
|
+
import { blue, blueDark } from '@brightlayer-ui/react-native-themes';
|
|
15
|
+
import i18nAppInstance from './translations/i18n';
|
|
16
|
+
import { I18nextProvider, useTranslation } from 'react-i18next';
|
|
17
|
+
import { AppContext, AppContextType } from './src/contexts/AppContextProvider';
|
|
18
|
+
import { LocalStorage } from './src/store/local-storage';
|
|
19
|
+
import { Spinner } from '@brightlayer-ui/react-native-auth-workflow';
|
|
20
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
21
|
+
import { NativeModules, Platform } from 'react-native';
|
|
41
22
|
|
|
42
23
|
export const App = (): JSX.Element => {
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
24
|
+
const [theme, setTheme] = useState<ThemeType>('light');
|
|
25
|
+
const [language, setLanguage] = useState('en');
|
|
26
|
+
const [isAuthenticated, setAuthenticated] = useState<AppContextType['isAuthenticated']>(false);
|
|
27
|
+
const [loginData, setLoginData] = useState<AppContextType['loginData']>({
|
|
28
|
+
email: '',
|
|
29
|
+
rememberMe: false,
|
|
30
|
+
});
|
|
31
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
32
|
+
const { i18n } = useTranslation();
|
|
33
|
+
const getLanguage = async (): Promise<void> => {
|
|
34
|
+
try {
|
|
35
|
+
const storedLanguage = await AsyncStorage.getItem('userLanguage');
|
|
36
|
+
if (storedLanguage !== null) {
|
|
37
|
+
setLanguage(storedLanguage);
|
|
38
|
+
void i18n.changeLanguage(storedLanguage);
|
|
39
|
+
} else {
|
|
40
|
+
const locale =
|
|
41
|
+
Platform.OS === 'ios'
|
|
42
|
+
? NativeModules.SettingsManager.settings.AppleLocale
|
|
43
|
+
: NativeModules.I18nManager.localeIdentifier;
|
|
44
|
+
setLanguage(locale?.substring(0, 2) || 'en');
|
|
45
|
+
}
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error('Error getting language from Async Storage:', error);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
// handle initialization of auth data on first load
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const initialize = async (): Promise<void> => {
|
|
53
|
+
try {
|
|
54
|
+
const userData = await LocalStorage.readAuthData();
|
|
55
|
+
setLoginData({ email: userData.rememberMeData.user, rememberMe: userData.rememberMeData.rememberMe });
|
|
56
|
+
setAuthenticated(Boolean(userData.userId));
|
|
57
|
+
await getLanguage();
|
|
58
|
+
} catch (e) {
|
|
59
|
+
// handle any error state, rejected promises, etc..
|
|
60
|
+
} finally {
|
|
61
|
+
setIsLoading(false);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
// eslint-disable-next-line
|
|
65
|
+
initialize();
|
|
66
|
+
// eslint-disable-next-line
|
|
67
|
+
}, []);
|
|
49
68
|
|
|
50
|
-
return (
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
69
|
+
return isLoading ? (
|
|
70
|
+
<Spinner visible={isLoading} />
|
|
71
|
+
) : (
|
|
72
|
+
<ThemeContext.Provider value={{ theme, setTheme }}>
|
|
73
|
+
<I18nextProvider i18n={i18nAppInstance}>
|
|
74
|
+
<AppContext.Provider
|
|
75
|
+
value={{
|
|
76
|
+
isAuthenticated,
|
|
77
|
+
onUserAuthenticated: (userData): void => {
|
|
78
|
+
setAuthenticated(true);
|
|
79
|
+
setLoginData(userData);
|
|
80
|
+
},
|
|
81
|
+
// eslint-disable-next-line
|
|
82
|
+
onUserNotAuthenticated: (userData): void => {
|
|
83
|
+
setAuthenticated(false);
|
|
84
|
+
},
|
|
85
|
+
loginData,
|
|
86
|
+
setLoginData,
|
|
87
|
+
language,
|
|
88
|
+
setLanguage,
|
|
89
|
+
setAuthenticated,
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
<ThemeProvider theme={theme === 'light' ? blue : blueDark}>
|
|
93
|
+
<SafeAreaProvider>
|
|
56
94
|
<MainRouter />
|
|
57
|
-
</
|
|
58
|
-
</
|
|
59
|
-
</
|
|
60
|
-
</
|
|
61
|
-
</
|
|
95
|
+
</SafeAreaProvider>
|
|
96
|
+
</ThemeProvider>
|
|
97
|
+
</AppContext.Provider>
|
|
98
|
+
</I18nextProvider>
|
|
99
|
+
</ThemeContext.Provider>
|
|
62
100
|
);
|
|
63
101
|
};
|
|
64
102
|
|
package/template/Gemfile
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
source 'https://rubygems.org'
|
|
2
|
+
|
|
3
|
+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
|
4
|
+
ruby ">= 2.6.10"
|
|
5
|
+
|
|
6
|
+
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
|
|
7
|
+
# bound in the template on Cocoapods with next React Native release.
|
|
8
|
+
gem 'cocoapods', '>= 1.13', '< 1.15'
|
|
9
|
+
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
GEM
|
|
2
|
+
remote: https://rubygems.org/
|
|
3
|
+
specs:
|
|
4
|
+
CFPropertyList (3.0.7)
|
|
5
|
+
base64
|
|
6
|
+
nkf
|
|
7
|
+
rexml
|
|
8
|
+
activesupport (6.1.7.7)
|
|
9
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
10
|
+
i18n (>= 1.6, < 2)
|
|
11
|
+
minitest (>= 5.1)
|
|
12
|
+
tzinfo (~> 2.0)
|
|
13
|
+
zeitwerk (~> 2.3)
|
|
14
|
+
addressable (2.8.6)
|
|
15
|
+
public_suffix (>= 2.0.2, < 6.0)
|
|
16
|
+
algoliasearch (1.27.5)
|
|
17
|
+
httpclient (~> 2.8, >= 2.8.3)
|
|
18
|
+
json (>= 1.5.1)
|
|
19
|
+
atomos (0.1.3)
|
|
20
|
+
base64 (0.2.0)
|
|
21
|
+
claide (1.1.0)
|
|
22
|
+
cocoapods (1.14.3)
|
|
23
|
+
addressable (~> 2.8)
|
|
24
|
+
claide (>= 1.0.2, < 2.0)
|
|
25
|
+
cocoapods-core (= 1.14.3)
|
|
26
|
+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
|
|
27
|
+
cocoapods-downloader (>= 2.1, < 3.0)
|
|
28
|
+
cocoapods-plugins (>= 1.0.0, < 2.0)
|
|
29
|
+
cocoapods-search (>= 1.0.0, < 2.0)
|
|
30
|
+
cocoapods-trunk (>= 1.6.0, < 2.0)
|
|
31
|
+
cocoapods-try (>= 1.1.0, < 2.0)
|
|
32
|
+
colored2 (~> 3.1)
|
|
33
|
+
escape (~> 0.0.4)
|
|
34
|
+
fourflusher (>= 2.3.0, < 3.0)
|
|
35
|
+
gh_inspector (~> 1.0)
|
|
36
|
+
molinillo (~> 0.8.0)
|
|
37
|
+
nap (~> 1.0)
|
|
38
|
+
ruby-macho (>= 2.3.0, < 3.0)
|
|
39
|
+
xcodeproj (>= 1.23.0, < 2.0)
|
|
40
|
+
cocoapods-core (1.14.3)
|
|
41
|
+
activesupport (>= 5.0, < 8)
|
|
42
|
+
addressable (~> 2.8)
|
|
43
|
+
algoliasearch (~> 1.0)
|
|
44
|
+
concurrent-ruby (~> 1.1)
|
|
45
|
+
fuzzy_match (~> 2.0.4)
|
|
46
|
+
nap (~> 1.0)
|
|
47
|
+
netrc (~> 0.11)
|
|
48
|
+
public_suffix (~> 4.0)
|
|
49
|
+
typhoeus (~> 1.0)
|
|
50
|
+
cocoapods-deintegrate (1.0.5)
|
|
51
|
+
cocoapods-downloader (2.1)
|
|
52
|
+
cocoapods-plugins (1.0.0)
|
|
53
|
+
nap
|
|
54
|
+
cocoapods-search (1.0.1)
|
|
55
|
+
cocoapods-trunk (1.6.0)
|
|
56
|
+
nap (>= 0.8, < 2.0)
|
|
57
|
+
netrc (~> 0.11)
|
|
58
|
+
cocoapods-try (1.2.0)
|
|
59
|
+
colored2 (3.1.2)
|
|
60
|
+
concurrent-ruby (1.2.3)
|
|
61
|
+
escape (0.0.4)
|
|
62
|
+
ethon (0.16.0)
|
|
63
|
+
ffi (>= 1.15.0)
|
|
64
|
+
ffi (1.16.3)
|
|
65
|
+
fourflusher (2.3.1)
|
|
66
|
+
fuzzy_match (2.0.4)
|
|
67
|
+
gh_inspector (1.1.3)
|
|
68
|
+
httpclient (2.8.3)
|
|
69
|
+
i18n (1.14.5)
|
|
70
|
+
concurrent-ruby (~> 1.0)
|
|
71
|
+
json (2.7.2)
|
|
72
|
+
minitest (5.22.3)
|
|
73
|
+
molinillo (0.8.0)
|
|
74
|
+
nanaimo (0.3.0)
|
|
75
|
+
nap (1.1.0)
|
|
76
|
+
netrc (0.11.0)
|
|
77
|
+
nkf (0.2.0)
|
|
78
|
+
public_suffix (4.0.7)
|
|
79
|
+
rexml (3.2.6)
|
|
80
|
+
ruby-macho (2.5.1)
|
|
81
|
+
typhoeus (1.4.1)
|
|
82
|
+
ethon (>= 0.9.0)
|
|
83
|
+
tzinfo (2.0.6)
|
|
84
|
+
concurrent-ruby (~> 1.0)
|
|
85
|
+
xcodeproj (1.24.0)
|
|
86
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
|
87
|
+
atomos (~> 0.1.3)
|
|
88
|
+
claide (>= 1.0.2, < 2.0)
|
|
89
|
+
colored2 (~> 3.1)
|
|
90
|
+
nanaimo (~> 0.3.0)
|
|
91
|
+
rexml (~> 3.2.4)
|
|
92
|
+
zeitwerk (2.6.13)
|
|
93
|
+
|
|
94
|
+
PLATFORMS
|
|
95
|
+
ruby
|
|
96
|
+
|
|
97
|
+
DEPENDENCIES
|
|
98
|
+
activesupport (>= 6.1.7.5, < 7.1.0)
|
|
99
|
+
cocoapods (>= 1.13, < 1.15)
|
|
100
|
+
|
|
101
|
+
RUBY VERSION
|
|
102
|
+
ruby 2.6.10p210
|
|
103
|
+
|
|
104
|
+
BUNDLED WITH
|
|
105
|
+
1.17.2
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
|
|
2
|
+
|
|
3
|
+
# Getting Started
|
|
4
|
+
|
|
5
|
+
>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
|
|
6
|
+
|
|
7
|
+
## Step 1: Start the Metro Server
|
|
8
|
+
|
|
9
|
+
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
|
|
10
|
+
|
|
11
|
+
To start Metro, run the following command from the _root_ of your React Native project:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# using npm
|
|
15
|
+
npm start
|
|
16
|
+
|
|
17
|
+
# OR using Yarn
|
|
18
|
+
yarn start
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Step 2: Start your Application
|
|
22
|
+
|
|
23
|
+
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
|
|
24
|
+
|
|
25
|
+
### For Android
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# using npm
|
|
29
|
+
npm run android
|
|
30
|
+
|
|
31
|
+
# OR using Yarn
|
|
32
|
+
yarn android
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### For iOS
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# using npm
|
|
39
|
+
npm run ios
|
|
40
|
+
|
|
41
|
+
# OR using Yarn
|
|
42
|
+
yarn ios
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
|
|
46
|
+
|
|
47
|
+
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
|
|
48
|
+
|
|
49
|
+
## Step 3: Modifying your App
|
|
50
|
+
|
|
51
|
+
Now that you have successfully run the app, let's modify it.
|
|
52
|
+
|
|
53
|
+
1. Open `App.tsx` in your text editor of choice and edit some lines.
|
|
54
|
+
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
|
|
55
|
+
|
|
56
|
+
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
|
|
57
|
+
|
|
58
|
+
## Congratulations! :tada:
|
|
59
|
+
|
|
60
|
+
You've successfully run and modified your React Native App. :partying_face:
|
|
61
|
+
|
|
62
|
+
### Now what?
|
|
63
|
+
|
|
64
|
+
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
|
|
65
|
+
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
|
|
66
|
+
|
|
67
|
+
# Troubleshooting
|
|
68
|
+
|
|
69
|
+
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
|
|
70
|
+
|
|
71
|
+
# Learn More
|
|
72
|
+
|
|
73
|
+
To learn more about React Native, take a look at the following resources:
|
|
74
|
+
|
|
75
|
+
- [React Native Website](https://reactnative.dev) - learn more about React Native.
|
|
76
|
+
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
|
|
77
|
+
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
|
|
78
|
+
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
|
|
79
|
+
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @format
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import 'react-native';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import App from '../App';
|
|
8
|
+
|
|
9
|
+
// Note: import explicitly to use the types shipped with jest.
|
|
10
|
+
import { it } from '@jest/globals';
|
|
11
|
+
|
|
12
|
+
// Note: test renderer must be required after react-native.
|
|
13
|
+
import renderer from 'react-test-renderer';
|
|
14
|
+
|
|
15
|
+
it('renders correctly', () => {
|
|
16
|
+
renderer.create(<App />);
|
|
17
|
+
});
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
apply plugin: "com.android.application"
|
|
2
|
+
apply plugin: "org.jetbrains.kotlin.android"
|
|
3
|
+
apply plugin: "com.facebook.react"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This is the configuration block to customize your React Native Android app.
|
|
7
|
+
* By default you don't need to apply any configuration, just uncomment the lines you need.
|
|
8
|
+
*/
|
|
9
|
+
react {
|
|
10
|
+
/* Folders */
|
|
11
|
+
// The root of your project, i.e. where "package.json" lives. Default is '..'
|
|
12
|
+
// root = file("../")
|
|
13
|
+
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
|
|
14
|
+
// reactNativeDir = file("../node_modules/react-native")
|
|
15
|
+
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
|
|
16
|
+
// codegenDir = file("../node_modules/@react-native/codegen")
|
|
17
|
+
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
|
|
18
|
+
// cliFile = file("../node_modules/react-native/cli.js")
|
|
19
|
+
|
|
20
|
+
/* Variants */
|
|
21
|
+
// The list of variants to that are debuggable. For those we're going to
|
|
22
|
+
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
|
|
23
|
+
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
|
|
24
|
+
// debuggableVariants = ["liteDebug", "prodDebug"]
|
|
25
|
+
|
|
26
|
+
/* Bundling */
|
|
27
|
+
// A list containing the node command and its flags. Default is just 'node'.
|
|
28
|
+
// nodeExecutableAndArgs = ["node"]
|
|
29
|
+
//
|
|
30
|
+
// The command to run when bundling. By default is 'bundle'
|
|
31
|
+
// bundleCommand = "ram-bundle"
|
|
32
|
+
//
|
|
33
|
+
// The path to the CLI configuration file. Default is empty.
|
|
34
|
+
// bundleConfig = file(../rn-cli.config.js)
|
|
35
|
+
//
|
|
36
|
+
// The name of the generated asset file containing your JS bundle
|
|
37
|
+
// bundleAssetName = "MyApplication.android.bundle"
|
|
38
|
+
//
|
|
39
|
+
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
|
|
40
|
+
// entryFile = file("../js/MyApplication.android.js")
|
|
41
|
+
//
|
|
42
|
+
// A list of extra flags to pass to the 'bundle' commands.
|
|
43
|
+
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
|
|
44
|
+
// extraPackagerArgs = []
|
|
45
|
+
|
|
46
|
+
/* Hermes Commands */
|
|
47
|
+
// The hermes compiler command to run. By default it is 'hermesc'
|
|
48
|
+
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
|
|
49
|
+
//
|
|
50
|
+
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
|
|
51
|
+
// hermesFlags = ["-O", "-output-source-map"]
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
|
56
|
+
*/
|
|
57
|
+
def enableProguardInReleaseBuilds = false
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The preferred build flavor of JavaScriptCore (JSC)
|
|
61
|
+
*
|
|
62
|
+
* For example, to use the international variant, you can use:
|
|
63
|
+
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
|
|
64
|
+
*
|
|
65
|
+
* The international variant includes ICU i18n library and necessary data
|
|
66
|
+
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
|
67
|
+
* give correct results when using with locales other than en-US. Note that
|
|
68
|
+
* this variant is about 6MiB larger per architecture than default.
|
|
69
|
+
*/
|
|
70
|
+
def jscFlavor = 'org.webkit:android-jsc:+'
|
|
71
|
+
|
|
72
|
+
android {
|
|
73
|
+
ndkVersion rootProject.ext.ndkVersion
|
|
74
|
+
buildToolsVersion rootProject.ext.buildToolsVersion
|
|
75
|
+
compileSdk rootProject.ext.compileSdkVersion
|
|
76
|
+
|
|
77
|
+
namespace "com.workflow"
|
|
78
|
+
defaultConfig {
|
|
79
|
+
applicationId "com.workflow"
|
|
80
|
+
minSdkVersion rootProject.ext.minSdkVersion
|
|
81
|
+
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
82
|
+
versionCode 1
|
|
83
|
+
versionName "1.0"
|
|
84
|
+
}
|
|
85
|
+
signingConfigs {
|
|
86
|
+
debug {
|
|
87
|
+
storeFile file('debug.keystore')
|
|
88
|
+
storePassword 'android'
|
|
89
|
+
keyAlias 'androiddebugkey'
|
|
90
|
+
keyPassword 'android'
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
buildTypes {
|
|
94
|
+
debug {
|
|
95
|
+
signingConfig signingConfigs.debug
|
|
96
|
+
}
|
|
97
|
+
release {
|
|
98
|
+
// Caution! In production, you need to generate your own keystore file.
|
|
99
|
+
// see https://reactnative.dev/docs/signed-apk-android.
|
|
100
|
+
signingConfig signingConfigs.debug
|
|
101
|
+
minifyEnabled enableProguardInReleaseBuilds
|
|
102
|
+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
dependencies {
|
|
108
|
+
// The version of react-native is set by the React Native Gradle Plugin
|
|
109
|
+
implementation("com.facebook.react:react-android")
|
|
110
|
+
|
|
111
|
+
if (hermesEnabled.toBoolean()) {
|
|
112
|
+
implementation("com.facebook.react:hermes-android")
|
|
113
|
+
} else {
|
|
114
|
+
implementation jscFlavor
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
|
119
|
+
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
|
|
120
|
+
apply from: "../../node_modules/@brightlayer-ui/react-native-vector-icons/fonts.gradle"
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Add project specific ProGuard rules here.
|
|
2
|
+
# By default, the flags in this file are appended to flags specified
|
|
3
|
+
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
|
|
4
|
+
# You can edit the include path and order by changing the proguardFiles
|
|
5
|
+
# directive in build.gradle.
|
|
6
|
+
#
|
|
7
|
+
# For more details, see
|
|
8
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
9
|
+
|
|
10
|
+
# Add any project specific keep options here:
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:tools="http://schemas.android.com/tools">
|
|
4
|
+
|
|
5
|
+
<application
|
|
6
|
+
android:usesCleartextTraffic="true"
|
|
7
|
+
tools:targetApi="28"
|
|
8
|
+
tools:ignore="GoogleAppIndexingWarning"/>
|
|
9
|
+
</manifest>
|