@brightlayer-ui/react-native-template-authentication-typescript 2.1.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/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 +107 -0
- package/template/README.md +79 -0
- package/template/__tests__/App.test.tsx +17 -0
- package/template/_gitignore +74 -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 +12 -0
- package/template/jestSetupFile.js +31 -10
- package/template/metro.config.js +7 -25
- package/template/package.json +71 -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 +44 -26
- 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 +7346 -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/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.1",
|
|
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,107 @@
|
|
|
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.8)
|
|
80
|
+
strscan (>= 3.0.9)
|
|
81
|
+
ruby-macho (2.5.1)
|
|
82
|
+
strscan (3.1.0)
|
|
83
|
+
typhoeus (1.4.1)
|
|
84
|
+
ethon (>= 0.9.0)
|
|
85
|
+
tzinfo (2.0.6)
|
|
86
|
+
concurrent-ruby (~> 1.0)
|
|
87
|
+
xcodeproj (1.24.0)
|
|
88
|
+
CFPropertyList (>= 2.3.3, < 4.0)
|
|
89
|
+
atomos (~> 0.1.3)
|
|
90
|
+
claide (>= 1.0.2, < 2.0)
|
|
91
|
+
colored2 (~> 3.1)
|
|
92
|
+
nanaimo (~> 0.3.0)
|
|
93
|
+
rexml (~> 3.2.4)
|
|
94
|
+
zeitwerk (2.6.13)
|
|
95
|
+
|
|
96
|
+
PLATFORMS
|
|
97
|
+
ruby
|
|
98
|
+
|
|
99
|
+
DEPENDENCIES
|
|
100
|
+
activesupport (>= 6.1.7.5, < 7.1.0)
|
|
101
|
+
cocoapods (>= 1.13, < 1.15)
|
|
102
|
+
|
|
103
|
+
RUBY VERSION
|
|
104
|
+
ruby 2.6.10p210
|
|
105
|
+
|
|
106
|
+
BUNDLED WITH
|
|
107
|
+
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,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
|