Open
Conversation
Polarts
requested changes
Jul 9, 2020
Collaborator
Polarts
left a comment
There was a problem hiding this comment.
The code needs some cleanup. Look at my comments and make the changes if you think they're really needed, and clean parts of your code to make it more readable and professional.
Comment on lines
+21
to
+25
| { displayName: "Home", href: "/Home", className: "fa fa-home" }, | ||
| { displayName: "Profile", href: "/Profile", className: "fa fa-user" }, | ||
| { displayName: "Events", href: "/Event", className: "fa fa-calendar" }, | ||
| { displayName: "Projects", href: "/Project", className: "fa fa-diamond" }, | ||
| { displayName: "Requests", href: "/Request", className: "fa fa-paper-plane-o" } |
Collaborator
There was a problem hiding this comment.
Shouldn't you make a model class for this? It will be much easier
Comment on lines
+29
to
+30
| const MyNav = (props) => { | ||
| const navItems = props.navItems; |
Collaborator
There was a problem hiding this comment.
If you only use 1 property of props, use deconstruction instead.
MyNav = ({navItems}) => ...
It will automatically extract it, no need to declare a variable.
Comment on lines
+1
to
+44
| // // import React, { } from 'react' | ||
| // import React, { useState } from 'react' | ||
|
|
||
| // const Create = props => { | ||
|
|
||
| // // const initialFormState = { id: null, name: '', } | ||
| // const [profile, setRow] = useState(props.profile) | ||
|
|
||
| // const handleInputChange = event => { | ||
| // const { name, value } = event.target | ||
| // setRow({ ...profile, [name]: value }) | ||
| // } | ||
| // return ( | ||
|
|
||
| // <form onSubmit={event => { | ||
| // event.preventDefault() | ||
| // // if (!profile.name) return | ||
| // props.addRow(profile) | ||
| // //setRow(initialFormState) | ||
| // }}> | ||
|
|
||
| // <div className="card shadow m-3"> | ||
| // <div className="card-header"> | ||
| // <h5>Create Profile</h5> | ||
| // </div> | ||
| // <div className="card-body"> | ||
| // {/* <label>Name: </label> | ||
| // <input type="text" name="name" value={profile.name} onChange={handleInputChange} /> | ||
| // */} | ||
| // <div className="form-group"> | ||
| // {/* <label htmlFor="name">Name</label> */} | ||
| // <input type="text" className="form-control" id="Name" placeholder="Name" name="name" value={profile.name} onChange={handleInputChange} /> | ||
| // </div> | ||
|
|
||
| // </div> | ||
| // <div className="card-footer bg-transparent "> | ||
| // <button type="submit" className="btn btn-success float-right">Save</button> | ||
| // </div> | ||
| // </div> | ||
| // </form> | ||
| // ) | ||
| // } | ||
|
|
||
| // export default Create |
Collaborator
There was a problem hiding this comment.
Why did you leave this comment?
Comment on lines
+20
to
+43
| const navItems = [ | ||
| { displayName: "Home", href: "/Home", className: "fa fa-home" }, | ||
| { displayName: "Profile", href: "/Profile", className: "fa fa-user" }, | ||
| { displayName: "Events", href: "/Event", className: "fa fa-calendar" }, | ||
| { displayName: "Projects", href: "/Project", className: "fa fa-diamond" }, | ||
| { displayName: "Requests", href: "/Request", className: "fa fa-paper-plane-o" } | ||
| ]; | ||
|
|
||
|
|
||
| const MyNav = (props) => { | ||
| const navItems = props.navItems; | ||
| const listItems = navItems.map((navItem) => | ||
| <a className="list-group-item list-group-item-action bg-black" href={navItem.href} key={navItem.displayName}> | ||
| <i className={navItem.className} aria-hidden="true"></i> | ||
| {navItem.displayName} | ||
| </a> | ||
| ); | ||
| return ( | ||
| <div className="list-group list-group-flush"> | ||
| {listItems} | ||
| </div> | ||
|
|
||
| ); | ||
| } |
Collaborator
There was a problem hiding this comment.
Could be a good idea to move it to a separated file
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.