Skip to content

Commit

Permalink
Run prettier on all source files
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnlauzon committed Apr 15, 2024
1 parent 29ad2b1 commit 2eea2d1
Show file tree
Hide file tree
Showing 154 changed files with 6,832 additions and 6,513 deletions.
89 changes: 44 additions & 45 deletions .github/workflows/deploy-ios-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ env:
DISTRIBUTION_PROFILE_STAGING: ${{ toJSON(secrets.APPLE_AD-HOC_PROFILE) }}
KEY_PWD: ${{ toJSON(secrets.KEYCHAIN_PWD) }}

jobs:
jobs:
build:
runs-on: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Node.js 21.5.0
uses: actions/setup-node@v1
with:
node-version: 21.5.0

- name: Install dependencies
run: npm install

- name: Install pod dependencies
run: |
cd ios && pod install
Expand All @@ -52,13 +52,13 @@ env:
- name: Select Xcode
run: sudo xcode-select -switch /Applications/Xcode_15.3.app

- name: Xcode Version
run: /usr/bin/xcodebuild -version

- name: Create build folder
run: mkdir -p build && mkdir -p dev && mkdir -p prod

- name: Build Archive
run: |
xcodebuild -workspace $WORKPLACE -scheme $SCHEME -configuration $CONFIGURATION \
Expand All @@ -73,7 +73,7 @@ env:
- name: Export PROD
run: |
xcodebuild -exportArchive -archivePath $ARCHIVE_PATH -exportPath $EXPORT_PATH_PROD . -exportOptionsPlist $PLIST_PATH_PROD \
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
Expand All @@ -87,47 +87,46 @@ env:
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
rm ~/Library/MobileDevice/Provisioning\ Profiles/dist_pp.mobileprovision
rm ~/Library/MobileDevice/Provisioning\ Profiles/dist_pp_adc.mobileprovision
deploy:
needs: [build]
if: success()
name: Deploy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- uses: actions/actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}

- name: set up JDK 17.0.10
uses: actions/setup-java@v1
with:
java-version: 17.0.10

- name: Upload to App Center STAGING
uses: wzieba/AppCenter-Github-Action@v1
with:
appName: ${{ env.APP_NAME_STAGING }}
token: ${{ env.APP_CENTER_TOKEN_STAGING }}
group: ${{ env.TESTING_GROUP_STAGING }}
file: ${{ env.UPLOAD_FILE_STAGING }}
notifyTesters: true
debug: false

- name: Upload to App Center PROD
uses: wzieba/AppCenter-Github-Action@v1
with:
appName: ${{ env.APP_NAME_PROD }}
token: ${{ env.APP_CENTER_TOKEN_PROD }}
group: ${{ env.TESTING_GROUP_PROD }}
file: ${{ env.UPLOAD_FILE_PROD }}
notifyTesters: false
debug: false

- uses: actions/checkout@master

- uses: actions/actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}

- name: set up JDK 17.0.10
uses: actions/setup-java@v1
with:
java-version: 17.0.10

- name: Upload to App Center STAGING
uses: wzieba/AppCenter-Github-Action@v1
with:
appName: ${{ env.APP_NAME_STAGING }}
token: ${{ env.APP_CENTER_TOKEN_STAGING }}
group: ${{ env.TESTING_GROUP_STAGING }}
file: ${{ env.UPLOAD_FILE_STAGING }}
notifyTesters: true
debug: false

- name: Upload to App Center PROD
uses: wzieba/AppCenter-Github-Action@v1
with:
appName: ${{ env.APP_NAME_PROD }}
token: ${{ env.APP_CENTER_TOKEN_PROD }}
group: ${{ env.TESTING_GROUP_PROD }}
file: ${{ env.UPLOAD_FILE_PROD }}
notifyTesters: false
debug: false

- name: Delete Artifact
uses: geekyeggo/delete-artifact@v1
with:
name: ${{ env.ARTIFACT_NAME }}
- name: Delete Artifact
uses: geekyeggo/delete-artifact@v1
with:
name: ${{ env.ARTIFACT_NAME }}
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
android
ios
node_modules
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"git.ignoreLimitWarning": true
}
"git.ignoreLimitWarning": true
}
12 changes: 6 additions & 6 deletions __tests__/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
* @format
*/

import 'react-native';
import React from 'react';
import App from '../src/app';
import "react-native";
import React from "react";
import App from "../src/app";

// Note: import explicitly to use the types shiped with jest.
import {it} from '@jest/globals';
import { it } from "@jest/globals";

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';
import renderer from "react-test-renderer";

it('renders correctly', () => {
it("renders correctly", () => {
renderer.create(<App />);
});
34 changes: 17 additions & 17 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: ["module:metro-react-native-babel-preset"],
plugins: [
[
require.resolve('babel-plugin-module-resolver'),
require.resolve("babel-plugin-module-resolver"),
{
cwd: 'babelrc',
extensions: ['.ts', '.tsx', '.js', '.ios.js', '.android.js'],
cwd: "babelrc",
extensions: [".ts", ".tsx", ".js", ".ios.js", ".android.js"],
alias: {
'@assets': './src/assets',
'@theme': './src/theme',
'@constants': './src/assets/constants',
'@images': './src/assets/images',
'@components': './src/components',
'@screens': './src/screens',
'@config': './src/config',
'@utils': './src/utils',
'@network': './src/network',
'@app-hooks': './src/app-hooks',
'@store': './src/store',
"@assets": "./src/assets",
"@theme": "./src/theme",
"@constants": "./src/assets/constants",
"@images": "./src/assets/images",
"@components": "./src/components",
"@screens": "./src/screens",
"@config": "./src/config",
"@utils": "./src/utils",
"@network": "./src/network",
"@app-hooks": "./src/app-hooks",
"@store": "./src/store",
},
},
],
'jest-hoist',
'react-native-reanimated/plugin',
"jest-hoist",
"react-native-reanimated/plugin",
],
};
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* @format
*/

import {AppRegistry} from 'react-native';
import {App} from './src/app';
import {name as appName} from './app.json';
import { AppRegistry } from "react-native";
import { App } from "./src/app";
import { name as appName } from "./app.json";

AppRegistry.registerComponent(appName, () => App);
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
preset: 'react-native',
preset: "react-native",
};
2 changes: 1 addition & 1 deletion metro.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');
const { getDefaultConfig, mergeConfig } = require("@react-native/metro-config");

