Sha256: 77adb6519dcd93653dfbfd004791b0f77797055ef7a032665f009e3221f88726
Contents?: true
Size: 1.82 KB
Versions: 1
Compression:
Stored size: 1.82 KB
Contents
import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import { Link } from 'react-router-dom' import { Button, CellsTips, CellHeader, CellBody, ButtonArea, Form, FormCell, Input, Label, } from 'react-weui'; import { changeInput, login } from '../../actions' import BasePage from './BasePage' const DemoPage = ({ changeInput, login, ...props }) => { console.log(props) return ( <BasePage title="Demo" desc="Demo" page={ <div> <Form> <FormCell> <CellHeader> <Label>mail</Label> </CellHeader> <CellBody> <Input name="mail" onChange={changeInput} type="mail" placeholder="Enter your mail" /> </CellBody> </FormCell> <FormCell> <CellHeader> <Label>Pass</Label> </CellHeader> <CellBody> <Input name="pass" onChange={changeInput} type="password" placeholder="Enter your pass" /> </CellBody> </FormCell> </Form> <ButtonArea direction="horizontal"> <Button type="default" onClick={() => props.history.push('/signup')}>signup</Button> <Button type="primary" onClick={login}>login</Button> </ButtonArea> <CellsTips>forgot password <Link to="/forgot">here</Link></CellsTips> </div> } /> ); } DemoPage.propTypes = { changeInput: PropTypes.func.isRequired, login: PropTypes.func.isRequired, } const mapDispatchToProps = dispatch => ({ changeInput: e => dispatch(changeInput(e.target.name, e.target.value)), login: e => dispatch(login()), }) export default connect(null, mapDispatchToProps)(DemoPage)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
weget-0.1.6 | lib/weget/react/imports/ui/pages/DemoPage.js |