-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change the code base structure to have the file structure similar to that recommended for react applications
- Loading branch information
1 parent
dee0ad4
commit 9fda4ab
Showing
29 changed files
with
17,706 additions
and
374 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
import React from "react"; | ||
import { | ||
MDBContainer, | ||
MDBRow, | ||
MDBCol, | ||
MDBCard, | ||
MDBCardBody, | ||
MDBInput, | ||
MDBBtn, | ||
MDBIcon, | ||
MDBModalFooter | ||
} from "mdbreact"; | ||
|
||
const LoginForm = ({ onChange, onSubmit }) => { | ||
return ( | ||
<MDBContainer className="mt-5 pt-5 "> | ||
<MDBRow className="flex flex-center"> | ||
<MDBCol md="6"> | ||
<form onSubmit={onSubmit}> | ||
<MDBCard className="mx-auto"> | ||
<MDBCardBody> | ||
<div className="text-center"> | ||
<h3 className="dark-grey-text mb-5"> | ||
<strong>Sign in</strong> | ||
</h3> | ||
</div> | ||
<MDBInput | ||
label="Your Username" | ||
group | ||
type="text" | ||
name="username" | ||
onChange={onChange} | ||
validate | ||
error="wrong" | ||
success="right" | ||
/> | ||
<MDBInput | ||
label="Your password" | ||
group | ||
type="password" | ||
name="password" | ||
onChange={onChange} | ||
validate | ||
containerClass="mb-0" | ||
/> | ||
<p className="font-small blue-text d-flex justify-content-end pb-3"> | ||
Forgot | ||
<a href="#!" className="blue-text ml-1"> | ||
Password? | ||
</a> | ||
</p> | ||
<div className="text-center mb-3"> | ||
<MDBBtn | ||
gradient="blue" | ||
rounded | ||
type="submit" | ||
className="btn-block z-depth-1a" | ||
> | ||
Sign in | ||
</MDBBtn> | ||
</div> | ||
<p className="font-small dark-grey-text text-right d-flex justify-content-center mb-3 pt-2"> | ||
or Sign in with: | ||
</p> | ||
<div className="row my-3 d-flex justify-content-center"> | ||
<MDBBtn | ||
type="button" | ||
color="white" | ||
rounded | ||
className="mr-md-3 z-depth-1a" | ||
> | ||
<MDBIcon | ||
icon="facebook" | ||
className="blue-text text-center" | ||
/> | ||
</MDBBtn> | ||
<MDBBtn | ||
type="button" | ||
color="white" | ||
rounded | ||
className="mr-md-3 z-depth-1a" | ||
> | ||
<MDBIcon icon="twitter" className="blue-text" /> | ||
</MDBBtn> | ||
<MDBBtn | ||
type="button" | ||
color="white" | ||
rounded | ||
className="z-depth-1a" | ||
> | ||
<MDBIcon icon="google-plus" className="blue-text" /> | ||
</MDBBtn> | ||
</div> | ||
</MDBCardBody> | ||
<MDBModalFooter className="mx-5 pt-3 mb-1"> | ||
<p className="font-small grey-text d-flex justify-content-end"> | ||
Not a member? | ||
<a href="./signup" className="blue-text ml-1"> | ||
Sign Up | ||
</a> | ||
</p> | ||
</MDBModalFooter> | ||
</MDBCard> | ||
</form> | ||
</MDBCol> | ||
</MDBRow> | ||
</MDBContainer> | ||
); | ||
}; | ||
|
||
export default LoginForm; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from "react"; | ||
import { shallow } from "enzyme"; | ||
import Navbar from "./Navbar"; | ||
|
||
let props = { | ||
onChange: jest.fn(), | ||
onSubmit: jest.fn(), | ||
}; | ||
describe("Test Navbar", () => { | ||
let wrapper; | ||
beforeEach(() => { | ||
wrapper = shallow(<Navbar {...props} />); | ||
}); | ||
it("Navbar snapshot", () => { | ||
expect(wrapper).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.