/**
* Metro configuration
Expand Down
2 changes: 1 addition & 1 deletion react-native.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ module.exports = {
ios: {},
android: {},
},
assets: ['./src/assets/fonts/'],
assets: ["./src/assets/fonts/"],
};
6 changes: 3 additions & 3 deletions src/app-hooks/use-app-theme.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {getTheme} from '@theme/index';
import { getTheme } from "@theme/index";

type ThemeProps = 'light' | 'dark';
type ThemeProps = "light" | "dark";

export const useAppTheme = () => {
const themeType: ThemeProps = 'light';
const themeType: ThemeProps = "light";
return {
themeType,
changeAppTheme: (type: ThemeProps) => type,
Expand Down
12 changes: 6 additions & 6 deletions src/app-hooks/use-internet-connection-handle.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import {
checkConnectivity,
InternetConnectionState,
} from '@network/reducers/internet-connection-handle-reducer';
import {StoreType} from '@network/reducers/store';
import {useDispatch, useSelector} from 'react-redux';
} from "@network/reducers/internet-connection-handle-reducer";
import { StoreType } from "@network/reducers/store";
import { useDispatch, useSelector } from "react-redux";

export const useInternetConnectionHandle = () => {
const {isConnected} = useSelector<StoreType, InternetConnectionState>(
state => state.internetConnectionHandleReducer,
const { isConnected } = useSelector<StoreType, InternetConnectionState>(
(state) => state.internetConnectionHandleReducer
);
const dispatch = useDispatch();

const updateConnectivityState = (payload: boolean) => {
dispatch(checkConnectivity(payload));
};

return {isConnected, checkConnectivity: updateConnectivityState};
return { isConnected, checkConnectivity: updateConnectivityState };
};
42 changes: 21 additions & 21 deletions src/app-hooks/use-logout.tsx
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
import {useStringsAndLabels} from '@app-hooks/use-strings-and-labels';
import {animationDuration} from '@assets/constants';
import {getNavigator} from '@config/app-navigation/root-navigation';
import {API} from '@network/api';
import {persistKeys} from '@network/constant';
import {clearReducer} from '@network/reducers/logout-reducer';
import {store} from '@network/reducers/store';
import AsyncStorage from '@react-native-async-storage/async-storage';
import {NavigationContainerRef} from '@react-navigation/native';
import axios from 'axios';
import {Alert} from 'react-native';
import {queryClient} from '../app';
import {navigations} from '@config/app-navigation/constant';
import { GoogleSignin } from '@react-native-google-signin/google-signin';
import { useStringsAndLabels } from "@app-hooks/use-strings-and-labels";
import { animationDuration } from "@assets/constants";
import { getNavigator } from "@config/app-navigation/root-navigation";
import { API } from "@network/api";
import { persistKeys } from "@network/constant";
import { clearReducer } from "@network/reducers/logout-reducer";
import { store } from "@network/reducers/store";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { NavigationContainerRef } from "@react-navigation/native";
import axios from "axios";
import { Alert } from "react-native";
import { queryClient } from "../app";
import { navigations } from "@config/app-navigation/constant";
import { GoogleSignin } from "@react-native-google-signin/google-signin";

export const logoutUser = async (navigation: NavigationContainerRef<any>) => {
navigation.reset({index: 0, routes: [{name: navigations.LOGIN}]});
navigation.reset({ index: 0, routes: [{ name: navigations.LOGIN }] });

store.dispatch(clearReducer());
await AsyncStorage.multiRemove([persistKeys.token, persistKeys.fcmToken]);
setTimeout(() => {
queryClient.getQueryCache().clear();
}, animationDuration.D2000);

axios.defaults.headers.common.Authorization = '';
axios.defaults.headers.common.Authorization = "";
API.initService();
};

export const useLogout = () => {
const {strings} = useStringsAndLabels();
const { strings } = useStringsAndLabels();
const navigationRef = getNavigator();

const onLogout = async () => {
const onLogout = async () => {
Alert.alert(
strings.logout,
strings.areYouLogout,
[
{text: strings.no, onPress: () => null, style: 'cancel'},
{ text: strings.no, onPress: () => null, style: "cancel" },
{
text: strings.yes,
onPress: () => {
logoutUser(navigationRef);
},
},
],
{cancelable: false},
{ cancelable: false }
);
try {
await GoogleSignin.revokeAccess();
Expand All @@ -54,5 +54,5 @@ export const useLogout = () => {
}
};

return {onLogout};
return { onLogout };
};
2 changes: 1 addition & 1 deletion src/app-hooks/use-strings-and-labels.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as strings from '@assets/strings/strings-and-labels';
import * as strings from "@assets/strings/strings-and-labels";

export type StringsAndLabelsType = {
[value in string]: string;
Expand Down
Loading

0 comments on commit 2eea2d1

Please sign in to comment.