Skip to content

Commit

Permalink
merge with ios-code
Browse files Browse the repository at this point in the history
  • Loading branch information
nishStoryDigital committed Sep 20, 2021
2 parents 60cda3f + fe6493c commit 9637914
Show file tree
Hide file tree
Showing 37 changed files with 1,021 additions and 209 deletions.
13 changes: 13 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"presets": ["module:metro-react-native-babel-preset"],
"plugins": [
[
"module-resolver",
Expand All @@ -19,6 +20,18 @@
"_Utils": "./app/utils"
}
}
],
[
"module:react-native-dotenv",
{
"moduleName": "_Env",
"path": ".env",
"blocklist": null,
"allowlist": null,
"safe": true,
"allowUndefined": false,
"verbose": false
}
]
]
}
5 changes: 5 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SOME_ENV_KEY=THis_is_a_text_from_.env_file

RAZORPAY_SANDBOX_KEY=rzp_test_blablabla

RAZORPAY_SANDBOX_SECRET=I_WONT_TELL_YOU
55 changes: 19 additions & 36 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,21 @@
module.exports = {
'env': {
'browser': true,
'es2021': true
},
'extends': [
'eslint:recommended',
'plugin:react/recommended'
],
'parserOptions': {
'ecmaFeatures': {
'jsx': true
},
'ecmaVersion': 12,
'sourceType': 'module'
},
'plugins': [
'react'
],
'rules': {
'indent': [
'error',
'tab'
],
'linebreak-style': [
'error',
'unix'
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'always'
]
}
env: {
browser: true,
es2021: true,
},
extends: ['eslint:recommended', 'plugin:react/recommended'],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react'],
rules: {
indent: ['error', 'tab'],
'linebreak-style': ['error', 'unix'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
},
};
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
#
.DS_Store

.env.dev
.env.development
.env.testing
.env.production
.env.staging

# Xcode
#
build/
Expand Down
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# react-native-libs

**"An Ideal app-template to start your next `react-native` project."**
**"One or more of the used libraries would be a must in your next `react-native` project"**

## Features
## Libraries Used

- Project code properly organized, and using `alias-imports`.
- Implemented Onboarding-screen.
- Stack, Tab and Drawer Navigation.
- Global state management using `mobx-react-lite`.
- Support for theme and language change.
- Added custom Google-font (Poppins).
- Added relevant links for easier & time-saving app development under the **Developer-Guide** section.
- [@react-native-community/clipboard](https://www.npmjs.com/package/@react-native-community/clipboard)
- [react-native-action-view](https://www.npmjs.com/package/react-native-action-view)
- [react-native-contacts](https://www.npmjs.com/package/react-native-contacts)
- [react-native-dotenv](https://www.npmjs.com/package/react-native-dotenv)
- [react-native-geolocation-service](https://www.npmjs.com/package/react-native-geolocation-service)
- [react-native-permissions](https://www.npmjs.com/package/react-native-permissions)
- [react-native-razorpay](https://www.npmjs.com/package/react-native-razorpay)

## Developer Guide

- To create react-native-app with custom package name, do a project-wide find and replace ```com.awesomeproject → com.mycompany.myapp``` Also in the `android` directory,
```src/main/java/com/awesomeproject → src/main/java/com/mycompany/myapp```
# Other Libaries not used here

<<<<<<< HEAD
- Read the document of [react-native-config](https://www.npmjs.com/package/react-native-config) to use .env files based upon the shell. For running android app in windows, I used `SET ENVFILE=.env.staging && react-native run-android`.

- Generate your app Icon using [MakeAppIcon](https://makeappicon.com/).Read More about app icon setup on this [Link](https://aboutreact.com/react-native-change-app-icon/).iOS icons can be generated using `Icon Set Creater` app available on the App Store. Make sure to also provide a round icon with the name `ic_launcher_round.png` in your android folder for various `mipmap-` directories.
Expand All @@ -37,7 +36,15 @@ Go to [easyappicon.com](https://easyappicon.com/).
- Using `react-native-reanimated` v-1.13.3 as v2 was not working fine.

- Manually link `react-native-vector-icons` in ios [link](https://medium.com/@vimniky/how-to-use-vector-icons-in-your-react-native-project-8212ac6a8f06). Check [this link](https://medium.com/@danielskripnik/how-to-add-and-remove-custom-fonts-in-react-native-b2830084b0e4) to add/remove fonts.
=======
- [@react-native-community/cameraroll](https://www.npmjs.com/package/@react-native-community/cameraroll)
- [react-native-autogrow-textinput](https://www.npmjs.com/package/react-native-autogrow-textinput)
- [react-native-calendars](https://www.npmjs.com/package/react-native-calendars)
- [react-native-calendar-events](https://www.npmjs.com/package/react-native-calendar-events)
- [react-native-camera-kit](https://www.npmjs.com/package/react-native-camera-kit)
- [react-native-netinfo](https://www.npmjs.com/package/react-native-netinfo)
>>>>>>> origin/ios-code
# Support Me

If you found this template helpful and saved your valuable time, consider [buying me a coffee](https://www.buymeacoffee.com/nish1896)
If you learnt something new and found this project helpful, consider [buying me a coffee](https://www.buymeacoffee.com/nish1896)
8 changes: 3 additions & 5 deletions app/assets/i18n/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
"cancel": "CANCEL"
},
"DRAWER": {
"contacts": "Contacts",
"home": "Home",
"profile": "Profile",
"notifications": "Notifications",
"settings": "Settings",
"help": "Help & Support"
"settings": "Settings"
},
"HOMESCREEN": {
"exitMsg": "Close the app?"
Expand All @@ -25,7 +23,7 @@
"connection": "Please Check your Internet Connection",
"enterPhone": "Enter Phone Number(With Country Code)",
"enterOTP": "Enter OTP",
"getOTP":"Get OTP",
"getOTP": "Get OTP",
"submitOTP": "Submit",
"ssoGoogle": "Sign in with Google",
"ssoFacebook": "Sign in with Facebook",
Expand Down
10 changes: 4 additions & 6 deletions app/assets/i18n/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
"cancel": "Annuler"
},
"DRAWER": {
"contacts": "Contacts",
"home": "Accueil",
"profile": "Profil",
"notifications": "Notifications",
"settings": "Réglages",
"help": "Support d'aide"
"settings": "Réglages"
},
"HOMESCREEN": {
"exitMsg": "Fermer l'application ?"
Expand All @@ -25,7 +23,7 @@
"connection": "S'il vous plait, vérifiez votre connexion internet",
"enterPhone": "Entrez téléphone (Avec code de pays)",
"enterOTP": "Entrez OTP",
"getOTP":"Obtenez OTP",
"getOTP": "Obtenez OTP",
"submitOTP": "Soumettre",
"ssoGoogle": "Connectez Google",
"ssoFacebook": "Connectez Facebook",
Expand All @@ -39,4 +37,4 @@
"USER": {
"hiuser": "Salut {{userName}}"
}
}
}
8 changes: 3 additions & 5 deletions app/assets/i18n/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
"cancel": "रद्द करें"
},
"DRAWER": {
"contacts": "संपर्क",
"home": "होम",
"profile": "प्रोफ़ाइल",
"notifications": "सूचनाएं",
"settings": "सैटिंग",
"help": "सहायता और समर्थन"
"settings": "सैटिंग"
},
"HOMESCREEN": {
"exitMsg": "ऐप बंद करें?"
Expand All @@ -25,7 +23,7 @@
"connection": "कृपया अपने इंटरनेट कनेक्शन की जाँच करें",
"enterPhone": "फोन नंबर दर्ज करें (कोड के साथ)",
"enterOTP": "OTP दर्ज करें",
"getOTP":"OTP प्राप्त करें",
"getOTP": "OTP प्राप्त करें",
"submitOTP": "प्रस्तुत",
"ssoGoogle": "Google से साइन इन करें",
"ssoFacebook": "Facebook से साइन इन करें",
Expand Down
14 changes: 7 additions & 7 deletions app/assets/themes/Dark.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export default Dark = {
dark: true,
colors: {
primary: '#ff5071', /* pinkish-red */
background: '#25293e', /* darkbluish black */
card: '#008c8c', /* maars-green */
text: '#f7f6f3', /* soft-white */
border: '#959fa8', /* light-gray */
notification: '#8a79af', /* black-currant */
heading: '#fdd261', /* mango */
primary: '#ff5071' /* pinkish-red */,
background: '#25293e' /* darkbluish black */,
card: '#008c8c' /* maars-green */,
text: '#f7f6f3' /* soft-white */,
border: '#959fa8' /* light-gray */,
notification: '#8a79af' /* black-currant */,
heading: '#fdd261' /* mango */,
},
};
14 changes: 7 additions & 7 deletions app/assets/themes/Light.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export default Light = {
dark: false,
colors: {
primary: '#008cd1', /* sky-blue */
background: '#f7f6f3', /* soft-white */
card: '#6d9773', /* soft-green */
text: '#25293e', /* soft black */
border: '#76777c', /* gray */
notification: '#8a79af', /* black-currant */
heading: '#04437d', /* dark-blue */
primary: '#008cd1' /* sky-blue */,
background: '#f7f6f3' /* soft-white */,
card: '#abcded' /* light sky-blue */,
text: '#25293e' /* soft black */,
border: '#76777c' /* gray */,
notification: '#8a79af' /* black-currant */,
heading: '#04437d' /* dark-blue */,
},
};
27 changes: 21 additions & 6 deletions app/navigation/DrawerLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,42 @@ const DrawerLayout = () => {
<DrawerItem
icon={() => (
<IoniconsI
name="logo-android"
name="ios-settings-outline"
color={themeObj.colors.heading}
size={CommonStyles.icons.drawerIcon}
/>
)}
label={() => <ThemedHeading>TABS</ThemedHeading>}
label={() => (
<ThemedHeading>{t('DRAWER.settings')}</ThemedHeading>
)}
onPress={() => {
navigation.navigate('TabsNav');
navigation.navigate('Settings');
}}
/>
<DrawerItem
icon={() => (
<IoniconsI
name="ios-settings-outline"
name="md-phone-portrait-outline"
color={themeObj.colors.heading}
size={CommonStyles.icons.drawerIcon}
/>
)}
label={() => <ThemedHeading>{t('DRAWER.settings')}</ThemedHeading>}
label={() => <ThemedHeading>Permissions</ThemedHeading>}
onPress={() => {
navigation.navigate('Settings');
navigation.navigate('Permissions');
}}
/>
<DrawerItem
icon={() => (
<IoniconsI
name="cash-outline"
color={themeObj.colors.heading}
size={CommonStyles.icons.drawerIcon}
/>
)}
label={() => <ThemedHeading>Razorpay</ThemedHeading>}
onPress={() => {
navigation.navigate('Razorpay');
}}
/>
</DrawerContentScrollView>
Expand Down
18 changes: 11 additions & 7 deletions app/navigation/DrawerNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import React from 'react';
import { createDrawerNavigator } from '@react-navigation/drawer';

import DrawerLayout from './DrawerLayout';
import TabsNav from './TabsNav';
import Home from '_Screens/home/Home';
import Settings from '_Screens/settings/Settings';
import Razorpay from '_Screens/razorpay/Razorpay';
import Permissions from '_Screens/permissions';
import ContactsList from '_Screens/permissions/contacts/ContactsList';
import Location from '_Screens/permissions/location/Location';

/*
Refer https://reactnavigation.org/docs/drawer-navigator#checking-if-the-drawer-is-open
*/
const Drawer = createDrawerNavigator();

const NavDrawer = () => {
Expand All @@ -17,11 +17,15 @@ const NavDrawer = () => {
initialRouteName="Home"
overlayColor="transparent"
screenOptions={{ headerShown: false }}
drawerContent={() => <DrawerLayout />}
>
drawerContent={() => <DrawerLayout />}>
<Drawer.Screen name="Home" component={Home} />
<Drawer.Screen name="TabsNav" component={TabsNav} />
<Drawer.Screen name="Settings" component={Settings} />
<Drawer.Screen name="Razorpay" component={Razorpay} />

{/* Permission Related Screens */}
<Drawer.Screen name="Permissions" component={Permissions} />
<Drawer.Screen name="ContactsList" component={ContactsList} />
<Drawer.Screen name="Location" component={Location} />
</Drawer.Navigator>
);
};
Expand Down
Loading

0 comments on commit 9637914

Please sign in to comment.