This repository has been archived by the owner on Jul 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: transactions list and details, minor fixes
- Loading branch information
1 parent
cb658e8
commit 76d216d
Showing
25 changed files
with
607 additions
and
20 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {Popover} from '@material-ui/core'; | ||
import React, {useState} from 'react'; | ||
|
||
import useStyles from './styles'; | ||
|
||
const QRPopup = () => { | ||
const classes = useStyles(); | ||
const [qrEl, setQrEl] = useState(null); | ||
const handleQrOpen = event => setQrEl(event.currentTarget); | ||
const handleQrClose = () => setQrEl(null); | ||
return ( | ||
<div> | ||
<button className={classes.qrBtn} onClick={handleQrOpen}> | ||
QR code | ||
</button> | ||
<Popover | ||
open={Boolean(qrEl)} | ||
onClose={handleQrClose} | ||
anchorEl={qrEl} | ||
anchorOrigin={{ | ||
vertical: 'bottom', | ||
horizontal: 'center', | ||
}} | ||
transformOrigin={{ | ||
vertical: 'top', | ||
horizontal: 'center', | ||
}} | ||
> | ||
<img src="http://placehold.it/315" alt="" /> | ||
</Popover> | ||
</div> | ||
); | ||
}; | ||
|
||
export default QRPopup; |
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,15 @@ | ||
import {makeStyles} from '@material-ui/core'; | ||
import getColor from 'v2/utils/getColor'; | ||
|
||
export default makeStyles(theme => ({ | ||
qrBtn: { | ||
color: getColor('main')(theme), | ||
border: `1px solid ${getColor('main')(theme)}`, | ||
fontSize: 10, | ||
textTransform: 'uppercase', | ||
height: 18, | ||
width: 55, | ||
background: 'transparent', | ||
padding: 0, | ||
}, | ||
})); |
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
53 changes: 53 additions & 0 deletions
53
src/v2/components/Transactions/Detail/Application/index.jsx
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,53 @@ | ||
// @flow | ||
import React from 'react'; | ||
import {map} from 'lodash/fp'; | ||
import {Grid} from '@material-ui/core'; | ||
import Label from 'v2/components/UI/Label'; | ||
import Avatar from 'v2/components/UI/Avatar'; | ||
import TypeLabel from 'v2/components/UI/TypeLabel'; | ||
|
||
import useStyles from './styles'; | ||
|
||
type TApplication = { | ||
id: string, | ||
accounts: string[], | ||
}; | ||
|
||
const Application = ({id, accounts}: TApplication) => { | ||
const classes = useStyles(); | ||
const renderAccount = account => ( | ||
<div className={classes.account}> | ||
<Label text="account 1" hint="" /> | ||
<Avatar | ||
avatarUrl="" | ||
name="" | ||
width={33} | ||
height={33} | ||
pubkey="0xAA15A3E6b97d09653b8b8d9c9e1D80daf5ba81e8" | ||
/> | ||
<div className={classes.address}> | ||
0xAA15A3E6b97d09653b8b8d9c9e1D80daf5ba81e8 | ||
</div> | ||
</div> | ||
); | ||
return ( | ||
<div className={classes.root}> | ||
<Grid container spacing={5}> | ||
<Grid item md={5}> | ||
<Label text="Application id" hint="" /> | ||
<div className={classes.id}> | ||
<div className={classes.address}>{id}</div> | ||
<TypeLabel type="other" label="other" /> | ||
<TypeLabel type="consensus" label="consensus" /> | ||
</div> | ||
</Grid> | ||
<Grid item md={7}> | ||
{map(renderAccount)(accounts)} | ||
{renderAccount()} | ||
</Grid> | ||
</Grid> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Application; |
48 changes: 48 additions & 0 deletions
48
src/v2/components/Transactions/Detail/Application/styles.js
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,48 @@ | ||
import {makeStyles} from '@material-ui/core'; | ||
import {fade} from '@material-ui/core/styles'; | ||
import getColor from 'v2/utils/getColor'; | ||
|
||
export default makeStyles(theme => ({ | ||
root: { | ||
borderBottom: `1px solid ${fade(getColor('grey3')(theme), 0.5)}`, | ||
paddingBottom: 34, | ||
}, | ||
account: { | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'flex-end', | ||
marginBottom: 40, | ||
'& > div:first-child': { | ||
marginRight: 25, | ||
}, | ||
'& > div:nth-child(2)': { | ||
[theme.breakpoints.down('xs')]: { | ||
display: 'none', | ||
}, | ||
}, | ||
|
||
'& > div:last-child': { | ||
marginLeft: 25, | ||
[theme.breakpoints.down('xs')]: { | ||
marginLeft: 0, | ||
}, | ||
}, | ||
[theme.breakpoints.down('xs')]: { | ||
flexDirection: 'column', | ||
alignItems: 'flex-start', | ||
}, | ||
}, | ||
address: { | ||
color: getColor('main')(theme), | ||
lineHeight: '29px', | ||
}, | ||
id: { | ||
marginTop: 28, | ||
'& > div:not(:first-child)': { | ||
marginRight: 5, | ||
}, | ||
[theme.breakpoints.down('sm')]: { | ||
marginTop: 0, | ||
}, | ||
}, | ||
})); |
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,17 @@ | ||
// @flow | ||
import React from 'react'; | ||
|
||
import Application from './Application'; | ||
|
||
const ApplicationsTab = ({applications}) => { | ||
return ( | ||
<div> | ||
<Application | ||
id="0xAA15A3E6b97d09653b8b8d9c9e1D80daf5ba81e8" | ||
accounts={[]} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ApplicationsTab; |
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,45 @@ | ||
// @flow | ||
import {map} from 'lodash/fp'; | ||
import React from 'react'; | ||
import {Grid} from '@material-ui/core'; | ||
import Label from 'v2/components/UI/Label'; | ||
|
||
import useStyles from './styles'; | ||
|
||
const ApplicationStatus = () => { | ||
const classes = useStyles(); | ||
const specs = [ | ||
{ | ||
label: 'status', | ||
value: 'success', | ||
}, | ||
{ | ||
label: 'confirmations', | ||
value: '5', | ||
}, | ||
]; | ||
const renderSpec = ({label, value}: {label: string, value: string}) => ( | ||
<li key={label}> | ||
<Label text={label} hint="" /> | ||
<div className={classes.value}> | ||
{typeof value === 'function' ? value() : value} | ||
</div> | ||
</li> | ||
); | ||
return ( | ||
<Grid container> | ||
<Grid item sm={7}> | ||
<ul className={classes.spec}>{map(renderSpec)(specs)}</ul> | ||
</Grid> | ||
<Grid item sm={5}> | ||
<Label text="confidence" hint="" /> | ||
<div className={classes.circle}> | ||
90% | ||
<div /> | ||
</div> | ||
</Grid> | ||
</Grid> | ||
); | ||
}; | ||
|
||
export default ApplicationStatus; |
Oops, something went wrong.