-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multi-sig account view with a nice modal
- Loading branch information
1 parent
1507bd4
commit 6c8a9d4
Showing
7 changed files
with
123 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/Pages/Accounts/Components/AccountTables/Components/AccountMultiSigModal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { useState, useEffect } from 'react'; | ||
import styled from 'styled-components'; | ||
import { Modal } from 'Components'; | ||
import { AccountInfo } from 'redux/features/account/accountSlice'; | ||
import { Link } from 'react-router-dom'; | ||
|
||
const Title = styled.div` | ||
text-align: center; | ||
font-size: 2rem; | ||
font-weight: ${({ theme }) => theme.FONT_WEIGHT_BOLD}; | ||
margin: 20px 0; | ||
`; | ||
|
||
const Description = styled.li` | ||
color: ${({ theme }) => theme.FONT_TITLE_INFO}; | ||
max-width: 500px; | ||
margin: 0 auto; | ||
margin-bottom: 20px; | ||
`; | ||
|
||
interface MultiSigModalProps { | ||
modalOpen: boolean; | ||
onClose: Function; | ||
data: AccountInfo['publicKey']['sigList']; | ||
} | ||
|
||
export const AccountMultiSigModal = ({ modalOpen, onClose, data }: MultiSigModalProps) => { | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
useEffect(() => { | ||
setIsOpen(modalOpen); | ||
}, [modalOpen]); | ||
|
||
const handleModalClose = () => { | ||
setIsOpen(false); | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<Modal isOpen={isOpen} onClose={handleModalClose}> | ||
<> | ||
<Title>Generate a CSV of Transaction Information</Title> | ||
<ol> | ||
{data.map((account) => ( | ||
<Description key={account.idx}> | ||
<Link to={`/accounts/${account.address}`} onClick={handleModalClose}> | ||
{account.address} | ||
</Link> | ||
</Description> | ||
))} | ||
</ol> | ||
</> | ||
</Modal> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters