Skip to content

Commit

Permalink
Merge pull request #1 from pnthach95/nativewind
Browse files Browse the repository at this point in the history
  • Loading branch information
pnthach95 authored Mar 8, 2023
2 parents 7e1c42a + bd35420 commit 0dd8c67
Show file tree
Hide file tree
Showing 51 changed files with 1,866 additions and 2,242 deletions.
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recommendations": [
"bradlc.vscode-tailwindcss",
"diemasmichiels.emulate",
"dbaeumer.vscode-eslint",
"lokalise.i18n-ally",
"kisstkondoros.vscode-gutter-preview",
"esbenp.prettier-vscode",
"spmeesseman.vscode-taskexplorer"
]
}
10 changes: 10 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@
"osx": {
"command": "npx jetify && cd android && ./gradlew bundleRelease"
}
},
{
"label": "Install debug APK",
"type": "shell",
"command": "cd android/app/build/outputs/apk/debug && adb install app-debug.apk"
},
{
"label": "Install release APK",
"type": "shell",
"command": "cd android/app/build/outputs/apk/release && adb install app-release.apk"
}
]
}
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ android {
applicationId "vn.pnthach.karthuria"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 11
versionName "2.0.0"
versionCode 12
versionName "3.0.0"
multiDexEnabled true
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

Expand Down
10 changes: 9 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@
android:screenOrientation="portrait"
android:exported="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="karth.top" />
</intent-filter>
</activity>
</application>
</manifest>
10 changes: 5 additions & 5 deletions android/app/src/main/java/vn/pnthach/karthuria/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ protected boolean isConcurrentRootEnabled() {
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}
}

