Skip to content

Ben Doggett Contact List Eval#23

Open
bhdoggett wants to merge 15 commits into
projectshft:mainfrom
bhdoggett:main
Open

Ben Doggett Contact List Eval#23
bhdoggett wants to merge 15 commits into
projectshft:mainfrom
bhdoggett:main

Conversation

@bhdoggett
Copy link
Copy Markdown

No description provided.

bhdoggett and others added 12 commits January 3, 2025 11:13
…Add fetch funcitonality to get contact data from a contacts.json file.
…ith a form. Need to add input for image url link. Need to create a contact-detail page where I can edid the contact info or delete contact.
…h contact as well as a getNextId funciton that can calculate the next id to be used when a contact is added.
…ew for adding contacts and contacts/[id] for viewing contact profile card and to edit contact details. Old pages are still in folder in case something goes wrong.
…No contact found' if a url is typed in with a contact id that doesn't exist.
const ContactList = ({ search }) => {
const { contacts } = useContacts();

let filterdContacts = contacts.filter((contact) =>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can be const

Comment thread app/contacts/[id]/page.js Outdated
const { id } = useParams();
const idNum = Number(id);

if (!contacts.find((contact) => contact.id === idNum)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

excellent practice!

Comment thread app/contacts/[id]/page.js Outdated
);
}

const contact = contacts.filter((contact) => contact.id === idNum)[0];
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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