mirror of https://gitlab.com/ecentrics/concordia
Apostolos Fanakis
4 years ago
14 changed files with 125 additions and 79 deletions
@ -0,0 +1,13 @@ |
|||
import React from 'react'; |
|||
import { Table } from 'semantic-ui-react'; |
|||
|
|||
const StatusKeyRow = (props) => { |
|||
const { value } = props; |
|||
return ( |
|||
<Table.Row> |
|||
<Table.Cell className="status-key">{value}</Table.Cell> |
|||
</Table.Row> |
|||
); |
|||
}; |
|||
|
|||
export default StatusKeyRow; |
@ -0,0 +1,24 @@ |
|||
import React from 'react'; |
|||
import { |
|||
Header, Image, Segment, Table, |
|||
} from 'semantic-ui-react'; |
|||
import './styles.css'; |
|||
|
|||
const StatusKeyRow = (props) => { |
|||
const { headerTitle, headerImage, children } = props; |
|||
return ( |
|||
<Segment padded> |
|||
<Header textAlign="center"> |
|||
<Image src={headerImage} size="small" /> |
|||
{headerTitle} |
|||
</Header> |
|||
<Table className="status-table" compact textAlign="center" columns={1}> |
|||
<Table.Body> |
|||
{children} |
|||
</Table.Body> |
|||
</Table> |
|||
</Segment> |
|||
); |
|||
}; |
|||
|
|||
export default StatusKeyRow; |
@ -0,0 +1,22 @@ |
|||
import React from 'react'; |
|||
import { Table } from 'semantic-ui-react'; |
|||
import { CopyToClipboard } from 'react-copy-to-clipboard'; |
|||
|
|||
const StatusValueRow = (props) => { |
|||
const { value } = props; |
|||
return (value) ? ( |
|||
<Table.Row className="status-value"> |
|||
<Table.Cell> |
|||
<CopyToClipboard text={value}> |
|||
<span>{value}</span> |
|||
</CopyToClipboard> |
|||
</Table.Cell> |
|||
</Table.Row> |
|||
) : ( |
|||
<Table.Row> |
|||
<Table.Cell>-</Table.Cell> |
|||
</Table.Row> |
|||
); |
|||
}; |
|||
|
|||
export default StatusValueRow; |
@ -0,0 +1,29 @@ |
|||
import React from 'react'; |
|||
import { useSelector } from 'react-redux'; |
|||
import StatusSegment from '../../../components/Status/StatusSegment'; |
|||
import StatusKeyRow from '../../../components/Status/StatusKeyRow'; |
|||
import StatusValueRow from '../../../components/Status/StatusValueRow'; |
|||
|
|||
import ethereumLogo from '../../../assets/images/ethereum_logo.svg'; |
|||
|
|||
const MainLayoutEthereumStatus = () => { |
|||
const userAddress = useSelector((state) => state.user.address); |
|||
const blockNumber = useSelector((state) => state.currentBlock.number); |
|||
const blockHash = useSelector((state) => state.currentBlock.hash); |
|||
|
|||
return ( |
|||
<StatusSegment |
|||
headerTitle="Ethereum Status" |
|||
headerImage={ethereumLogo} |
|||
> |
|||
<StatusKeyRow value="User Address" /> |
|||
<StatusValueRow value={userAddress} /> |
|||
<StatusKeyRow value="Block Number" /> |
|||
<StatusValueRow value={blockNumber} /> |
|||
<StatusKeyRow value="Block Hash" /> |
|||
<StatusValueRow value={blockHash} /> |
|||
</StatusSegment> |
|||
); |
|||
}; |
|||
|
|||
export default MainLayoutEthereumStatus; |
Loading…
Reference in new issue