Skip to content

Upload files of admin panel#1

Open
Dnku wants to merge 2 commits intohaifa-dev:masterfrom
Dnku:master
Open

Upload files of admin panel#1
Dnku wants to merge 2 commits intohaifa-dev:masterfrom
Dnku:master

Conversation

@Dnku
Copy link
Copy Markdown

@Dnku Dnku commented Jul 2, 2020

No description provided.

Copy link
Copy Markdown
Collaborator

@Polarts Polarts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

);
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be a good idea to move it to a separated file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants