Skip to content

Commit 7261a32

Browse files
committed
feat: added WalletConnect support
1 parent 3c3fd95 commit 7261a32

File tree

32 files changed

+886
-501
lines changed

32 files changed

+886
-501
lines changed

package.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"@web3-react/core": "^6.1.1",
4949
"@web3-react/injected-connector": "^6.0.7",
5050
"@web3-react/network-connector": "^6.1.5",
51+
"@web3-react/walletconnect-connector": "^6.2.4",
5152
"antd": "~4.16.0",
5253
"browserslist": "^4.16.3",
5354
"clsx": "^1.1.0",
@@ -107,19 +108,19 @@
107108
"babel-plugin-styled-components": "^1.10.7",
108109
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
109110
"cssnano": "^4.1.10",
110-
"eslint": "^6.8.0",
111-
"eslint-config-prettier": "^6.10.0",
112-
"eslint-config-prettier-standard": "^3.0.1",
113-
"eslint-config-standard": "^14.1.0",
114-
"eslint-import-resolver-parcel": "^1.10.3",
115-
"eslint-plugin-import": "^2.20.1",
116-
"eslint-plugin-node": "^11.0.0",
117-
"eslint-plugin-prettier": "^3.1.2",
118-
"eslint-plugin-promise": "^4.2.1",
119-
"eslint-plugin-react": "^7.18.3",
120-
"eslint-plugin-react-hooks": "^4.0.8",
111+
"eslint": "^7.32.0",
112+
"eslint-config-prettier": "^8.3.0",
113+
"eslint-config-prettier-standard": "^4.0.1",
114+
"eslint-config-standard": "^16.0.3",
115+
"eslint-import-resolver-parcel": "^1.10.6",
116+
"eslint-plugin-import": "^2.24.2",
117+
"eslint-plugin-node": "^11.1.0",
118+
"eslint-plugin-prettier": "^4.0.0",
119+
"eslint-plugin-promise": "^5.1.0",
120+
"eslint-plugin-react": "^7.25.2",
121+
"eslint-plugin-react-hooks": "^4.2.0",
121122
"eslint-plugin-security": "^1.4.0",
122-
"eslint-plugin-standard": "^4.0.1",
123+
"eslint-plugin-standard": "^5.0.0",
123124
"husky": "^4.2.3",
124125
"lint-staged": "^10.0.7",
125126
"parcel": "^1.12.4",
@@ -128,9 +129,9 @@
128129
"postcss-custom-media": "^7.0.8",
129130
"postcss-modules": "^1.5.0",
130131
"postcss-preset-env": "^6.7.0",
131-
"prettier": "^2.0.2",
132-
"prettier-config-standard": "^1.0.1",
133-
"prettier-plugin-packagejson": "^2.1.2",
132+
"prettier": "^2.4.1",
133+
"prettier-config-standard": "^4.0.0",
134+
"prettier-plugin-packagejson": "^2.2.12",
134135
"stylelint": "^13.2.1",
135136
"stylelint-config-recommended": "^3.0.0",
136137
"stylelint-config-styled-components": "^0.1.1",
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import React from 'react';
22
import Icon from '@ant-design/icons';
33

4-
const createCustomIcon = (IconComponent, BaseIcon = Icon) => props => <BaseIcon component={IconComponent} {...props} />;
4+
const createCustomIcon = (IconComponent, BaseIcon = Icon) =>
5+
function CustomIcon(props) {
6+
return <BaseIcon component={IconComponent} {...props} />;
7+
};
58

69
export { createCustomIcon as default };

src/adapters/react/Suspense.jsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import React from 'react';
22
import hoistNonReactStatics from 'hoist-non-react-statics';
33

4-
export const withSuspense = ({ fallback = 'Loading...' } = {}) => Component => {
5-
function WithSuspense(props) {
6-
return (
7-
<React.Suspense fallback={fallback}>
8-
<Component {...props} />
9-
</React.Suspense>
10-
);
11-
}
4+
export const withSuspense =
5+
({ fallback = 'Loading...' } = {}) =>
6+
Component => {
7+
function WithSuspense(props) {
8+
return (
9+
<React.Suspense fallback={fallback}>
10+
<Component {...props} />
11+
</React.Suspense>
12+
);
13+
}
1214

13-
const componentName = Component.displayName ?? Component.name ?? '<anonymous>';
14-
WithSuspense.displayName = `WithSuspense(${componentName})`;
15+
const componentName = Component.displayName ?? Component.name ?? '<anonymous>';
16+
WithSuspense.displayName = `WithSuspense(${componentName})`;
1517

16-
return hoistNonReactStatics(WithSuspense, Component);
17-
};
18+
return hoistNonReactStatics(WithSuspense, Component);
19+
};

src/adapters/reselect/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { createSelector } from '@reduxjs/toolkit';
22
import { uncurry } from '~/shared/fp';
33

