Skip to content

Contact List Project#18

Open
jacobecox wants to merge 11 commits into
projectshft:mainfrom
jacobecox:main
Open

Contact List Project#18
jacobecox wants to merge 11 commits into
projectshft:mainfrom
jacobecox:main

Conversation

@jacobecox
Copy link
Copy Markdown

No description provided.

import { useParams } from 'next/navigation';
import { contactData } from 'app/data/contactData';

export default function Player() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why is this component named player?
also the file is page.js

Comment on lines +36 to +40

<button className='back-button' onClick={handleClick}>Back</button>
</div>
</main>
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

check your code alignment

Comment thread app/data/contactData.js
Comment on lines +19 to +28
all: function () {
return this.contacts;
},
addContact: function ({ id, photo, name, email, number }) {
this.contacts.push({ id, photo, name, email, number });
},
get: function (id) {
const isContact = (c) => c.id === id;
return this.contacts.find(isContact);
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

your alignment makes it very hard to read the code

Comment thread app/data/contactData.js
this.contacts.push({ id, photo, name, email, number });
},
get: function (id) {
const isContact = (c) => c.id === id;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

dont use letters to abbreviate, this makes the code harder to understand, also what does it mean isContact?

Suggested change
const isContact = (c) => c.id === id;
const isContact = contact => contact.id === id;

Comment thread app/newcontact/page.js
const [email, setEmail] = useState(null);
const router = useRouter();

NewContact.propTypes = {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

define your proptypes outside of your class!!

Comment thread app/newcontact/page.js
Comment on lines +38 to +41
})

router.push('/');
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

alignment

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