Skip to content

Commit aa39f73

Browse files
Merge pull request coingrig#5 from coingrig/workflow/ci
Workflow/ci
2 parents 0abd519 + 393e9db commit aa39f73

File tree

14 files changed

+60
-12
lines changed

14 files changed

+60
-12
lines changed

Diff for: .github/workflows/ci.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CI
2+
on: [push,pull_request]
3+
jobs:
4+
build-lint-audit-test:
5+
name: Build and Lint
6+
runs-on: ubuntu-20.04
7+
strategy:
8+
matrix:
9+
node-version: [14.x]
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Use Node.js ${{ matrix.node-version }}
13+
uses: actions/setup-node@v2
14+
with:
15+
node-version: ${{ matrix.node-version }}
16+
- name: Get Yarn cache directory
17+
run: |
18+
YARN_CACHE_DIR=$(yarn cache dir)
19+
echo $YARN_CACHE_DIR
20+
echo "::set-output name=YARN_CACHE_DIR::$YARN_CACHE_DIR"
21+
id: yarn-cache-dir
22+
- name: Get Node version
23+
run: |
24+
node -v
25+
- name: Get Yarn version
26+
run: |
27+
YARN_VERSION=$(yarn --version)
28+
echo $YARN_VERSION
29+
echo "::set-output name=YARN_VERSION::$YARN_VERSION"
30+
id: yarn-version
31+
- name: Cache yarn dependencies
32+
uses: actions/cache@v2
33+
with:
34+
path: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }}
35+
key: yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}
36+
- run: yarn --frozen-lockfile
37+
- run: yarn lint
38+
# - run: yarn audit:ci
39+
all-jobs-pass:
40+
name: All jobs pass
41+
runs-on: ubuntu-20.04
42+
needs:
43+
- build-lint-audit-test
44+
steps:
45+
- run: echo "Great success!"

Diff for: App.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react';
22
import {Platform, StatusBar} from 'react-native';
33
import {NavigationContainer} from '@react-navigation/native';
4-
import AppStateServices from './src/services/appStates';
4+
// eslint-disable-next-line no-unused-vars
5+
import AppsStateService from './src/services/appStates';
56
import {NavigationScreens} from './src/routes';
67
import {SafeAreaProvider} from 'react-native-safe-area-context';
78
import {LoadingSheet} from './src/components/loadingSheet';

Diff for: shim.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-undef */
12
if (typeof __dirname === 'undefined') {
23
global.__dirname = '/';
34
}

Diff for: src/components/Receive/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export function ReceiveContainer(props) {
2020
setImageUri(response);
2121
})
2222
.catch(err => console.log('Cannot create QR code', err));
23+
// eslint-disable-next-line react-hooks/exhaustive-deps
2324
}, []);
2425

