You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.0 KiB
41 lines
1.0 KiB
import React from "react"; |
|
import { Container, Form, Header, Message } from "semantic-ui-react"; |
|
|
|
import Error from "../Shared/Error"; |
|
|
|
const UserInfoFormView = ({ |
|
isSendingUserRequest, |
|
userRequestError, |
|
userRequestSuccess, |
|
phoneNumber, |
|
changePhoneNumber, |
|
onSubmitUserInfo |
|
}) => ( |
|
<Container> |
|
<Header>User Info</Header> |
|
<Form |
|
loading={isSendingUserRequest} |
|
onSubmit={onSubmitUserInfo} |
|
error={!!userRequestError} |
|
success={!!userRequestSuccess} |
|
> |
|
<Form.Field> |
|
<label>Phone Number</label> |
|
<input |
|
placeholder="780-999-9999" |
|
type="tel" |
|
value={phoneNumber} |
|
onChange={changePhoneNumber} |
|
/> |
|
</Form.Field> |
|
<Error header="Modify User Info failed!" error={userRequestError} /> |
|
<Message success> |
|
<Message.Header>Modify User Info successful!</Message.Header> |
|
<p>Set user info successfully.</p> |
|
</Message> |
|
<Form.Button>Submit User Info</Form.Button> |
|
</Form> |
|
</Container> |
|
); |
|
|
|
export default UserInfoFormView;
|
|
|