-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes, refactoring, improvements all pages. Not finidhed, before fork
- Loading branch information
Pavel Domrachev
authored and
Pavel Domrachev
committed
Mar 11, 2017
1 parent
b7c92e5
commit 4ee9aec
Showing
32 changed files
with
450 additions
and
235 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,48 @@ | ||
import React, {Component} from 'react'; | ||
import DropDownMenu from 'material-ui/DropDownMenu'; | ||
import MenuItem from 'material-ui/MenuItem'; | ||
|
||
const styles = { | ||
filterMenu: { | ||
margin: "-15px -25px" | ||
}, | ||
underlineStyle: { | ||
borderTop: 'none', | ||
}, | ||
}; | ||
|
||
class Filter extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = {value: 1}; | ||
} | ||
|
||
handleChange = (event, index, value) => this.setState({value}); | ||
|
||
render() { | ||
const {locs} = this.props; | ||
return ( | ||
<div style={{ minWidth: 300}}> | ||
<span> | ||
{locs.size} entries | ||
</span> | ||
<span style={{ float: 'right'}}> | ||
<span style={{verticalAlign: 'top'}}>Show only: </span> | ||
<DropDownMenu value={this.state.value} onChange={this.handleChange} style={styles.filterMenu} underlineStyle={styles.underlineStyle}> | ||
<MenuItem value={1} primaryText="LHUS" /> | ||
<MenuItem value={2} primaryText="LHEU" /> | ||
<MenuItem value={3} primaryText="LHAU" /> | ||
</DropDownMenu> | ||
<span style={{verticalAlign: 'top'}}> Sorted by: </span> | ||
<DropDownMenu value={this.state.value} onChange={this.handleChange} style={styles.filterMenu} underlineStyle={styles.underlineStyle}> | ||
<MenuItem value={1} primaryText="Time added" /> | ||
<MenuItem value={2} primaryText="Time added" /> | ||
<MenuItem value={3} primaryText="Time added" /> | ||
</DropDownMenu> | ||
</span> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Filter; |
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,81 @@ | ||
import React, {Component} from 'react'; | ||
import {connect} from 'react-redux'; | ||
import FlatButton from 'material-ui/FlatButton'; | ||
import Paper from 'material-ui/Paper'; | ||
import globalStyles from '../../../styles'; | ||
import {dateFormatOptions} from '../../../config'; | ||
import Slider from '../../common/slider'; | ||
import {handleShowLOCModal, handleShowIssueLHModal} from './handlers'; | ||
|
||
const OngoingStatusBlock = (props) => ( | ||
<div style={globalStyles.item.status.block}> | ||
<div style={globalStyles.item.status.green}> | ||
ACTIVE<br/> | ||
</div> | ||
<Slider value={props.value} cyan={true} /> | ||
</div> | ||
); | ||
|
||
const closedStatusBlock = <div style={globalStyles.item.status.block}> | ||
<div style={globalStyles.item.status.grey}> | ||
INACTIVE<br/> | ||
</div> | ||
<Slider value={1} disabled={true}/> | ||
</div>; | ||
|
||
const mapDispatchToProps = (dispatch) => ({ | ||
showLOCModal: locKey => dispatch(handleShowLOCModal(locKey)), | ||
showIssueLHModal: locKey => dispatch(handleShowIssueLHModal(locKey)), | ||
}); | ||
|
||
@connect(null, mapDispatchToProps) | ||
class LocBlock extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = {value: 1}; | ||
} | ||
|
||
render() { | ||
const {item, showLOCModal, showIssueLHModal} = this.props; | ||
const address = item.get('address'); | ||
const issueLimit = item.issueLimit(); | ||
const expDate = item.expDate(); | ||
return ( | ||
<Paper style={globalStyles.item.paper}> | ||
<div> | ||
{expDate > new Date().getTime() ? <OngoingStatusBlock value={ | ||
(((7776000000 - expDate) + new Date().getTime()) / 7776000000).toFixed(2) | ||
}/> : closedStatusBlock} | ||
<div style={globalStyles.item.title}>{item.get('locName')}</div> | ||
<div style={globalStyles.item.greyText}> | ||
Issue limit: {issueLimit} LHUS<br /> | ||
Total issued amount: {item.issued()} LHUS<br /> | ||
Total redeemed amount: {item.redeemed()} LHUS<br /> | ||
Amount in circulation: {item.issued() - item.redeemed()} LHUS<br /> | ||
Exp date: {new Date(expDate).toLocaleDateString("en-us", dateFormatOptions)}<br /> | ||
{item.get('address')} | ||
</div> | ||
<div style={globalStyles.item.lightGrey}> | ||
Added on {new Date(expDate).toLocaleDateString("en-us", dateFormatOptions)} | ||
</div> | ||
</div> | ||
<div> | ||
<FlatButton label="VIEW CONTRACT" style={{color: 'grey'}} | ||
onTouchTap={()=>{showLOCModal(address);}} | ||
/> | ||
<FlatButton label="ISSUE LH" style={{color: 'grey'}} | ||
onTouchTap={()=>{showIssueLHModal(address);}} | ||
/> | ||
<FlatButton label="REDEEM LH" style={{color: 'grey'}} | ||
onTouchTap={()=>{showLOCModal(address);}} | ||
/> | ||
<FlatButton label="EDIT LOC INFO" style={{color: 'grey'}} | ||
onTouchTap={()=>{showLOCModal(address);}} | ||
/> | ||
</div> | ||
</Paper> | ||
); | ||
} | ||
} | ||
|
||
export default LocBlock; |
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,28 @@ | ||
import React, {Component} from 'react'; | ||
import {connect} from 'react-redux'; | ||
import RaisedButton from 'material-ui/RaisedButton'; | ||
import globalStyles from '../../../styles'; | ||
import {handleShowLOCModal} from './handlers'; | ||
|
||
const mapDispatchToProps = (dispatch) => ({ | ||
handleShowLOCModal: locKey => dispatch(handleShowLOCModal(locKey)), | ||
}); | ||
|
||
@connect(null, mapDispatchToProps) | ||
class PageTitle extends Component { | ||
render() { | ||
return ( | ||
<div><span style={{verticalAlign: 'sub'}}>LOCs </span> <RaisedButton | ||
label="NEW LOC" | ||
primary={true} | ||
style={{verticalAlign: 'text-bottom', fontSize: 15}} | ||
onTouchTap={this.props.handleShowLOCModal.bind(null, null)} | ||
buttonStyle={{...globalStyles.raisedButton, }} | ||
labelStyle={globalStyles.raisedButtonLabel} | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default PageTitle; |
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,28 @@ | ||
import React, {Component} from 'react'; | ||
import RaisedButton from 'material-ui/RaisedButton'; | ||
import TextField from 'material-ui/TextField'; | ||
import globalStyles from '../../../styles'; | ||
|
||
class Search extends Component { | ||
render() { | ||
// const {} = this.props; | ||
return ( | ||
<div> | ||
<TextField | ||
floatingLabelText="Search by title" | ||
style={{width: 'calc(100% - 98px)'}} | ||
/> | ||
<RaisedButton | ||
label="SEARCH" | ||
primary={true} | ||
buttonStyle={globalStyles.raisedButton} | ||
style={{marginTop: 33, width: 88, float: 'right'}} | ||
labelStyle={globalStyles.raisedButtonLabel} | ||
//onTouchTap={this.handleSubmitClick.bind(this)} | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Search; |
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,13 @@ | ||
import {showLOCModal, showIssueLHModal} from '../../../redux/ducks/ui/modal'; | ||
import {passLocAddress} from '../../../redux/ducks/locs/loc'; | ||
|
||
|
||
export const handleShowLOCModal = (locKey) => (dispatch) => { | ||
dispatch(passLocAddress(locKey)); | ||
dispatch(showLOCModal({locKey})); | ||
}; | ||
|
||
export const handleShowIssueLHModal = (locKey) => (dispatch) => { | ||
dispatch(passLocAddress(locKey)); | ||
dispatch(showIssueLHModal({locKey})); | ||
}; |
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,11 @@ | ||
import PageTitle from './PageTitle'; | ||
import Search from './Search'; | ||
import Filter from './Filter'; | ||
import LocBlock from './LocBlock'; | ||
|
||
export { | ||
PageTitle, | ||
Search, | ||
Filter, | ||
LocBlock, | ||
} |
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.