Created
November 27, 2018 10:01
-
-
Save kvnam/4efc256a14f9ee86e91ca2caf37aea69 to your computer and use it in GitHub Desktop.
WordPress REST API - Sign in Component
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
import React from "react"; | |
import { Col, Form, InputGroup, FormGroup, Input, Button, InputGroupAddon, InputGroupText } from "reactstrap"; | |
const signIn = (props) => { | |
return ( | |
<Col xs="12" md={{size:6, offset: 3}}> | |
<h1 style={{textAlign: "center"}}>Sign In!</h1> | |
<Form autoComplete="false"> | |
<InputGroup className="mb-3"> | |
<InputGroupAddon addonType="prepend"> | |
<InputGroupText>Username</InputGroupText> | |
</InputGroupAddon> | |
<Input type="text" name="username" id="username" | |
placeholder="Enter your username" | |
value={props.uid} | |
onChange={(event) => props.inputChanged(event, "username", "signin")}/> | |
</InputGroup> | |
<InputGroup className="mb-3"> | |
<InputGroupAddon addonType="prepend"> | |
<InputGroupText>Password</InputGroupText> | |
</InputGroupAddon> | |
<Input type="password" name="password" id="password" | |
placeholder="Enter your password" | |
value={props.pwd} | |
onChange={(event) => props.inputChanged(event, "password", "signin")}/> | |
</InputGroup> | |
<FormGroup style={{textAlign: "center"}}> | |
<Button color="warning" onClick={props.onUserClick}>Submit</Button> | |
</FormGroup> | |
</Form> | |
</Col> | |
) | |
}; | |
export default signIn; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment