Skip to content

Commit 0283ee0

Browse files
committed
other settings config
1 parent a967d12 commit 0283ee0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+712
-106
lines changed

.DS_Store

0 Bytes
Binary file not shown.

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Hooks for fetching, caching and updating asynchronous data in React.
168168

169169
### AXIOS
170170

171-
## #TODO BENEFITS
171+
I like to used axios because your interceptors configurations.
172172

173173
### Redux/Redux Toolkit
174174

@@ -211,6 +211,24 @@ This is similar to [redux-sentry-middleware](https://github.com/vidit-sh/redux-s
211211
### react-native-bootsplash
212212

213213
Works great for controlling your splash screen.
214+
To help about lib
215+
216+
```bash
217+
$ npx react-native generate-bootsplash --help
218+
```
219+
220+
Full command usage example to put your SplashScreen
221+
222+
```bash
223+
npx react-native generate-bootsplash assets/splash.png \
224+
--background-color=F5FCFF \
225+
--logo-width=100 \
226+
--assets-path=assets \
227+
--flavor=main
228+
```
229+
230+
Only iOS follow this instructions from library [BootSplash](https://github.com/zoontek/react-native-bootsplash)
231+
where is saying `Set the BootSplash.storyboard as launch screen file:`
214232

215233
### react-native-svg
216234

@@ -313,6 +331,7 @@ root
313331
| └── useNotification.tsx
314332
| └── usePrevious.tsx
315333
| └── useStartupTime.tsx
334+
| └── useReactQuery.tsx
316335
└── localization
317336
| └── resources
318337
| | └── en.json
@@ -343,6 +362,13 @@ root
343362
└── utils
344363
├── colors.ts
345364
└── console.ts
365+
└── services
366+
├── axiosConfig.ts
367+
└── styles
368+
├── colors.ts
369+
├── typography.ts
370+
├── spacing.ts
371+
├── index.ts
346372
347373
```
348374

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hmarques98/react-native-template",
3-
"version": "2.0.2",
3+
"version": "1.0.0",
44
"description": "A minimal template with good architecture and common packages to let you focus on writing features right away.",
55
"scripts": {},
66
"files": [
@@ -9,7 +9,7 @@
99
],
1010
"repository": {
1111
"type": "git",
12-
"url": "git+https://github.com/hmarques98/react-native-template.git"
12+
"url": "git+https://github.com/hmarques98/react-native-template-typescript.git"
1313
},
1414
"keywords": [
1515
"react",
@@ -19,9 +19,9 @@
1919
"starter",
2020
"typescript"
2121
],
22-
"author": "Osama Qarem <osamaqarem@gmail.com>",
22+
"author": "Henrique Marques <marquesprogrammer@hotmail.com>",
2323
"license": "MIT",
24-
"homepage": "https://github.com/osamaq/react-native-template",
24+
"homepage": "https://github.com/hmarques98/react-native-template-typescript",
2525
"release-it": {
2626
"git": {
2727
"commitMessage": "chore: release v${version}"

template/.env.prod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
ENV=prod
2-
SENTRY_DSN=
2+
SENTRY_DSN=
3+
BASE_URL=

template/App.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import useStartupTime from 'hooks/useStartupTime';
1414
import useAppState from 'react-native-appstate-hook';
1515
import { Provider } from 'react-redux';
1616
import store from './src/store';
17+
import { QueryClient, QueryClientProvider } from 'react-query';
1718

1819
enableScreens();
1920

@@ -29,6 +30,7 @@ if (typeof SENTRY_DSN === 'string' && SENTRY_DSN.length > 0) {
2930
dsn: SENTRY_DSN,
3031
});
3132
}
33+
const queryClient = new QueryClient();
3234

3335
const App = () => {
3436
// useNotifications();
@@ -47,7 +49,9 @@ const App = () => {
4749

4850
return (
4951
<Provider store={store}>
50-
<Router />
52+
<QueryClientProvider client={queryClient}>
53+
<Router />
54+
</QueryClientProvider>
5155
</Provider>
5256
);
5357
};

template/android/app/src/main/AndroidManifest.xml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
android:name=".MainActivity"
1616
android:label="@string/app_name"
1717
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
18-
android:launchMode="singleTask"
19-
android:windowSoftInputMode="adjustResize">
20-
<intent-filter>
21-
<action android:name="android.intent.action.MAIN" />
22-
<category android:name="android.intent.category.LAUNCHER" />
23-
</intent-filter>
18+
android:windowSoftInputMode="adjustResize"
19+
android:exported="true"
20+
android:launchMode="singleTask">
21+
2422
<intent-filter>
2523
<action android:name="android.intent.action.VIEW" />
2624
<category android:name="android.intent.category.DEFAULT" />
@@ -39,5 +37,14 @@
3937
<data android:scheme="template" />
4038
</intent-filter>
4139
</activity>
40+
<activity
41+
android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
42+
android:theme="@style/BootTheme"
43+
android:launchMode="singleTask">
44+
<intent-filter>
45+
<action android:name="android.intent.action.MAIN" />
46+
<category android:name="android.intent.category.LAUNCHER" />
47+
</intent-filter>
48+
</activity>
4249
</application>
4350
</manifest>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
package com.template;
22

3+
import android.os.Bundle; // <- add this necessary import
34
import com.facebook.react.ReactActivity;
5+
import com.zoontek.rnbootsplash.RNBootSplash; // <- add this necessary import
46

57
public class MainActivity extends ReactActivity {
68

79
/**
810
* Returns the name of the main component registered from JavaScript. This is used to schedule
911
* rendering of the component.
1012
*/
13+
1114
@Override
1215
protected String getMainComponentName() {
1316
return "template";
1417
}
18+
19+
@Override
20+
protected void onCreate(Bundle savedInstanceState) {
21+
super.onCreate(savedInstanceState);
22+
RNBootSplash.init(R.drawable.bootsplash, MainActivity.this); // <- display the generated bootsplash.xml drawable over our MainActivity
23+
}
1524
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque">
4+
<item android:drawable="@color/bootsplash_background" />
5+
6+
<item>
7+
<bitmap android:src="@mipmap/bootsplash_logo" android:gravity="center" />
8+
</item>
9+
</layer-list>
4.03 KB
Loading
2.72 KB
Loading

0 commit comments

Comments
 (0)