@Override
protected void loadApp(String appKey) {
RNBootSplash.init(getPlainActivity());
super.loadApp(appKey);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
RNBootSplash.init(this);
super.onCreate(null);
}
}
3 changes: 2 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ module.exports = {
root: ['./src'],
extensions: ['.ios.js', '.android.js', '.js', '.ts', '.tsx', '.json'],
alias: {
'@screens': './src/screens',
'*': '.',
},
},
],
'nativewind/babel',
'react-native-reanimated/plugin',
],
env: {
Expand Down
71 changes: 37 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,79 @@
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix"
},
"dependencies": {
"@gorhom/animated-tabbar": "2.1.2",
"@gorhom/bottom-sheet": "^4.4.5",
"@pnthach95/react-native-root-view-background": "^1.2.0",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-community/netinfo": "^9.3.7",
"@react-navigation/bottom-tabs": "^6.4.1",
"@react-navigation/native": "^6.0.14",
"@react-navigation/stack": "^6.3.5",
"@react-navigation/material-bottom-tabs": "^6.2.15",
"@react-navigation/native": "^6.1.6",
"@react-navigation/native-stack": "^6.9.12",
"@shopify/flash-list": "^1.4.1",
"@welldone-software/why-did-you-render": "^7.0.1",
"apisauce": "^2.1.6",
"colord": "^2.9.3",
"compare-versions": "^5.0.1",
"dayjs": "^1.11.6",
"i18next": "^22.0.6",
"immer": "^9.0.16",
"compare-versions": "^5.0.3",
"dayjs": "^1.11.7",
"i18next": "^22.4.11",
"immer": "^9.0.19",
"intl-pluralrules": "^1.3.1",
"nativewind": "^2.0.11",
"prop-types": "^15.8.1",
"react": "18.1.0",
"react-i18next": "^12.0.0",
"react-native": "0.70.6",
"react-native-bootsplash": "^4.3.3",
"react-native-device-info": "^10.3.0",
"react-native-error-boundary": "^1.1.16",
"react-i18next": "^12.2.0",
"react-native": "0.70.7",
"react-native-bootsplash": "^4.5.2",
"react-native-device-info": "^10.4.0",
"react-native-error-boundary": "^1.2.1",
"react-native-fast-image": "^8.6.3",
"react-native-gesture-handler": "^2.8.0",
"react-native-gesture-handler": "^2.9.0",
"react-native-image-viewing": "^0.2.2",
"react-native-localize": "^2.2.4",
"react-native-localize": "^2.2.5",
"react-native-mmkv-storage": "^0.8.0",
"react-native-offline": "^6.0.0",
"react-native-paper": "^4.12.5",
"react-native-reanimated": "^2.13.0",
"react-native-offline": "^6.0.2",
"react-native-paper": "^5.3.1",
"react-native-reanimated": "^3.0.2",
"react-native-responsive-dimensions": "^3.1.1",
"react-native-restart": "^0.0.24",
"react-native-safe-area-context": "^4.4.1",
"react-native-screens": "^3.18.2",
"react-native-restart": "^0.0.27",
"react-native-safe-area-context": "^4.5.0",
"react-native-screens": "^3.20.0",
"react-native-style-utilities": "^1.0.1",
"react-native-svg": "^13.6.0",
"react-native-svg": "^13.8.0",
"react-native-vector-icons": "^9.2.0",
"rn-id-blurview": "^1.2.2",
"use-immer": "^0.8.1",
"zustand": "^4.1.4"
"zustand": "^4.3.6"
},
"devDependencies": {
"@babel/core": "^7.19.3",
"@babel/preset-typescript": "^7.18.6",
"@babel/runtime": "^7.19.4",
"@react-native-community/eslint-config": "^2.0.0",
"@tsconfig/react-native": "^2.0.2",
"@tsconfig/react-native": "^2.0.3",
"@types/jest": "^29.2.3",
"@types/react-native": "^0.70.7",
"@types/react-native-vector-icons": "^6.4.12",
"@types/react-native": "^0.70.11",
"@types/react-native-vector-icons": "^6.4.13",
"@types/react-test-renderer": "^18.0.0",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"babel-plugin-module-resolver": "^4.1.0",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"@typescript-eslint/parser": "^5.54.1",
"babel-plugin-module-resolver": "^5.0.0",
"eslint": "7.32.0",
"eslint-import-resolver-babel-module": "^5.3.1",
"eslint-import-resolver-typescript": "^3.5.2",
"eslint-plugin-import": "^2.26.0",
"eslint-import-resolver-babel-module": "^5.3.2",
"eslint-import-resolver-typescript": "^3.5.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-native": "^4.0.0",
"husky": "^8.0.2",
"lint-staged": "^13.0.4",
"lint-staged": "^13.1.0",
"metro-react-native-babel-preset": "0.72.3",
"patch-package": "^6.5.0",
"patch-package": "^6.5.1",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.8.0",
"prettier-plugin-tailwindcss": "^0.2.1",
"react-test-renderer": "18.1.0",
"tailwindcss": "^3.2.7",
"typescript": "^4.9.3"
},
"resolutions": {
Expand Down
103 changes: 0 additions & 103 deletions patches/@gorhom+animated-tabbar+2.1.2.patch

This file was deleted.

Binary file added src/assets/characters/406.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/characters/407.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/characters/408.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/characters/409.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/characters/410.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ import char402 from 'assets/characters/402.png';
import char403 from 'assets/characters/403.png';
import char404 from 'assets/characters/404.png';
import char405 from 'assets/characters/405.png';
import char406 from 'assets/characters/406.png';
import char407 from 'assets/characters/407.png';
import char408 from 'assets/characters/408.png';
import char409 from 'assets/characters/409.png';
import char410 from 'assets/characters/410.png';
import char501 from 'assets/characters/501.png';
import char502 from 'assets/characters/502.png';
import char503 from 'assets/characters/503.png';
Expand Down Expand Up @@ -99,6 +104,11 @@ export const charaImgs = [
char403,
char404,
char405,
char406,
char407,
char408,
char409,
char410,
char501,
char502,
char503,
Expand Down
22 changes: 8 additions & 14 deletions src/components/connectstatus/index.tsx
Original file line number Diff line number Diff line change
@@ -1,45 +1,39 @@
import React from 'react';
import {useTranslation} from 'react-i18next';
import {StyleSheet, View} from 'react-native';
import {View} from 'react-native';
import {NetworkConsumer} from 'react-native-offline';
import {Colors, Text} from 'react-native-paper';
import {Text, useTheme} from 'react-native-paper';
import {useSafeAreaInsets} from 'react-native-safe-area-context';
import AppStyles, {padding} from 'theme/styles';

/**
* Connect Status
*/
const ConnectStatus = () => {
const {t} = useTranslation();
const {colors} = useTheme();
const insets = useSafeAreaInsets();
const safeInsets = {
paddingTop: insets.top,
};
const box = {
backgroundColor: colors.error,
};

return (
<NetworkConsumer>
{({isConnected}) =>
isConnected ? (
<View style={safeInsets} />
) : (
<View style={[styles.box, safeInsets]}>
<Text style={AppStyles.whiteText}>
{t('no-internet-connection')}
</Text>
<View className="p-3" style={[box, safeInsets]}>
<Text className="text-white">{t('no-internet-connection')}</Text>
</View>
)
}
</NetworkConsumer>
);
};

const styles = StyleSheet.create({
box: {
backgroundColor: Colors.red600,
padding,
},
});

ConnectStatus.whyDidYouRender = true;

export default React.memo(ConnectStatus);
Loading

0 comments on commit 0dd8c67

Please sign in to comment.