Skip to content

Commit f9da3f1

Browse files
committed
test version 1
1 parent 0f21949 commit f9da3f1

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

+285
-238
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.9.4
1+
18

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
dist/

eslint.config.mjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import tseslint from 'typescript-eslint';
2+
import pluginReact from 'eslint-plugin-react';
3+
import globals from 'globals';
4+
5+
export default [
6+
{
7+
files: ['**/*.{ts,tsx}'],
8+
languageOptions: {
9+
parser: tseslint.parser,
10+
parserOptions: {
11+
project: './tsconfig.json',
12+
tsconfigRootDir: process.cwd(),
13+
},
14+
globals: {
15+
...globals.browser,
16+
...globals.node,
17+
},
18+
},
19+
plugins: {
20+
'@typescript-eslint': tseslint.plugin,
21+
react: pluginReact,
22+
},
23+
settings: {
24+
react: {
25+
version: 'detect',
26+
},
27+
},
28+
rules: {
29+
...tseslint.configs.recommended[0].rules,
30+
...pluginReact.configs.recommended.rules,
31+
'@typescript-eslint/await-thenable': 'warn',
32+
'@typescript-eslint/no-explicit-any': 'off',
33+
'@typescript-eslint/no-require-imports': 'off',
34+
'react/no-deprecated': 'warn',
35+
// Uncomment this if you want to ignore apostrophe warnings
36+
'react/no-unescaped-entities': 'off',
37+
},
38+
},
39+
{
40+
ignores: ['node_modules', 'dist', 'public'],
41+
},
42+
];

