Add CSS for tx status
This commit is contained in:
parent
924f49425e
commit
a81f3cf598
|
@ -1,19 +1,15 @@
|
||||||
// @flow
|
// @flow
|
||||||
import React, { PureComponent } from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
children: React.Node
|
children: React.Node,
|
||||||
}
|
}
|
||||||
|
|
||||||
class Span extends PureComponent<Props> {
|
class Span extends React.PureComponent<Props> {
|
||||||
render() {
|
render() {
|
||||||
const { children, ...props } = this.props
|
const { children, ...props } = this.props
|
||||||
|
|
||||||
return (
|
return <span {...props}>{children}</span>
|
||||||
<span {...props}>
|
|
||||||
{ children }
|
|
||||||
</span>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import Row from '~/components/layout/Row'
|
||||||
import Block from '~/components/layout/Block'
|
import Block from '~/components/layout/Block'
|
||||||
import Col from '~/components/layout/Col'
|
import Col from '~/components/layout/Col'
|
||||||
import Bold from '~/components/layout/Bold'
|
import Bold from '~/components/layout/Bold'
|
||||||
|
import Span from '~/components/layout/Span'
|
||||||
import Paragraph from '~/components/layout/Paragraph'
|
import Paragraph from '~/components/layout/Paragraph'
|
||||||
import Hairline from '~/components/layout/Hairline'
|
import Hairline from '~/components/layout/Hairline'
|
||||||
import { type Transaction } from '~/routes/safe/store/models/transaction'
|
import { type Transaction } from '~/routes/safe/store/models/transaction'
|
||||||
|
@ -31,12 +32,18 @@ const openIconStyle = {
|
||||||
color: secondary,
|
color: secondary,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const txStatusToLabel = {
|
||||||
|
success: 'Success',
|
||||||
|
awaiting_confirmations: 'Awaiting confirmations',
|
||||||
|
}
|
||||||
|
|
||||||
const ExpandedTx = ({
|
const ExpandedTx = ({
|
||||||
classes, tx, threshold, owners,
|
classes, tx, threshold, owners,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
const [tabIndex, setTabIndex] = useState<number>(0)
|
const [tabIndex, setTabIndex] = useState<number>(0)
|
||||||
const confirmedLabel = `Confirmed [${tx.confirmations.size}/${threshold}]`
|
const confirmedLabel = `Confirmed [${tx.confirmations.size}/${threshold}]`
|
||||||
const unconfirmedLabel = `Unconfirmed [${owners.size - tx.confirmations.size}]`
|
const unconfirmedLabel = `Unconfirmed [${owners.size - tx.confirmations.size}]`
|
||||||
|
const txStatus = tx.isExecuted ? 'success' : 'awaiting_confirmations'
|
||||||
|
|
||||||
const handleTabChange = (event, tabClicked) => {
|
const handleTabChange = (event, tabClicked) => {
|
||||||
setTabIndex(tabClicked)
|
setTabIndex(tabClicked)
|
||||||
|
@ -60,7 +67,9 @@ const ExpandedTx = ({
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
<Paragraph noMargin>
|
<Paragraph noMargin>
|
||||||
<Bold>TX status: </Bold>
|
<Bold>TX status: </Bold>
|
||||||
{tx.executionTxHash ? 'Success' : 'Awaiting confirmations'}
|
<Span className={classes[txStatus]} style={{ fontWeight: 'bold' }}>
|
||||||
|
{txStatusToLabel[txStatus]}
|
||||||
|
</Span>
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
<Paragraph noMargin>
|
<Paragraph noMargin>
|
||||||
<Bold>TX created: </Bold>
|
<Bold>TX created: </Bold>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// @flow
|
// @flow
|
||||||
import { md, lg } from '~/theme/variables'
|
import { md, lg, connected } from '~/theme/variables'
|
||||||
|
|
||||||
export const styles = () => ({
|
export const styles = () => ({
|
||||||
txDataContainer: {
|
txDataContainer: {
|
||||||
|
@ -9,4 +9,10 @@ export const styles = () => ({
|
||||||
boxSizing: 'border-box',
|
boxSizing: 'border-box',
|
||||||
borderLeft: 'solid 1px #c8ced4',
|
borderLeft: 'solid 1px #c8ced4',
|
||||||
},
|
},
|
||||||
|
awaiting_confirmations: {
|
||||||
|
color: '#2e73d9',
|
||||||
|
},
|
||||||
|
success: {
|
||||||
|
color: connected,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue