Skip to content

Commit

Permalink
Update react components (#188)
Browse files Browse the repository at this point in the history
* update dependencies

* Fix tests

* Fix linter errors

* Fix makeFriendlyBalance

* Bump react components

Co-authored-by: Jon Schwartz <[email protected]>
  • Loading branch information
navFooh and Schwartz10 authored Sep 20, 2022
1 parent 76ae33f commit 64ede8b
Show file tree
Hide file tree
Showing 17 changed files with 1,177 additions and 1,162 deletions.
4 changes: 2 additions & 2 deletions MsigProvider/fetchMsigState/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FilecoinNumber } from '@glif/filecoin-number'
import LotusRPCEngine from '@glif/filecoin-rpc-client'
import { getActorName } from '@glif/filecoin-actor-utils'
import { CID } from '@glif/filecoin-wallet-provider'
import {
AddressDocument,
AddressQuery,
decodeActorCID,
isAddressSigner,
Network
} from '@glif/react-components'
Expand All @@ -28,7 +28,7 @@ export const fetchMsigState = async (

let actorName = ''
try {
actorName = decodeActorCID(Code['/'], network)
actorName = getActorName(Code, network)
if (!actorName?.includes('multisig')) throw new Error('Not an Msig actor')
} catch (e) {
return {
Expand Down
4 changes: 2 additions & 2 deletions __mocks__/@glif/react-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { useContext, createContext, useReducer } from 'react'
import {
walletProviderReducer,
initialState as walletProviderInitialState,
actorCodesToNames,
noWallet,
Network
} from '@glif/react-components'
import { getActorCode } from '@glif/filecoin-actor-utils'
import createMockWalletProviderContextFuncs from '../../test-utils/composeMockAppTree/createWalletProviderContextFuncs'

export * from '../../node_modules/@glif/react-components/dist'
Expand Down Expand Up @@ -99,7 +99,7 @@ export function useWallet() {

export const multisigActorReturn = {
data: {
actor: { Code: { '/': actorCodesToNames[Network.CALIBRATION]['multisig'] } }
actor: { Code: { '/': getActorCode('multisig', Network.CALIBRATION) } }
}
}

Expand Down
60 changes: 30 additions & 30 deletions components/AddSigner/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ exports[`AddSigner it allows a user to add a signer address 1`] = `
height: calc(3em * 0.5);
}
.c0 {
.c5 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand All @@ -230,12 +230,18 @@ exports[`AddSigner it allows a user to add a signer address 1`] = `
-ms-flex-direction: column;
flex-direction: column;
gap: var(--space-m);
width: 100%;
margin: 0 auto;
max-width: 40em;
}
.c0 form {
.c5 > p,
.c5 > hr {
margin: 0.5em 0;
}
.c5 > p[role='button'] {
margin: 0;
}
.c0 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand All @@ -244,9 +250,12 @@ exports[`AddSigner it allows a user to add a signer address 1`] = `
-ms-flex-direction: column;
flex-direction: column;
gap: var(--space-m);
width: 100%;
margin: 0 auto;
max-width: 40em;
}
.c5 {
.c0 form {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand All @@ -257,15 +266,6 @@ exports[`AddSigner it allows a user to add a signer address 1`] = `
gap: var(--space-m);
}
.c5 > p,
.c5 > hr {
margin: 0.5em 0;
}
.c5 > p[role='button'] {
margin: 0;
}
.c9 {
display: -webkit-box;
display: -webkit-flex;
Expand Down Expand Up @@ -890,7 +890,7 @@ exports[`AddSigner it renders the initial state correctly 1`] = `
justify-content: space-between;
}
.c0 {
.c4 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand All @@ -899,12 +899,18 @@ exports[`AddSigner it renders the initial state correctly 1`] = `
-ms-flex-direction: column;
flex-direction: column;
gap: var(--space-m);
width: 100%;
margin: 0 auto;
max-width: 40em;
}
.c0 form {
.c4 > p,
.c4 > hr {
margin: 0.5em 0;
}
.c4 > p[role='button'] {
margin: 0;
}
.c0 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand All @@ -913,9 +919,12 @@ exports[`AddSigner it renders the initial state correctly 1`] = `
-ms-flex-direction: column;
flex-direction: column;
gap: var(--space-m);
width: 100%;
margin: 0 auto;
max-width: 40em;
}
.c4 {
.c0 form {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
Expand All @@ -926,15 +935,6 @@ exports[`AddSigner it renders the initial state correctly 1`] = `
gap: var(--space-m);
}
.c4 > p,
.c4 > hr {
margin: 0.5em 0;
}
.c4 > p[role='button'] {
margin: 0;
}
.c6 {
display: -webkit-box;
display: -webkit-flex;
Expand Down
58 changes: 29 additions & 29 deletions components/Admin/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -73,35 +73,6 @@ exports[`Admin page it renders the required approvals and the signers 1`] = `
justify-content: center;
}
.c2 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: var(--space-m);
width: 100%;
margin: 0 auto;
max-width: 40em;
}
.c2 form {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: var(--space-m);
}
.c3 {
max-width: 50em;
}
.c7 h4 {
margin: 0;
color: var(--gray-dark);
Expand Down Expand Up @@ -212,6 +183,35 @@ exports[`Admin page it renders the required approvals and the signers 1`] = `
fill: var(--purple-medium);
}
.c2 {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: var(--space-m);
width: 100%;
margin: 0 auto;
max-width: 40em;
}
.c2 form {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
gap: var(--space-m);
}
.c3 {
max-width: 50em;
}
.c0 {
display: -webkit-box;
display: -webkit-flex;
Expand Down
Loading

0 comments on commit 64ede8b

Please sign in to comment.