meriadec
7 years ago
6 changed files with 86 additions and 3 deletions
@ -0,0 +1,41 @@ |
|||
// @flow
|
|||
|
|||
import React from 'react' |
|||
import styled from 'styled-components' |
|||
|
|||
import { rgba } from 'styles/helpers' |
|||
|
|||
import Box from 'components/base/Box' |
|||
import Tooltip from 'components/base/Tooltip' |
|||
import IconCheck from 'icons/Check' |
|||
import IconClock from 'icons/Clock' |
|||
|
|||
const Container = styled(Box).attrs({ |
|||
bg: p => rgba(p.isConfirmed ? p.theme.colors.positiveGreen : p.theme.colors.grey, 0.1), |
|||
color: p => (p.isConfirmed ? p.theme.colors.positiveGreen : p.theme.colors.grey), |
|||
align: 'center', |
|||
justify: 'center', |
|||
})` |
|||
width: 24px; |
|||
height: 24px; |
|||
border-radius: 50%; |
|||
` |
|||
|
|||
const ConfirmationCheck = ({ |
|||
confirmations, |
|||
minConfirmations, |
|||
}: { |
|||
confirmations: number, |
|||
minConfirmations: number, |
|||
}) => { |
|||
const isConfirmed = confirmations >= minConfirmations |
|||
return ( |
|||
<Tooltip render={() => (isConfirmed ? 'Confirmed' : 'Not confirmed')}> |
|||
<Container isConfirmed={isConfirmed}> |
|||
{isConfirmed ? <IconCheck width={12} /> : <IconClock width={12} />} |
|||
</Container> |
|||
</Tooltip> |
|||
) |
|||
} |
|||
|
|||
export default ConfirmationCheck |
@ -0,0 +1,10 @@ |
|||
import React from 'react' |
|||
|
|||
export default props => ( |
|||
<svg viewBox="0 0 16 16" {...props}> |
|||
<path |
|||
fill="currentColor" |
|||
d="M13.62 2.608l-8.22 8.22-3.02-3.02a.375.375 0 0 0-.53 0l-.884.884a.375.375 0 0 0 0 .53l4.169 4.17a.375.375 0 0 0 .53 0l9.37-9.37a.375.375 0 0 0 0-.53l-.884-.884a.375.375 0 0 0-.53 0z" |
|||
/> |
|||
</svg> |
|||
) |
@ -0,0 +1,10 @@ |
|||
import React from 'react' |
|||
|
|||
export default props => ( |
|||
<svg viewBox="0 0 16 16" {...props}> |
|||
<path |
|||
fill="currentColor" |
|||
d="M8 .583a7.417 7.417 0 1 1 0 14.834A7.417 7.417 0 0 1 8 .583zm0 1.5a5.917 5.917 0 1 0 0 11.834A5.917 5.917 0 0 0 8 2.083zm.75 5.606l1.78 1.78a.75.75 0 0 1-1.06 1.061l-2-2A.75.75 0 0 1 7.25 8V4a.75.75 0 0 1 1.5 0v3.69z" |
|||
/> |
|||
</svg> |
|||
) |
Loading…
Reference in new issue