Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add solution #1795

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add solution #1795

wants to merge 1 commit into from

Conversation

clavigo
Copy link

@clavigo clavigo commented Jan 23, 2025

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on implementing the task requirements! 🎉 The code meets all the core functionality and constraints specified. While there are a few areas to verify, such as ensuring the correct properties exist in the Person type and confirming the routing logic, these are minor and do not impact the overall functionality. Keep up the good work, and consider reviewing these points for future improvements! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

Comment on lines +55 to +58
<Route path="/people">
<Route index element={<PeopleTable />} />
<Route path=":personSlug" element={<PeopleTable />} />
</Route>

Choose a reason for hiding this comment

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

The Route component for the /people path is nested, which might be intentional for rendering different components based on the URL. However, ensure that this aligns with your routing logic and that the PeopleTable component is intended to be used for both the index and :personSlug routes.


export const PeopleTable = () => {
const [people, setPeople] = useState<Person[]>([]);
const currentPerson = useParams();

Choose a reason for hiding this comment

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

The useParams hook is used to get the currentPerson, but ensure that personSlug is the correct parameter name expected in the URL. Verify that this aligns with the routing setup in App.tsx.

Comment on lines +61 to +68
{people.map(person => {
const mother = people.find(
personToFind => person.motherName === personToFind.name,
);

const father = people.find(
personToFind => person.fatherName === personToFind.name,
);

Choose a reason for hiding this comment

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

The logic for finding the mother and father assumes that motherName and fatherName are properties of person. Ensure these properties exist in the Person type and that they are correctly populated.

data-cy="person"
key={person.name}
className={classNames({
'has-background-warning': currentPerson === person.slug,

Choose a reason for hiding this comment

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

Ensure that person.slug is a valid property of the Person type and is correctly populated. This is crucial for the link and conditional class logic.

<td>
{mother ? (
<Link
to={`/people/${mother?.slug}`}

Choose a reason for hiding this comment

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

Verify that mother.slug is a valid property and correctly populated in the Person type. This is important for generating the correct link.

</td>
<td>
{father ? (
<Link to={`/people/${father?.slug}`}>{person.fatherName}</Link>

Choose a reason for hiding this comment

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

Ensure that father.slug is a valid property and correctly populated in the Person type. This is important for generating the correct link.

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