Skip to content

Commit bbfc52a

Browse files
committed
edit icon native-base
1 parent 48211d0 commit bbfc52a

File tree

7 files changed

+49
-17
lines changed

7 files changed

+49
-17
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<img src="https://reactnavigation.org/img/spiro.svg" width="140" title="hover text">
1313
<img src="https://iconape.com/wp-content/files/ke/21383/svg/apollo-graphql-compact.svg" width="140" title="hover text">
1414
<img src="https://code4developers.com/wp-content/uploads/2018/01/Redux.png" width="170" title="hover text">
15-
<img src="https://nativebase.io/assets/img/front-page-icon.png" width="120" title="hover text">
16-
<img src="https://raw.githubusercontent.com/mpeyper/react-hooks-testing-library/master/public/ram.png" width="120" title="hover text">
15+
<img src="https://docs.nativebase.io/img/nativebaselogo.svg" width="120" title="hover text">
16+
<img src="https://raw.githubusercontent.com/mpeyper/react-hooks-testing-library/master/public/ram.png" width="120" title="hover text">
1717
</div>
1818

1919
## Structure

package-lock.json

Lines changed: 19 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"format": "npm run prettier -- --write",
1717
"check-format": "npm run prettier -- --list-different",
1818
"validate": "npm-run-all --parallel check-format lint test",
19-
"generatePossibleTypes": "node ./scripts/generatePossibleTypes.js",
19+
"generatePossibleTypes": "node src/scripts/generatePossibleTypes.js",
2020
"android-dev": "adb reverse tcp:8081 tcp:8081 && react-native run-android",
2121
"yarn-ios": "yarn && yarn pod",
2222
"android-release": "npx react-native run-android --variant=release",
@@ -46,7 +46,7 @@
4646
"native-base": "^2.15.2",
4747
"react": "17.0.2",
4848
"react-fast-compare": "^3.2.0",
49-
"react-i18next": "^11.9.0",
49+
"react-i18next": "^11.11.0",
5050
"react-native": "0.64.1",
5151
"react-native-bootsplash": "^3.2.2",
5252
"react-native-dotenv": "^2.5.5",

src/assets/locales/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ const vi_VN = require('./vi/string.json');
22
const es_US = require('./es/string.json');
33
const ko_KR = require('./ko/string.json');
44

5-
export const resources = { vi_VN, es_US, ko_KR };
5+
export const resources = {vi_VN, es_US, ko_KR};
66

77
export type LangTypes = keyof typeof resources

src/common/hooks/index.ts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import isEqual from 'react-fast-compare';
2-
import { useSelector as useReduxSelector } from 'react-redux';
3-
import { RootState } from '@store/allReducers';
4-
import { DeviceEventEmitter } from 'react-native';
5-
import { EmitCode } from '@components/MyToast';
2+
import {useSelector as useReduxSelector} from 'react-redux';
3+
import {RootState} from '@store/allReducers';
4+
import {DeviceEventEmitter} from 'react-native';
5+
import {EmitCode} from '@components/MyToast';
6+
import {useEffect, useRef, useState} from 'react';
67

78
function useSelector<T>(
89
selector: (state: RootState) => T,
@@ -17,4 +18,20 @@ const useToast = () => {
1718
DeviceEventEmitter.emit(EmitCode.Toast, msg, duration);
1819
};
1920

20-
export { useSelector, useToast };
21+
function usePrevious<T = any>(value: T): T | undefined {
22+
const ref = useRef<T>();
23+
useEffect(() => {
24+
ref.current = value;
25+
}, [value]);
26+
return ref.current;
27+
}
28+
29+
function useMounted() {
30+
const [isMounted, setIsMounted] = useState(false);
31+
useEffect(() => {
32+
setIsMounted(true);
33+
}, []);
34+
return isMounted;
35+
}
36+
37+
export {useSelector, useToast, usePrevious, useMounted};

src/lib/utils/i18n/i18n.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { initReactI18next } from 'react-i18next';
2-
import { resources } from '@assets/locales';
3-
import i18n, { LanguageDetectorAsyncModule } from 'i18next';
1+
import {initReactI18next} from 'react-i18next';
2+
import {resources} from '@assets/locales';
3+
import i18n, {LanguageDetectorAsyncModule} from 'i18next';
44

55
const languageDetector: LanguageDetectorAsyncModule = {
66
type: 'languageDetector',
File renamed without changes.

0 commit comments

Comments
 (0)