Skip to content

Commit 671f054

Browse files
committed
Remove dependency incompatible with react-scripts-v1.1.1
- Remove dependency - Create local utils with the same evaluations than `yn`
1 parent 03c3bc0 commit 671f054

File tree

7 files changed

+20
-11
lines changed

7 files changed

+20
-11
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
"react-transition-group": "^2.2.1",
2828
"selenium-webdriver": "^3.6.0",
2929
"sweetalert": "^2.1.0",
30-
"web3": "^1.0.0-beta.30",
31-
"yn": "^3.0.0"
30+
"web3": "^1.0.0-beta.30"
3231
},
3332
"scripts": {
3433
"build-css": "node-sass-chokidar src/assets/stylesheets/application.scss -o src/assets/stylesheets --output-style=compressed",

src/components/Header.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import menuOpenIcon from '../assets/images/icons/icon-close.svg'
66
import { Wallet } from './Wallet'
77
import { DailyQuotaModal } from './DailyQuotaModal'
88
import { inject, observer } from 'mobx-react/index'
9-
import yn from 'yn'
9+
import yn from './utils/yn'
1010

1111
const getMobileMenuLinks = (onMenuToggle, withoutEvents) =>
1212
(<div className="links_container_mobile">

src/components/RelayEvents.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { inject, observer } from "mobx-react";
33
import { EventsListHeader } from './index'
44
import { Event } from './index'
5-
import yn from 'yn'
5+
import yn from './utils/yn'
66
import { Redirect } from 'react-router'
77

88

src/components/StatisticsPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import pattern from '../assets/images/pattern.svg'
44
import { BridgeStatistics } from './index'
55
import { TransactionsStatistics } from './TransactionsStatistics'
66
import { BRIDGE_MODES } from '../stores/utils/bridgeMode'
7-
import yn from 'yn'
7+
import yn from './utils/yn'
88
import { Redirect } from 'react-router'
99

1010
@inject("RootStore")

src/components/StatusPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { inject, observer } from "mobx-react"
33
import { Configuration } from './Configuration'
44
import { Authority } from './Authority'
55
import pattern from '../assets/images/pattern.svg'
6-
import yn from 'yn'
6+
import yn from './utils/yn'
77

88

99
@inject("RootStore")

src/components/utils/yn.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const yn = input => {
2+
input = String(input).trim();
3+
4+
if (/^(?:y|yes|true|1)$/i.test(input)) {
5+
return true;
6+
}
7+
8+
if (/^(?:n|no|false|0)$/i.test(input)) {
9+
return false;
10+
}
11+
12+
return false;
13+
};
14+
15+
export default yn

0 commit comments

Comments
 (0)