diff --git a/src/components/AuthWrapper/index.js b/src/components/AuthWrapper/index.js index a92794c..ae109d3 100644 --- a/src/components/AuthWrapper/index.js +++ b/src/components/AuthWrapper/index.js @@ -38,7 +38,7 @@ const AuthWrapper = props => { } /> - + false} isOpen={false} /> diff --git a/src/components/CreateStore/index.js b/src/components/CreateStore/index.js index c4851a7..7e40f63 100644 --- a/src/components/CreateStore/index.js +++ b/src/components/CreateStore/index.js @@ -1,6 +1,6 @@ import React from "react"; +import moment from "moment"; import propTypes from "prop-types"; -import TextField from "material-ui/TextField"; import RaisedButton from "material-ui/RaisedButton"; import styled from "styled-components"; import TimePicker from "material-ui/TimePicker"; @@ -11,12 +11,29 @@ import ImageHandler from "./ImageHandler"; import { Map } from "immutable"; import { Grid, Row, Col } from "react-flexbox-grid"; import { isEmpty } from "lodash"; +import { grey500, red500 } from "material-ui/styles/colors"; const TelBlockContainer = styled.span` width: 80px; margin-right: 20px; `; -const OrderInCountTextField = styled(TextField)``; + +const Input = styled.input` + width: ${props => props.width || "200px"}; + height: 22px; + font-size: 0.9em; + line-height: 1.2em; + border: 0px solid white; + border-bottom: 1px solid ${grey500}; + &::placeholder { + color: ${props => props.error ? red500 : grey500}; + } + &:focus{ + &::placeholder { + color: ${grey500} + } + } +`; const OrderInSelectField = styled(SelectField)` width: 50px; @@ -106,15 +123,18 @@ class CreateStore extends React.Component { if (error === true) { return this.setState({ errors }); } else { - this.props.handleCreateStore({ - data - }); + data.time.start = moment(data.time.start).format("hh:ss"); + data.time.end = moment(data.time.end).format("hh:ss"); + console.log(data.time); + // this.props.handleCreateStore({ + // data + // }); } }; render() { - const { data, errors, imageLoading } = this.state; - const { store } = this.props; + const { data, imageLoading } = this.state; + const { store, history } = this.props; return ( @@ -128,10 +148,9 @@ class CreateStore extends React.Component { />
- { const newData = { @@ -143,10 +162,9 @@ class CreateStore extends React.Component { />
- { const newData = { @@ -159,7 +177,7 @@ class CreateStore extends React.Component {
- { const { data } = this.state; @@ -172,13 +190,13 @@ class CreateStore extends React.Component { }; this.setState({ data: newData }); }} - hintText="請輸入區碼" - style={{ width: 80 }} + placeholder="請輸入區碼" + width="80px" value={data.tel.block} /> - { @@ -192,8 +210,7 @@ class CreateStore extends React.Component { }; this.setState({ data: newData }); }} - errorText={errors.telNum} - hintText="請輸入號碼或手機" + placeholder="請輸入電話" value={data.tel.num} /> @@ -245,9 +262,9 @@ class CreateStore extends React.Component { 外送條件: - { @@ -291,6 +308,12 @@ class CreateStore extends React.Component { style={{ margin: 12 }} onClick={() => this.submit(data)} /> + history.push("/store")} + />
diff --git a/src/components/Store/ListTable.js b/src/components/Store/ListTable.js index 14422b5..3088924 100644 --- a/src/components/Store/ListTable.js +++ b/src/components/Store/ListTable.js @@ -6,7 +6,7 @@ import Avatar from "material-ui/Avatar"; import Paper from "material-ui/Paper"; import Divider from "material-ui/Divider"; import { red900 } from "material-ui/styles/colors"; -import { List } from "material-ui/List"; +import { List, ListItem } from "material-ui/List"; import { Col } from "react-flexbox-grid"; class ListTable extends React.Component { @@ -17,6 +17,7 @@ class ListTable extends React.Component { render() { return this.props.storeList.map((store, index) => { + console.log(store); return ( + + + @@ -37,6 +41,7 @@ class ListTable extends React.Component { style={{ margin: 5 }} icon={} /> + ({}); +const mapStateToProps = ({store}) => ({ + store +}); const mapDispatchToProps = dispatch => { return {};