Skip to content

Commit 6906d59

Browse files
Merge pull request #898 from asgardex/chore/package-cleanup
chore: package cleanup
2 parents 9a6e443 + fbf7138 commit 6906d59

File tree

6 files changed

+42
-172
lines changed

6 files changed

+42
-172
lines changed

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,8 @@
132132
"io-ts": "^2.2.16",
133133
"io-ts-types": "^0.5.19",
134134
"lodash": "^4.17.21",
135-
"lodash.shuffle": "^4.2.0",
136135
"observable-hooks": "^4.2.1",
137136
"qrcode": "^1.5.3",
138-
"rc-table": "^7.48.0",
139137
"react": "^18.2.0",
140138
"react-dom": "^18.2.0",
141139
"react-hook-form": "^7.34.0",
@@ -169,7 +167,6 @@
169167
"@types/eslint-plugin-jsx-a11y": "^6",
170168
"@types/fs-extra": "^9.0.13",
171169
"@types/lodash": "^4",
172-
"@types/lodash.shuffle": "^4.2.7",
173170
"@types/node": "^22.14",
174171
"@types/prettier": "^2.7.3",
175172
"@types/qrcode": "^1.4.2",

src/renderer/components/poolActionsHistory/PoolActionsHistory.helper.test.ts

Lines changed: 34 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -133,60 +133,51 @@ describe('PoolActionsHistory.helper', () => {
133133
describe('getRowKey', () => {
134134
it('should return correct id if exists', () => {
135135
expect(
136-
getRowKey(
137-
{
138-
...defaultPoolAction,
139-
in: [
140-
{
141-
...defaultTx,
142-
txID: 'inId'
143-
}
144-
]
145-
},
146-
1
147-
)
136+
getRowKey({
137+
...defaultPoolAction,
138+
in: [
139+
{
140+
...defaultTx,
141+
txID: 'inId'
142+
}
143+
]
144+
})
148145
).toEqual('inId-SWAP')
149146

150147
expect(
151-
getRowKey(
152-
{
153-
...defaultPoolAction,
154-
out: [
155-
{
156-
...defaultTx,
157-
txID: 'outId'
158-
}
159-
]
160-
},
161-
1
162-
)
148+
getRowKey({
149+
...defaultPoolAction,
150+
out: [
151+
{
152+
...defaultTx,
153+
txID: 'outId'
154+
}
155+
]
156+
})
163157
).toEqual('outId-SWAP')
164158

165159
expect(
166-
getRowKey(
167-
{
168-
...defaultPoolAction,
169-
in: [
170-
{
171-
...defaultTx,
172-
txID: 'inId'
173-
}
174-
],
175-
out: [
176-
{
177-
...defaultTx,
178-
txID: 'outId'
179-
}
180-
]
181-
},
182-
1
183-
)
160+
getRowKey({
161+
...defaultPoolAction,
162+
in: [
163+
{
164+
...defaultTx,
165+
txID: 'inId'
166+
}
167+
],
168+
out: [
169+
{
170+
...defaultTx,
171+
txID: 'outId'
172+
}
173+
]
174+
})
184175
).toEqual('inId-SWAP')
185176
})
186177

187178
it('should return default value in case there is no txId (`action.date-action.type`)', () => {
188179
// Date(0) is a default date property value for defaultPoolAction
189-
expect(getRowKey(defaultPoolAction, 1)).toEqual(`${new Date(0)}-SWAP`)
180+
expect(getRowKey(defaultPoolAction)).toEqual(`${new Date(0)}-SWAP`)
190181
})
191182
})
192183

src/renderer/components/poolActionsHistory/PoolActionsHistory.helper.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { TxHash } from '@xchainjs/xchain-client'
22
import { array as A, function as FP, option as O } from 'fp-ts'
3-
import { GetRowKey } from 'rc-table/lib/interface'
43
import { FormattedDateParts, FormattedTime } from 'react-intl'
54

65
import { Action, Actions, ActionsPage, Tx } from '../../services/midgard/thorMidgard/types'
@@ -57,7 +56,7 @@ export const renderDate = (date: Date) => (
5756
</Styled.DateContainer>
5857
)
5958

60-
export const getRowKey: GetRowKey<Action> = (action) =>
59+
export const getRowKey = (action: Action) =>
6160
FP.pipe(
6261
action,
6362
getTxId,

src/renderer/components/poolActionsHistory/PoolActionsHistoryList.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const PoolActionsHistoryList = ({
4141
const intl = useIntl()
4242

4343
const renderListItem = useCallback(
44-
(action: Action, index: number, goToTx: OpenExplorerTxUrl) => {
44+
(action: Action, goToTx: OpenExplorerTxUrl) => {
4545
const date = H.renderDate(action.date)
4646

4747
const titleExtra = (
@@ -62,7 +62,7 @@ export const PoolActionsHistoryList = ({
6262

6363
return (
6464
<div
65-
key={H.getRowKey(action, index)}
65+
key={H.getRowKey(action)}
6666
className="flex flex-col p-2 border-t-0 first:border-t last:border-b-0 border-b border-solid border-gray0/40 dark:border-gray0d/40">
6767
<div className="flex items-center justify-between">
6868
<TxType className="mr-2" type={action.type} showTypeIcon />
@@ -80,11 +80,7 @@ export const PoolActionsHistoryList = ({
8080
return (
8181
<>
8282
<div className="bg-bg1 dark:bg-bg1d">
83-
{loading ? (
84-
<Spin className="min-h-40" />
85-
) : (
86-
actions.map((action, index) => renderListItem(action, index, goToTx))
87-
)}
83+
{loading ? <Spin className="min-h-40" /> : actions.map((action) => renderListItem(action, goToTx))}
8884
</div>
8985

9086
{total > 0 && (

src/renderer/components/wallet/phrase/NewPhraseConfirm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useCallback, useEffect, useMemo, useState } from 'react'
22

33
import { TrashIcon as DeleteOutlined, ArrowUturnRightIcon as RedoOutlined } from '@heroicons/react/24/outline'
4-
import shuffleArray from 'lodash.shuffle'
4+
import shuffleArray from 'lodash/shuffle'
55
import { useIntl } from 'react-intl'
66
import { useNavigate } from 'react-router-dom'
77
import { v4 as uuidv4 } from 'uuid'
@@ -152,7 +152,7 @@ export const NewPhraseConfirm = ({ mnemonic, onConfirm }: { mnemonic: string; on
152152
<RedoOutlined className="w-4 h-4" />
153153
</FlatButton>
154154
</h2>
155-
<div className="mb-20px w-full grid grid-cols-3 gap-1">
155+
<div className="mt-1 mb-4 w-full grid grid-cols-3 gap-1">
156156
{shuffledWordsList.map((word: WordType) => (
157157
<div key={word._id} className="text-center">
158158
<TextButton

yarn.lock

Lines changed: 2 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,7 @@ __metadata:
12161216
languageName: node
12171217
linkType: hard
12181218

1219-
"@babel/runtime@npm:^7.10.1, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.20.0, @babel/runtime@npm:^7.25.0, @babel/runtime@npm:^7.8.4":
1219+
"@babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.25.0, @babel/runtime@npm:^7.8.4":
12201220
version: 7.27.1
12211221
resolution: "@babel/runtime@npm:7.27.1"
12221222
checksum: 10/34cefcbf781ea5a4f1b93f8563327b9ac82694bebdae91e8bd9d7f58d084cbe5b9a6e7f94d77076e15b0bcdaa0040a36cb30737584028df6c4673b4c67b2a31d
@@ -3350,19 +3350,6 @@ __metadata:
33503350
languageName: node
33513351
linkType: hard
33523352

3353-
"@rc-component/context@npm:^1.4.0":
3354-
version: 1.4.0
3355-
resolution: "@rc-component/context@npm:1.4.0"
3356-
dependencies:
3357-
"@babel/runtime": "npm:^7.10.1"
3358-
rc-util: "npm:^5.27.0"
3359-
peerDependencies:
3360-
react: ">=16.9.0"
3361-
react-dom: ">=16.9.0"
3362-
checksum: 10/77b84e6cea11d7adbf68a89a49142d96129abbe485449851702d83d34ba507872404adacee39171dd47e9000556260cc76ab327e09f3320937ecb0c7e6906caa
3363-
languageName: node
3364-
linkType: hard
3365-
33663353
"@react-aria/focus@npm:^3.20.2":
33673354
version: 3.20.5
33683355
resolution: "@react-aria/focus@npm:3.20.5"
@@ -4912,16 +4899,7 @@ __metadata:
49124899
languageName: node
49134900
linkType: hard
49144901

4915-
"@types/lodash.shuffle@npm:^4.2.7":
4916-
version: 4.2.7
4917-
resolution: "@types/lodash.shuffle@npm:4.2.7"
4918-
dependencies:
4919-
"@types/lodash": "npm:*"
4920-
checksum: 10/b6417a358159982a93273a96ade01801923628bf4f288f686200501cae664d8d04deb492ec072b435a0837e6a2b671e1ae868aeaeb047242ff447fabec53d4a5
4921-
languageName: node
4922-
linkType: hard
4923-
4924-
"@types/lodash@npm:*, @types/lodash@npm:^4":
4902+
"@types/lodash@npm:^4":
49254903
version: 4.17.16
49264904
resolution: "@types/lodash@npm:4.17.16"
49274905
checksum: 10/9a8bb7471a7521bd65d528e1bd14f79819a3eeb6f8a35a8a44649a7d773775c0813e93fd93bd32ccf350bb076c0bf02c6d47877c4625f526f6dd4d283c746aec
@@ -6694,7 +6672,6 @@ __metadata:
66946672
"@types/eslint-plugin-jsx-a11y": "npm:^6"
66956673
"@types/fs-extra": "npm:^9.0.13"
66966674
"@types/lodash": "npm:^4"
6697-
"@types/lodash.shuffle": "npm:^4.2.7"
66986675
"@types/node": "npm:^22.14"
66996676
"@types/prettier": "npm:^2.7.3"
67006677
"@types/qrcode": "npm:^1.4.2"
@@ -6780,14 +6757,12 @@ __metadata:
67806757
io-ts-types: "npm:^0.5.19"
67816758
lint-staged: "npm:^13.0.0"
67826759
lodash: "npm:^4.17.21"
6783-
lodash.shuffle: "npm:^4.2.0"
67846760
observable-hooks: "npm:^4.2.1"
67856761
postcss: "npm:8.4.47"
67866762
prebuild-install: "npm:^7.1.3"
67876763
prettier: "npm:^2.6.2"
67886764
process: "npm:^0.11.10"
67896765
qrcode: "npm:^1.5.3"
6790-
rc-table: "npm:^7.48.0"
67916766
react: "npm:^18.2.0"
67926767
react-dom: "npm:^18.2.0"
67936768
react-error-overlay: "npm:^6.0.11"
@@ -8066,13 +8041,6 @@ __metadata:
80668041
languageName: node
80678042
linkType: hard
80688043

8069-
"classnames@npm:^2.2.1, classnames@npm:^2.2.5, classnames@npm:^2.2.6":
8070-
version: 2.3.1
8071-
resolution: "classnames@npm:2.3.1"
8072-
checksum: 10/28fec94a815d5f570fa6cb4baaa4a7ae1466db3c8f704802f1330180db45d3b85ef8ae612f521fb37ce2cab1c3040d1d78061697b62987bc2909f26d1ad4321f
8073-
languageName: node
8074-
linkType: hard
8075-
80768044
"clean-stack@npm:^2.0.0":
80778045
version: 2.2.0
80788046
resolution: "clean-stack@npm:2.2.0"
@@ -12183,13 +12151,6 @@ __metadata:
1218312151
languageName: node
1218412152
linkType: hard
1218512153

12186-
"lodash.shuffle@npm:^4.2.0":
12187-
version: 4.2.0
12188-
resolution: "lodash.shuffle@npm:4.2.0"
12189-
checksum: 10/06f0a00e7b06309dae8f773fd5752ba004a6a7f65d2e01d4a3906363c2fe26bccb5d3a7a3b33609e54e8194ec442f1e706f5d9388db9b46a6af74c23f57e6bb7
12190-
languageName: node
12191-
linkType: hard
12192-
1219312154
"lodash@npm:^4.17.11, lodash@npm:^4.17.15, lodash@npm:^4.17.20, lodash@npm:^4.17.21, lodash@npm:^4.17.4":
1219412155
version: 4.17.21
1219512156
resolution: "lodash@npm:4.17.21"
@@ -14027,66 +13988,6 @@ __metadata:
1402713988
languageName: node
1402813989
linkType: hard
1402913990

14030-
"rc-resize-observer@npm:^1.0.0, rc-resize-observer@npm:^1.1.0":
14031-
version: 1.2.0
14032-
resolution: "rc-resize-observer@npm:1.2.0"
14033-
dependencies:
14034-
"@babel/runtime": "npm:^7.10.1"
14035-
classnames: "npm:^2.2.1"
14036-
rc-util: "npm:^5.15.0"
14037-
resize-observer-polyfill: "npm:^1.5.1"
14038-
peerDependencies:
14039-
react: ">=16.9.0"
14040-
react-dom: ">=16.9.0"
14041-
checksum: 10/cb338ee405c6df3d072754ad2fc29c19fe90cc9264331c02b7e23cb85d75f8ad984352fa8e0ff48f339439f548613b8960992e3050754290f2e651ed71909489
14042-
languageName: node
14043-
linkType: hard
14044-
14045-
"rc-table@npm:^7.48.0":
14046-
version: 7.48.0
14047-
resolution: "rc-table@npm:7.48.0"
14048-
dependencies:
14049-
"@babel/runtime": "npm:^7.10.1"
14050-
"@rc-component/context": "npm:^1.4.0"
14051-
classnames: "npm:^2.2.5"
14052-
rc-resize-observer: "npm:^1.1.0"
14053-
rc-util: "npm:^5.41.0"
14054-
rc-virtual-list: "npm:^3.14.2"
14055-
peerDependencies:
14056-
react: ">=16.9.0"
14057-
react-dom: ">=16.9.0"
14058-
checksum: 10/5f1c6fc74333f4888f9f9a28c44ee571feec23be739d78c3a00d2fc67d811fbabd802ce39294cac66e4b7f3b8d1eda18c3e9c7eef0c3f5f58cd1a7db3abf6141
14059-
languageName: node
14060-
linkType: hard
14061-
14062-
"rc-util@npm:^5.15.0, rc-util@npm:^5.27.0, rc-util@npm:^5.36.0, rc-util@npm:^5.41.0":
14063-
version: 5.43.0
14064-
resolution: "rc-util@npm:5.43.0"
14065-
dependencies:
14066-
"@babel/runtime": "npm:^7.18.3"
14067-
react-is: "npm:^18.2.0"
14068-
peerDependencies:
14069-
react: ">=16.9.0"
14070-
react-dom: ">=16.9.0"
14071-
checksum: 10/6d5be9d79182c6b4c5a033ad6517b2940d3d2ac42a8e77ef5735591d182f8236f61bc7628d61e82a122d2046ec849462f3fe57c08d3a2a20279646785c34ec4a
14072-
languageName: node
14073-
linkType: hard
14074-
14075-
"rc-virtual-list@npm:^3.14.2":
14076-
version: 3.14.8
14077-
resolution: "rc-virtual-list@npm:3.14.8"
14078-
dependencies:
14079-
"@babel/runtime": "npm:^7.20.0"
14080-
classnames: "npm:^2.2.6"
14081-
rc-resize-observer: "npm:^1.0.0"
14082-
rc-util: "npm:^5.36.0"
14083-
peerDependencies:
14084-
react: ">=16.9.0"
14085-
react-dom: ">=16.9.0"
14086-
checksum: 10/4f37f6adef15d5aeb15120d83ef34ecc73aae0ae274552e2062ef1d8f0b76073a3baa2fe4f7354da94e6c51920f5cc44d7a6c00cc54f80b8eff49353356e132a
14087-
languageName: node
14088-
linkType: hard
14089-
1409013991
"rc@npm:^1.2.7":
1409113992
version: 1.2.8
1409213993
resolution: "rc@npm:1.2.8"
@@ -14223,13 +14124,6 @@ __metadata:
1422314124
languageName: node
1422414125
linkType: hard
1422514126

14226-
"react-is@npm:^18.2.0":
14227-
version: 18.2.0
14228-
resolution: "react-is@npm:18.2.0"
14229-
checksum: 10/200cd65bf2e0be7ba6055f647091b725a45dd2a6abef03bf2380ce701fd5edccee40b49b9d15edab7ac08a762bf83cb4081e31ec2673a5bfb549a36ba21570df
14230-
languageName: node
14231-
linkType: hard
14232-
1423314127
"react-redux@npm:^9.1.2":
1423414128
version: 9.1.2
1423514129
resolution: "react-redux@npm:9.1.2"
@@ -14569,13 +14463,6 @@ __metadata:
1456914463
languageName: node
1457014464
linkType: hard
1457114465

14572-
"resize-observer-polyfill@npm:^1.5.1":
14573-
version: 1.5.1
14574-
resolution: "resize-observer-polyfill@npm:1.5.1"
14575-
checksum: 10/e10ee50cd6cf558001de5c6fb03fee15debd011c2f694564b71f81742eef03fb30d6c2596d1d5bf946d9991cb692fcef529b7bd2e4057041377ecc9636c753ce
14576-
languageName: node
14577-
linkType: hard
14578-
1457914466
"resolve-alpn@npm:^1.0.0":
1458014467
version: 1.2.1
1458114468
resolution: "resolve-alpn@npm:1.2.1"

0 commit comments

Comments
 (0)