2526
const shareAddress = async () => {

Diff for: src/components/Send/index.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export function SendContainer(props) {
4040
const [wallet, setWallet] = useState<any>();
4141
const [fees, setFees] = useState<any>();
4242
const [feeFiat, setFeeFiat] = useState<any>(0);
43-
const [max, setMax] = useState<any>(0);
4443
const [toFiat, setToFiat] = useState<string>('$0');
4544
const [keyboardEnabled, setKeyboardEnabled] = useState(false);
4645

@@ -60,7 +59,6 @@ export function SendContainer(props) {
6059
}, []);
6160

6261
const setupWallet = async () => {
63-
setMax(WalletStore.getWalletByCoinId(props.coin)?.balance ?? 0);
6462
let chainKeys = await CryptoService.getChainPrivateKeys();
6563
let descriptor = Object.assign({}, props.coinDescriptor, {
6664
privKey: chainKeys[props.coinDescriptor.chain],

Diff for: src/components/smallButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import {Text, View, StyleSheet, TouchableOpacity} from 'react-native';
2+
import {Text, StyleSheet, TouchableOpacity} from 'react-native';
33

44
export function SmallButton(props) {
55
return (

Diff for: src/routes.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function BottomTabs() {
125125
// unmountOnBlur: true,
126126
headerShown: true,
127127
headerTitleAlign: 'left',
128-
headerTitle: props => <SmallLogo />,
128+
headerTitle: () => <SmallLogo />,
129129
headerStyle: {
130130
shadowColor: 'transparent', // ios
131131
elevation: 0, // android
@@ -146,7 +146,7 @@ function BottomTabs() {
146146
options={{
147147
headerShown: true,
148148
headerTitleAlign: 'left',
149-
headerTitle: props => <SmallLogo />,
149+
headerTitle: () => <SmallLogo />,
150150
headerStyle: {
151151
shadowColor: 'transparent', // ios
152152
elevation: 0, // android
@@ -167,7 +167,7 @@ function BottomTabs() {
167167
component={SettingScreen}
168168
options={{
169169
headerShown: true,
170-
headerTitle: props => <SmallLogo />,
170+
headerTitle: () => <SmallLogo />,
171171
headerTitleAlign: 'left',
172172
headerStyle: {
173173
shadowColor: 'transparent', // ios

Diff for: src/screens/Onboarding/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, {useRef, useState} from 'react';
2-
import {View, Text, Button, Pressable} from 'react-native';
2+
import {View, Text, Pressable} from 'react-native';
33
import PagerView from 'react-native-pager-view';
44
import {useTranslation} from 'react-i18next';
55
import {useNavigation, CommonActions} from '@react-navigation/native';

Diff for: src/screens/SendReceive/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const SendReceiveScreen = ({route}) => {
2424
const wallet = WalletStore.getWalletByCoinId(route.params.coin);
2525
setAddress(WalletStore.getWalletAddressByChain(wallet?.chain ?? '') ?? '');
2626
setCoinDescriptor(wallet ?? {});
27+
// eslint-disable-next-line react-hooks/exhaustive-deps
2728
}, []);
2829

2930
const loading = () => {

Diff for: src/screens/Start/styles.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {StyleSheet} from 'react-native';
2-
import {Colors} from 'utils/colors';
32

43
export const styles = StyleSheet.create({
54
container: {

Diff for: src/screens/WalletSetup/importWallet.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {Colors} from 'utils/colors';
1414
import {COIN_LIST} from 'utils/constants';
1515
import {showMessage} from 'react-native-flash-message';
1616

17-
export default function ImportWalletScreen({route}) {
17+
export default function ImportWalletScreen({}) {
1818
const {t} = useTranslation();
1919
const navigation = useNavigation();
2020
const [copiedText, setCopiedText] = React.useState('');

Diff for: src/screens/WalletSetup/validateWallet.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default function ValidateWalletScreen({route}) {
2323

2424
React.useEffect(() => {
2525
createWallet();
26+
// eslint-disable-next-line react-hooks/exhaustive-deps
2627
}, [loading]);
2728

2829
const fetchCopiedText = async () => {
@@ -39,6 +40,7 @@ export default function ValidateWalletScreen({route}) {
3940
};
4041
const createWallet = async () => {
4142
if (loading) {
43+
//@ts-ignore
4244
LoadingModal.instance.current?.show();
4345
await sleep(500);
4446
const newWallet = await WalletStore.createWallets(

Diff for: src/services/appStates.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ class AppsStatesService {
4141
);
4242
}
4343
}
44-
44+
//@ts-ignore
4545
export default new AppsStatesService();

Diff for: src/services/crypto.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class CryptoService {
8080
// The price can be actually 0
8181
newPrice = parseFloat(newPrice);
8282
WalletStore.setPrice(wallet.symbol, newPrice);
83-
}
83+
}
8484
let cryptoWallet = WalletFactory.getWallet(wallet);
8585
const balance = await cryptoWallet.getBalance();
8686
const unconfirmedBalance = balance.getUnconfirmedBalance();

0 commit comments

Comments
 (0)