-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linted using standard lint rules , updated dependencies and removed c…
…ookie-parser
- Loading branch information
1 parent
657b752
commit eac72a9
Showing
58 changed files
with
17,037 additions
and
2,333 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import App from "./App"; | ||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
import App from './App' | ||
|
||
it("renders without crashing", () => { | ||
const div = document.createElement("div"); | ||
ReactDOM.render(<App />, div); | ||
}); | ||
it('renders without crashing', () => { | ||
const div = document.createElement('div') | ||
ReactDOM.render(<App />, div) | ||
}) |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import React from "react"; | ||
import React from 'react' | ||
|
||
// Make sure the shape of the default value passed to | ||
// createContext matches the shape that the consumers expect! | ||
const UserContext = React.createContext({ | ||
user: { | ||
access_id: 0, | ||
type: "Guest", | ||
type: 'Guest', | ||
user_id: 0, | ||
username: "guest" | ||
username: 'guest' | ||
}, | ||
getUserStatus: () => {}, | ||
postUserLogin: () => {}, | ||
getUserLogout: () => {}, | ||
}); | ||
export default UserContext; | ||
getUserLogout: () => {} | ||
}) | ||
export default UserContext |
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import React from "react"; | ||
import { Row, Col } from 'react-grid-system'; | ||
import "./style.css" | ||
import { Link } from 'react-router-dom'; | ||
import React from 'react' | ||
import { Row, Col } from 'react-grid-system' | ||
import './style.css' | ||
import { Link } from 'react-router-dom' | ||
const Header = props => { | ||
return ( | ||
<div id="res6"> | ||
<Row> | ||
<Col id="head" xs={9} sm={10} md={10} lg={11} xl={11}> | ||
<h4>{props.children}</h4> | ||
</Col> | ||
<Col xs={3} sm={2} md={2} lg={1} xl={1}> | ||
<Link id="xButton" className="btn navbar-right btn-primary" to="/" type="submit">X</Link> | ||
</Col> | ||
</Row> | ||
</div> | ||
return ( | ||
<div id='res6'> | ||
<Row> | ||
<Col id='head' xs={9} sm={10} md={10} lg={11} xl={11}> | ||
<h4>{props.children}</h4> | ||
</Col> | ||
<Col xs={3} sm={2} md={2} lg={1} xl={1}> | ||
<Link id='xButton' className='btn navbar-right btn-primary' to='/' type='submit'>X</Link> | ||
</Col> | ||
</Row> | ||
</div> | ||
|
||
) | ||
) | ||
} | ||
|
||
export default Header; | ||
export default Header |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import React from "react"; | ||
import UserContext from "../UserContext"; | ||
// A function to wrap a component with that will render its children only if the user is logged in and | ||
import React from 'react' | ||
import UserContext from '../UserContext' | ||
// A function to wrap a component with that will render its children only if the user is logged in and | ||
// has an access_id that matches the aId passed as a prop to the function. | ||
const RenderIfAId = (props) => ( | ||
const RenderIfAId = (props) => ( | ||
<UserContext.Consumer> | ||
{ | ||
({user}) => ( user.access_id >= props.aId ? ( | ||
{ | ||
({ user }) => (user.access_id >= props.aId ? ( | ||
<div>{props.children}</div> | ||
) : (null) | ||
) : (null) | ||
) | ||
} | ||
</UserContext.Consumer> | ||
); | ||
) | ||
|
||
export default RenderIfAId; | ||
export default RenderIfAId |
Oops, something went wrong.