mirror of
https://github.com/status-im/snt-voting.git
synced 2025-02-23 23:58:13 +00:00
Fixes #6
This commit is contained in:
parent
972873139d
commit
285867a32d
59
app/components/flow/HelpDialog.js
Normal file
59
app/components/flow/HelpDialog.js
Normal file
@ -0,0 +1,59 @@
|
||||
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { withStyles } from '@material-ui/core/styles';
|
||||
import Button from '@material-ui/core/Button';
|
||||
import Dialog from '@material-ui/core/Dialog';
|
||||
import ListItemText from '@material-ui/core/ListItemText';
|
||||
import ListItem from '@material-ui/core/ListItem';
|
||||
import List from '@material-ui/core/List';
|
||||
import Divider from '@material-ui/core/Divider';
|
||||
import AppBar from '@material-ui/core/AppBar';
|
||||
import Toolbar from '@material-ui/core/Toolbar';
|
||||
import IconButton from '@material-ui/core/IconButton';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import CloseIcon from '@material-ui/icons/Close';
|
||||
import Slide from '@material-ui/core/Slide';
|
||||
|
||||
|
||||
function Transition(props) {
|
||||
return <Slide direction="up" {...props} />;
|
||||
}
|
||||
|
||||
|
||||
const HelpDialog = (props) => <Dialog
|
||||
fullScreen
|
||||
open={props.open}
|
||||
onClose={props.handleClose}
|
||||
TransitionComponent={Transition}
|
||||
>
|
||||
<AppBar style={{position: "relative"}}>
|
||||
<Toolbar>
|
||||
<IconButton color="inherit" onClick={props.handleClose} aria-label="Close">
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
<Typography variant="display1" color="inherit">
|
||||
Need help?
|
||||
</Typography>
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
<List>
|
||||
<ListItem button>
|
||||
<ListItemText primary="Chat on Status" onClick={() => { window.open("https://get.status.im/chat/public/status-snt-voting-dapp",'_blank'); }} />
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem button>
|
||||
<ListItemText primary="Chat on Telegram" onClick={() => { window.open("https://t.me/StatusNetwork",'_blank'); }} />
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem button>
|
||||
<ListItemText primary="Chat on Riot" onClick={() => { window.open("https://chat.status.im/#/register",'_blank'); }} />
|
||||
</ListItem>
|
||||
<Divider />
|
||||
<ListItem button>
|
||||
<ListItemText primary="FAQs" onClick={() => { window.open("https://docs.google.com/document/d/1t7zdjVEH5AfPrH4phpiKuPDCQmnOvvbNoZEY2z2cfzg/edit?usp=sharing",'_blank'); }} />
|
||||
</ListItem>
|
||||
</List>
|
||||
</Dialog>
|
||||
|
||||
export default HelpDialog;
|
@ -4,6 +4,7 @@ import React, {Component, Fragment} from 'react';
|
||||
import Card from '@material-ui/core/Card';
|
||||
import CardContent from '@material-ui/core/CardContent';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import HelpDialog from './HelpDialog';
|
||||
|
||||
// TODO: extract to utils
|
||||
Date.prototype.DDMMYYYYatHHMM = function () {
|
||||
@ -33,6 +34,18 @@ function pad(number, length) {
|
||||
}
|
||||
|
||||
class OtherWallets extends Component {
|
||||
state = {
|
||||
open: false,
|
||||
};
|
||||
|
||||
handleClickOpen = () => {
|
||||
this.setState({ open: true });
|
||||
};
|
||||
|
||||
handleClose = () => {
|
||||
this.setState({ open: false });
|
||||
};
|
||||
|
||||
render() {
|
||||
const props = this.props;
|
||||
|
||||
@ -82,10 +95,12 @@ class OtherWallets extends Component {
|
||||
</Typography>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<p className="helpLink">Need help? <a onClick={this.handleClickOpen}>Chat with us</a></p>
|
||||
</div>
|
||||
<div className="buttonNav back">
|
||||
<Link to={props.idPoll !== undefined ? "/wallet/" + props.idPoll : '/'}><Button variant="text">Back</Button></Link>
|
||||
</div>
|
||||
<HelpDialog open={this.state.open} handleClose={this.handleClose} />
|
||||
</Fragment>
|
||||
}
|
||||
}
|
||||
|
@ -37,6 +37,8 @@ class Results extends Component {
|
||||
|
||||
transaction.catch(x => {
|
||||
this.setState({isError: true});
|
||||
}).then(() => {
|
||||
this.updatePoll();
|
||||
})
|
||||
|
||||
let req = false;
|
||||
|
@ -137,9 +137,6 @@ class TitleScreen extends Component {
|
||||
</div> }
|
||||
</div>}
|
||||
</div>
|
||||
<div className="buttonNav footer">
|
||||
<p>Status Holdings Pte. Ltd. </p>
|
||||
</div>
|
||||
</Fragment>
|
||||
;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import Typography from '@material-ui/core/Typography'
|
||||
import Card from '@material-ui/core/Card';
|
||||
import CardContent from '@material-ui/core/CardContent';
|
||||
import { withRouter } from 'react-router-dom'
|
||||
|
||||
import HelpDialog from './HelpDialog';
|
||||
|
||||
|
||||
Date.prototype.DDMMYYYY = function () {
|
||||
@ -26,6 +26,18 @@ function pad(number, length) {
|
||||
|
||||
class VotingCredits extends Component {
|
||||
|
||||
state = {
|
||||
open: false,
|
||||
};
|
||||
|
||||
handleClickOpen = () => {
|
||||
this.setState({ open: true });
|
||||
};
|
||||
|
||||
handleClose = () => {
|
||||
this.setState({ open: false });
|
||||
};
|
||||
|
||||
componentDidMount(){
|
||||
const {polls, balances, history} = this.props;
|
||||
if(!polls || !balances || !polls.length || !balances.length){
|
||||
@ -90,11 +102,13 @@ class VotingCredits extends Component {
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card> }
|
||||
<p className="helpLink">Need help? <a onClick={this.handleClickOpen}>Chat with us</a></p>
|
||||
</div>
|
||||
<div className={(ethBalance == 0 || tokenBalance == 0) ? 'buttonNav back' : 'buttonNav'}>
|
||||
{ (ethBalance == 0 || tokenBalance == 0) && <Link to={"/wallet/" + idPoll}><Button variant="text">Back</Button></Link> }
|
||||
{ (ethBalance > 0 && tokenBalance > 0) && <Link to={"/voting/" + idPoll}><Button variant="text">Vote</Button></Link> }
|
||||
</div>
|
||||
<HelpDialog open={this.state.open} handleClose={this.handleClose} />
|
||||
</Fragment> : null);
|
||||
}
|
||||
}
|
||||
|
@ -504,4 +504,15 @@ button[disabled]{
|
||||
padding: 15px;
|
||||
border-radius: 8px;
|
||||
margin: 25px 0 !important;
|
||||
}
|
||||
|
||||
.helpLink {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
font-size: .85rem;
|
||||
margin-top: 10vh;
|
||||
}
|
||||
|
||||
.helpLink a {
|
||||
cursor: pointer;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user