This repository has been archived by the owner on Nov 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from gnosis/development
Feature: Safe Overview's Balance & Manage Tokens
- Loading branch information
Showing
61 changed files
with
1,550 additions
and
245 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700" rel="stylesheet"> | ||
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:300,400,500" rel="stylesheet"> | ||
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,500" rel="stylesheet"> | ||
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700" rel="stylesheet"> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,89 @@ | ||
// @flow | ||
import * as React from 'react' | ||
import { withStyles } from '@material-ui/core/styles' | ||
import Block from '~/components/layout/Block' | ||
import Dot from '@material-ui/icons/FiberManualRecord' | ||
import Img from '~/components/layout/Img' | ||
import { fancy, border, warning } from '~/theme/variables' | ||
|
||
const key = require('../assets/key.svg') | ||
const triangle = require('../assets/triangle.svg') | ||
|
||
const styles = () => ({ | ||
root: { | ||
display: 'flex', | ||
}, | ||
dot: { | ||
position: 'relative', | ||
backgroundColor: '#ffffff', | ||
color: fancy, | ||
}, | ||
key: { | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
backgroundColor: border, | ||
}, | ||
warning: { | ||
position: 'relative', | ||
top: '-2px', | ||
}, | ||
}) | ||
|
||
type Mode = 'error' | 'warning' | ||
|
||
type Props = { | ||
classes: Object, | ||
keySize: number, | ||
circleSize: number, | ||
dotSize: number, | ||
dotTop: number, | ||
dotRight: number, | ||
mode: Mode, | ||
center?: boolean, | ||
hideDot?: boolean, | ||
} | ||
|
||
const buildKeyStyleFrom = (size: number, center: boolean, dotSize: number) => ({ | ||
width: `${size}px`, | ||
height: `${size}px`, | ||
marginLeft: center ? `${dotSize}px` : 'none', | ||
borderRadius: `${size}px`, | ||
}) | ||
|
||
const buildDotStyleFrom = (size: number, top: number, right: number, mode: Mode) => ({ | ||
width: `${size}px`, | ||
height: `${size}px`, | ||
borderRadius: `${size}px`, | ||
top: `${top}px`, | ||
right: `${right}px`, | ||
color: mode === 'error' ? fancy : warning, | ||
}) | ||
|
||
const KeyRing = ({ | ||
classes, circleSize, keySize, dotSize, dotTop, dotRight, mode, center = false, hideDot = false, | ||
}: Props) => { | ||
const keyStyle = buildKeyStyleFrom(circleSize, center, dotSize) | ||
const dotStyle = buildDotStyleFrom(dotSize, dotTop, dotRight, mode) | ||
const isWarning = mode === 'warning' | ||
const img = isWarning ? triangle : key | ||
|
||
return ( | ||
<React.Fragment> | ||
<Block className={classes.root}> | ||
<Block className={classes.key} style={keyStyle}> | ||
<Img | ||
src={img} | ||
height={keySize} | ||
width={isWarning ? keySize + 2 : keySize} | ||
alt="Status connection" | ||
className={isWarning ? classes.warning : undefined} | ||
/> | ||
</Block> | ||
{ !hideDot && <Dot className={classes.dot} style={dotStyle} /> } | ||
</Block> | ||
</React.Fragment> | ||
) | ||
} | ||
|
||
export default withStyles(styles)(KeyRing) |
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
Oops, something went wrong.