4-
export const createCurriedSelector = curriedFn => (...selectors) => createSelector(...selectors, uncurry(curriedFn));
4+
export const createCurriedSelector =
5+
curriedFn =>
6+
(...selectors) =>
7+
createSelector(...selectors, uncurry(curriedFn));

src/app/Content.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ function useEthPricePolling({ interval = _1_MINUTE } = {}) {
7272
[dispatch, chainId, interval]
7373
);
7474

75-
const unsubscribe = React.useCallback(() => dispatch(unsubscribeFromEthPrice({ chainId }, { meta: { groupId } })), [
76-
dispatch,
77-
chainId,
78-
]);
75+
const unsubscribe = React.useCallback(
76+
() => dispatch(unsubscribeFromEthPrice({ chainId }, { meta: { groupId } })),
77+
[dispatch, chainId]
78+
);
7979

8080
React.useEffect(() => {
8181
subscribe();
Lines changed: 18 additions & 0 deletions
Loading

src/features/linguo/api/createContractApi.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -863,16 +863,18 @@ const dynamicScriptURIByChainId = {
863863

864864
const getFileTypeFromPath = path => (path ?? '').split('.').slice(-1)?.[0];
865865

866-
const onlyIfMatchingSkills = skills => ({ sourceLanguage, targetLanguage, expectedQuality }) => {
867-
/**
868-
* Z1 level does not exist for any language, so we are just using this as
869-
* a fallback in case we find an unexpected value for `expectedQuality`.
870-
* In this case, since the task is non-standard, it should not be shown
871-
* to a translator.
872-
*/
873-
const requiredLevel = translationQualityTiers[expectedQuality]?.requiredLevel ?? 'Z1';
874-
const satisfiesSource = skills.some(skill => skill.language === sourceLanguage && skill.level >= requiredLevel);
875-
const satisfiesTarget = skills.some(skill => skill.language === targetLanguage && skill.level >= requiredLevel);
866+
const onlyIfMatchingSkills =
867+
skills =>
868+
({ sourceLanguage, targetLanguage, expectedQuality }) => {
869+
/**
870+
* Z1 level does not exist for any language, so we are just using this as
871+
* a fallback in case we find an unexpected value for `expectedQuality`.
872+
* In this case, since the task is non-standard, it should not be shown
873+
* to a translator.
874+
*/
875+
const requiredLevel = translationQualityTiers[expectedQuality]?.requiredLevel ?? 'Z1';
876+
const satisfiesSource = skills.some(skill => skill.language === sourceLanguage && skill.level >= requiredLevel);
877+
const satisfiesTarget = skills.some(skill => skill.language === targetLanguage && skill.level >= requiredLevel);
876878

877-
return satisfiesSource && satisfiesTarget;
878-
};
879+
return satisfiesSource && satisfiesTarget;
880+
};

src/features/tasks/taskUpdatesSlice.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,7 @@ const notificationMakersByType = {
304304
data: {
305305
type: 'info',
306306
icon: 'confirmation',
307-
text:
308-
'The translator delivered the translated text. It will be in the Review List before the escrow payment is released.',
307+
text: 'The translator delivered the translated text. It will be in the Review List before the escrow payment is released.',
309308
url: `/translation/${id}`,
310309
},
311310
})
@@ -329,8 +328,7 @@ const notificationMakersByType = {
329328
data: {
330329
type: 'warning',
331330
icon: 'dispute',
332-
text:
333-
'The translation was challenged. Now it goes to Kleros arbitration. When Jurors decide the case you will be informed.',
331+
text: 'The translation was challenged. Now it goes to Kleros arbitration. When Jurors decide the case you will be informed.',
334332
url: `/translation/${id}`,
335333
},
336334
})

src/features/tasks/tasksSlice.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,10 @@ export const selectHasFailedById = id => state => singleTaskSlice.selectors.sele
170170

171171
export const selectErrorById = id => state => singleTaskSlice.selectors.selectError(state.tasks.entities[id]);
172172

173-
export const selectLatestBlock = ({ account, chainId }) => state =>
174-
taskUpdatesSlice.selectors.selectLatestBlock(state.tasks.updates, { account, chainId });
173+
export const selectLatestBlock =
174+
({ account, chainId }) =>
175+
state =>
176+
taskUpdatesSlice.selectors.selectLatestBlock(state.tasks.updates, { account, chainId });
175177

176178
export function* fetchByPartySaga(action) {
177179
const linguoApi = yield getContext('linguoApi');

src/features/translator/TranslatorSettingsForm.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ export default function TranslatorSettingsForm() {
135135
<Link
136136
to={{
137137
pathname: r.FAQ,
138-
hash:
139-
'#how-does-my-skill-levels-affect-the-amount-of-tasks-i-will-be-able-to-work-on-as-a-translator',
138+
hash: '#how-does-my-skill-levels-affect-the-amount-of-tasks-i-will-be-able-to-work-on-as-a-translator',
140139
}}
141140
>
142141
FAQ

0 commit comments

Comments
 (0)