package.json

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"what-input": "5.0.5"
2828
},
2929
"devDependencies": {
30+
"@types/node": "^18.19.115",
3031
"@types/react": "16.1.0",
3132
"@types/react-dom": "16.0.4",
3233
"@types/react-hot-loader": "3.0.6",
@@ -37,56 +38,66 @@
3738
"@types/react-transition-group": "2.0.8",
3839
"@types/valid-url": "1.0.2",
3940
"@types/webpack-env": "1.13.5",
41+
"@typescript-eslint/eslint-plugin": "^8.36.0",
42+
"@typescript-eslint/parser": "^8.36.0",
4043
"babel-loader": "7.1.4",
4144
"chalk": "2.3.2",
4245
"clean-webpack-plugin": "0.1.19",
4346
"copy-webpack-plugin": "4.5.1",
47+
"cross-env": "^7.0.3",
4448
"css-loader": "0.28.11",
49+
"eslint": "^9.30.1",
50+
"eslint-config-prettier": "^10.1.5",
51+
"eslint-plugin-import": "^2.32.0",
52+
"eslint-plugin-jsx-a11y": "^6.10.2",
53+
"eslint-plugin-react": "^7.37.5",
54+
"eslint-plugin-react-hooks": "^5.2.0",
4555
"express": "4.16.3",
4656
"extract-text-webpack-plugin": "4.0.0-beta.0",
4757
"favicons-webpack-plugin": "0.0.9",
4858
"file-loader": "1.1.11",
59+
"globals": "^16.3.0",
4960
"html-webpack-plugin": "3.0.6",
50-
"husky": "0.14.3",
61+
"husky": "^9.1.7",
5162
"lint-staged": "7.0.4",
52-
"sass": "^1.73.0",
63+
"prettier": "^3.6.2",
5364
"redux-devtools-extension": "2.13.2",
5465
"resolve-url-loader": "2.3.0",
66+
"sass": "^1.73.0",
5567
"sass-loader": "6.0.7",
5668
"style-loader": "0.20.3",
69+
"terser-webpack-plugin": "^2.3.8",
5770
"ts-loader": "4.0.1",
58-
"tslint": "5.9.1",
5971
"tslint-config-prettier": "1.10.0",
60-
"tslint-microsoft-contrib": "5.0.3",
6172
"tslint-react": "3.5.1",
62-
"typescript": "2.7.2",
63-
"uglifyjs-webpack-plugin": "1.2.4",
73+
"typescript": "^5.8.3",
74+
"typescript-eslint": "^8.36.0",
6475
"webpack": "4.1.1",
6576
"webpack-cli": "2.0.12",
6677
"webpack-dev-server": "3.1.1",
6778
"webpack-hot-middleware": "2.21.2",
6879
"webpack-merge": "4.1.2",
6980
"webpackbar": "2.6.1"
7081
},
82+
"overrides": {
83+
"node-sass": "npm:sass@^1.73.0"
84+
},
7185
"scripts": {
72-
"tscheck": "tsc --noEmit",
73-
"tslint": "tslint --project .",
74-
"prepush": "npm run tscheck",
75-
"precommit": "lint-staged",
86+
"lint": "eslint . --ext .ts,.tsx",
87+
"lint:fix": "eslint . --ext .ts,.tsx --fix",
88+
"prepare": "husky install",
7689
"test": "echo \"Error: no test specified\" && exit 1",
7790
"start": "webpack-dev-server --mode development --config ./webpack_config/webpack.dev.js",
78-
"build": "webpack --mode production --config webpack_config/webpack.prod.js -p",
91+
"build": "NODE_OPTIONS=--openssl-legacy-provider webpack --mode production --config webpack_config/webpack.prod.js -p",
7992
"prettier:diff": "prettier --write --config ./.prettierrc --list-different \"src/**/*.ts\" \"src/**/*.tsx\"",
8093
"formatAll": "find ./src/ -name '*.ts*' | xargs prettier --write --config ./.prettierrc --config-precedence file-override"
8194
},
82-
"precommit": "lint-staged",
8395
"lint-staged": {
8496
"*.{ts,tsx}": [
8597
"prettier --write --config ./.prettierrc --config-precedence file-override",
8698
"git add"
8799
]
88100
},
89-
"prepush": "npm run tslint && npm run tscheck",
90101
"repository": {
91102
"type": "git",
92103
"url": "git+https://github.com/MyCryptoHQ/React-Typescript-Web3.git"

src/app/app.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@import 'src/sass/mixins/index';
2-
@import 'src/sass/variables/index';
1+
@use 'src/sass/mixins/index' as mixins;
2+
@use 'src/sass/variables/index' as vars;
33

44
.App {
55
display: flex;

src/app/details/block-details.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class BlockDetailsClass extends React.Component<Props, State> {
2424
data: { block: null, pending: false }
2525
};
2626

27-
public componentWillMount() {
27+
public UNSAFE_componentWillMount() {
2828
this.fetchBlock();
2929
}
3030

src/app/details/details.scss

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import 'src/sass/variables/index';
1+
@use 'src/sass/variables/index' as vars;
22

33
.Details {
44
div.skeleton,
@@ -18,19 +18,19 @@
1818
padding: 1rem 2rem;
1919
margin: -1rem -2rem;
2020
margin-bottom: 2rem;
21-
border-bottom: 1px solid $border-color;
21+
border-bottom: 1px solid vars.$border-color;
2222
&-title {
2323
font-size: 1.25rem;
2424
font-weight: 500;
25-
color: $text-color;
25+
color: vars.$text-color;
2626
word-break: break-all;
2727
}
2828
&-timestamp {
2929
margin-left: 1rem;
3030
text-align: right;
3131
font-size: 1rem;
3232
font-weight: 400;
33-
color: $blue-gray;
33+
color: vars.$blue-gray;
3434
min-width: 120px;
3535
}
3636

@@ -69,12 +69,12 @@
6969

7070
&:not(:last-child) {
7171
margin-bottom: 2rem;
72-
border-bottom: 1px solid $border-color;
72+
border-bottom: 1px solid vars.$border-color;
7373
}
7474
&-title {
7575
font-size: 1rem;
7676
font-weight: 400;
77-
color: $text-color;
77+
color: vars.$text-color;
7878
width: 8rem;
7979
margin-right: 3rem;
8080

@@ -109,11 +109,11 @@
109109
}
110110
}
111111
p {
112-
color: $blue-gray;
112+
color: vars.$blue-gray;
113113
font-weight: 400;
114114
font-size: 1.1rem;
115115
&:first-child {
116-
color: $blue-gray-light;
116+
color: vars.$blue-gray-light;
117117
font-size: 0.9rem;
118118
}
119119
}
@@ -128,10 +128,10 @@
128128
th {
129129
font-size: 1rem;
130130
font-weight: 400;
131-
color: $text-color;
131+
color: vars.$text-color;
132132
padding-bottom: 1rem;
133133
padding-left: 1rem;
134-
border-bottom: 1px solid $border-color;
134+
border-bottom: 1px solid vars.$border-color;
135135
text-align: right;
136136
&:first-child {
137137
text-align: left;
@@ -143,7 +143,7 @@
143143
font-size: 1rem;
144144
font-weight: 400;
145145
padding: 1rem 0rem;
146-
color: $blue-gray;
146+
color: vars.$blue-gray;
147147
text-align: right;
148148
white-space: nowrap;
149149
vertical-align: top;
@@ -157,7 +157,7 @@
157157
}
158158
}
159159
tr:not(:last-child) > td {
160-
border-bottom: 1px solid $border-color;
160+
border-bottom: 1px solid vars.$border-color;
161161
}
162162
}
163163
}

src/app/details/tx-details.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class TxDetailsClass extends React.Component<Props, State> {
2727
data: { transaction: null, pending: false, confirmationDuration: null, txs: [] }
2828
};
2929

30-
public componentWillMount() {
30+
public UNSAFE_componentWillMount() {
3131
this.setState({ data: { ...this.state.data, pending: true } });
3232
this.setConfirmationDuration();
3333
this.fetchTransaction();
@@ -90,9 +90,9 @@ export class TxDetailsClass extends React.Component<Props, State> {
9090
this.setState({ data: { ...this.state.data, pending: true } });
9191
fetchAsync(node.url + '/api/block/' + blockHeight)
9292
.then(json => {
93-
const txs = json.data.txs.slice(0, 5);
94-
95-
this.setState({ data: { ...this.state.data, txs, pending: true } });
93+
//const txs = json.data.txs.slice(0, 5);
94+
console.log(json)
95+
this.setState({ data: { ...this.state.data, pending: true } });
9696
})
9797
.catch(error => {
9898
console.log(error);
@@ -154,7 +154,7 @@ export class TxDetailsClass extends React.Component<Props, State> {
154154
</MetaTags>
155155
{!transaction.tx_hash && (
156156
<h1 className="Details-header-title">
157-
Can't find transaction data for tx hash {this.props.match.params.transaction}
157+
Can&rsquo;t find transaction data for tx hash {this.props.match.params.transaction}
158158
</h1>
159159
)}
160160
{transaction.tx_hash && (

src/app/footer/footer.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
@import 'src/sass/variables/index';
1+
@use 'src/sass/variables/index' as vars;
22

33
.Footer {
44
display: block;
5-
background-color: $footer-color;
5+
background-color: vars.$footer-color;
66
width: 100%;
77
background-size: 5rem;
88
color: white;
@@ -107,6 +107,6 @@
107107
color: white;
108108
}
109109
a {
110-
transition: opacity $transition;
110+
transition: opacity vars.$transition;
111111
}
112112
}

src/app/home/home.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@import 'src/sass/variables/index';
2-
@import 'src/sass/mixins/index';
1+
@use 'src/sass/variables/index' as vars;
2+
@use 'src/sass/mixins/index' as mixins;
33

44
.New-User-CTA {
55
display: flex;
@@ -16,13 +16,13 @@
1616
&-title {
1717
font-size: 2rem;
1818
font-weight: 400;
19-
color: $text-color;
19+
color: vars.$text-color;
2020
white-space: nowrap;
2121
margin-bottom: 0.5rem;
2222
}
2323
&-text {
2424
font-size: 1rem;
25-
color: $blue-gray-light;
25+
color: vars.$blue-gray-light;
2626
margin-bottom: 1rem;
2727
line-height: 1.75;
2828
}
@@ -31,7 +31,7 @@
3131
flex-direction: row;
3232
flex-wrap: nowrap;
3333
padding-top: 1rem;
34-
border-top: 1px solid $border-color;
34+
border-top: 1px solid vars.$border-color;
3535
}
3636
&-link {
3737
display: block;
@@ -41,8 +41,8 @@
4141
}
4242
&-graph {
4343
margin: 0.5rem 0;
44-
border: 1px solid $border-color;
45-
border-radius: $border-radius;
44+
border: 1px solid vars.$border-color;
45+
border-radius: vars.$border-radius;
4646
height: inherit;
4747
width: 133%;
4848
}

0 commit comments

Comments
 (0)