Skip to content

Commit 162e97f

Browse files
authored
Merge pull request #174 from AElfProject/feature/url-change
Feature/url change
2 parents 8eb05d0 + af616aa commit 162e97f

File tree

41 files changed

+1267
-771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1267
-771
lines changed

.eslintrc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,15 @@
1010
"extensions": [".js", ".jsx"]
1111
}
1212
],
13+
"no-unused-vars": 1,
1314
"react/prop-types": 0,
1415
"react/no-redundant-should-component-update": 0,
1516
"no-underscore-dangle": 0,
1617
"no-param-reassign": 0,
1718
"import/imports-first": ["error", "absolute-first"],
18-
"import/newline-after-import": "error"
19+
"import/newline-after-import": "error",
20+
"react/jsx-props-no-spreading": 0,
21+
"jsx-a11y/anchor-is-valid": 0
1922
},
2023
"globals": {
2124
"window": true,
@@ -25,5 +28,16 @@
2528
"FileReader": true,
2629
"Blob": true,
2730
"navigator": true
31+
},
32+
"settings": {
33+
"import/resolver": {
34+
"alias": {
35+
"map": [
36+
["@", "./src/"],
37+
["@utils", "./src/utils"],
38+
["@actions", "./src/redux/actions"]
39+
]
40+
}
41+
}
2842
}
2943
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"apisauce": "^0.16.0",
3333
"axios": "^0.19.0",
3434
"bignumber.js": "^9.0.2",
35+
"chalk": "^2.4.2",
3536
"classnames": "^2.2.6",
3637
"clsx": "^1.2.1",
3738
"copy-to-clipboard": "^3.2.0",
@@ -42,6 +43,8 @@
4243
"echarts": "4.5.0",
4344
"echarts-for-react": "^2.0.14",
4445
"eslint-config-prettier": "6.7.0",
46+
"eslint-import-resolver-alias": "^1.1.2",
47+
"eslint-plugin-import": "^2.27.5",
4548
"eslint-plugin-prettier": "^4.2.1",
4649
"file-saver": "^2.0.2",
4750
"i18next": "^19.0.0",
@@ -112,7 +115,6 @@
112115
"eslint-config-airbnb-base": "^14.0.0",
113116
"eslint-loader": "^3.0.2",
114117
"eslint-plugin-babel": "^5.3.0",
115-
"eslint-plugin-import": "^2.18.2",
116118
"eslint-plugin-jsx-a11y": "^6.2.3",
117119
"eslint-plugin-react": "^7.16.0",
118120
"eslint-plugin-react-hooks": "^4.6.0",

scripts/verify-commit-msg.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const chalk = require("chalk");
2+
3+
const msgPath = process.env.HUSKY_GIT_PARAMS;
4+
const msg = require("fs").readFileSync(msgPath, "utf-8").trim();
5+
6+
const commitRE =
7+
/^(revert: )?(feat|security|fix|polish|docs|style|refactor|perf|test|workflow|ci|chore|types|build)(\(.+\))?: .{1,50}/;
8+
9+
if (!commitRE.test(msg)) {
10+
console.log();
11+
console.error(
12+
` ${chalk.bgRed.white(" ERROR ")} ${chalk.red(
13+
`invalid commit message format.`
14+
)}\n\n${chalk.red(
15+
` Proper commit message format is required for automated changelog generation. Examples:\n\n`
16+
)} ${chalk.green(`feat(wallet): add getContractAddress`)}\n` +
17+
` ${chalk.green(
18+
`fix(contract): handle contract conflict (close #28)`
19+
)}\n\n${chalk.red(
20+
` See .github/COMMIT_CONVENTION.md for more details.\n`
21+
)}${chalk.red(
22+
` You can also use ${chalk.cyan(
23+
`npm run commit`
24+
)} to interactively generate a commit message.\n`
25+
)}`
26+
);
27+
process.exit(1);
28+
}

src/api/url.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ export const VIEWER_GET_FILE = "/viewer/getFile"
77
export const VIEWER_EVENT_LIST = "/viewer/eventList"
88
export const VIEWER_GET_ALL_TOKENS = "/viewer/getAllTokens"
99
export const VIEWER_TOKEN_TX_LIST = "/viewer/tokenTxList"
10+
export const VIEWER_TOKEN_ALL_TX_LIST = "/viewer/all/tokenTxList"
1011

1112
export const TOKEN_PRICE = "/token/price"

src/assets/less/components.less

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@
119119
}
120120

121121
.ant-tag.unconfirmed {
122-
width: 96px !important;
122+
padding: 2px 8px 2px 18px !important;
123123
height: 24px !important;
124124
font-size: 12px !important;
125125
padding: 2px 8px 2px 18px !important;
126126
color: @sunset-orange !important;
127127
background: url("../../assets/images/bg_unconfirmed.png") no-repeat !important;
128-
background-size: 96px 24px !important;
128+
background-size: 179px 24px !important;
129129
}
130130
.ant-tag.confirmations {
131131
padding: 2px 8px 2px 18px !important;
@@ -176,7 +176,9 @@
176176
padding: 9px 16px;
177177
color: @scorpion;
178178
}
179-
.ant-select-dropdown-menu-item:hover:not(.ant-select-dropdown-menu-item-disabled) {
179+
.ant-select-dropdown-menu-item:hover:not(
180+
.ant-select-dropdown-menu-item-disabled
181+
) {
180182
background: #f6f7fa;
181183
}
182184
.ant-select-dropdown-menu-item-selected {
@@ -192,4 +194,4 @@
192194

193195
.ant-select-item {
194196
color: @scorpion;
195-
}
197+
}

src/components/AddressLink/index.jsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@
44
import React from "react";
55
import PropTypes from "prop-types";
66
import { Link } from "react-router-dom";
7-
import config from "../../common/config";
7+
import addressFormat from "../../utils/addressFormat";
88

99
const AddressLink = (props) => {
10-
const { address, suffix } = props;
11-
10+
const { address: prefixAddress, suffix, hash } = props;
11+
const address = addressFormat(prefixAddress) + (hash ?? "");
1212
return (
1313
<>
14-
<Link
15-
to={`/address/${address}`}
16-
title={`ELF_${address}_${config.viewer.chainId}`}
17-
>
18-
{`ELF_${address}_${config.viewer.chainId}`}
14+
<Link to={`/address/${address}`} title={`${address}`}>
15+
{`${address}`}
1916
</Link>
2017
{suffix}
2118
</>

0 commit comments

Comments
 (0)