Skip to content

Commit

Permalink
Properly close modals when naming accounts is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Oct 6, 2023
1 parent 34bfa75 commit 4be91c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import { ManageableAccountEditModal } from './ManageableAccountEditModal'
import { Wallet } from '../../../../state/wallet/types'

export const ManageableAccount = ({
closeHandler,
editHandler,
wallet,
isActive,
onClick,
}: {
closeHandler: () => any
editHandler?: (name: string) => void
wallet: Wallet
isActive: boolean
Expand All @@ -32,6 +34,7 @@ export const ManageableAccount = ({
/>
{layerVisibility && (
<ManageableAccountEditModal

Check warning on line 36 in src/app/components/Toolbar/Features/Account/ManageableAccount.tsx

View check run for this annotation

Codecov / codecov/patch

src/app/components/Toolbar/Features/Account/ManageableAccount.tsx#L36

Added line #L36 was not covered by tests
closeParentHandler={closeHandler}

Check failure on line 37 in src/app/components/Toolbar/Features/Account/ManageableAccount.tsx

View workflow job for this annotation

GitHub Actions / lint

Type '{ closeParentHandler: () => any; closeHandler: () => void; editHandler: ((name: string) => void) | undefined; wallet: Wallet; }' is not assignable to type 'IntrinsicAttributes & { animation?: boolean | undefined; closeHandler: () => void; editHandler?: ((name: string) => void) | undefined; wallet: Wallet; }'.
closeHandler={() => setLayerVisibility(false)}

Check warning on line 38 in src/app/components/Toolbar/Features/Account/ManageableAccount.tsx

View check run for this annotation

Codecov / codecov/patch

src/app/components/Toolbar/Features/Account/ManageableAccount.tsx#L38

Added line #L38 was not covered by tests
editHandler={editHandler}
wallet={wallet}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface FormValue {
export const ManageableAccountEditModal = ({
animation,
closeHandler,
closeParentHandler,

Check failure on line 26 in src/app/components/Toolbar/Features/Account/ManageableAccountEditModal.tsx

View workflow job for this annotation

GitHub Actions / lint

'closeParentHandler' is missing in props validation

Check failure on line 26 in src/app/components/Toolbar/Features/Account/ManageableAccountEditModal.tsx

View workflow job for this annotation

GitHub Actions / lint

Property 'closeParentHandler' does not exist on type '{ animation?: boolean | undefined; closeHandler: () => void; editHandler?: ((name: string) => void) | undefined; wallet: Wallet; }'.
editHandler,
wallet,
}: {
Expand Down Expand Up @@ -74,7 +75,7 @@ export const ManageableAccountEditModal = ({
<Button
color="link"
onClick={() => {
closeHandler()
closeParentHandler()
navigate('/open-wallet')

Check warning on line 79 in src/app/components/Toolbar/Features/Account/ManageableAccountEditModal.tsx

View check run for this annotation

Codecov / codecov/patch

src/app/components/Toolbar/Features/Account/ManageableAccountEditModal.tsx#L77-L79

Added lines #L77 - L79 were not covered by tests
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const AccountSelector = memo((props: Props) => {

const accounts = Object.values(wallets).map(wallet => (
<ManageableAccount
closeHandler={props.closeHandler}
editHandler={
unlockedProfile
? (name: string) => {
Expand Down

0 comments on commit 4be91c2

Please sign in to comment.