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

init commit #1854

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

init commit #1854

wants to merge 2 commits into from

Conversation

nex1994
Copy link

@nex1994 nex1994 commented Feb 2, 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 the core functionality and constraints, with only minor issues related to prop naming consistency. These don't impact the overall functionality, so feel free to merge. Keep up the good work and consider aligning prop names for clarity in future projects! 😊

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

src/App.tsx Outdated
</h1>
<Tabs
tabs={tabs}
isSelected={selectedTabId}

Choose a reason for hiding this comment

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

The prop isSelected should be renamed to selectedTabId to match the task description and the Tabs component's expected prop name. This ensures consistency and clarity in the code.

title: string;
content: string;
}[];
isSelected: string;

Choose a reason for hiding this comment

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

The prop isSelected should be renamed to selectedTabId to maintain consistency with the task description and the App.tsx file. This will ensure that the prop names are consistent across the application.

onTabSelected: (tabID: string) => void;
};

export const Tabs = ({ tabs, isSelected, onTabSelected }: Props) => {

Choose a reason for hiding this comment

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

Update the destructured prop isSelected to selectedTabId to match the corrected prop name in the Props type.

return (
<li
key={tab.id}
className={isSelected === tab.id ? 'is-active' : ''}

Choose a reason for hiding this comment

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

Ensure that the className logic uses the updated prop name selectedTabId instead of isSelected.

</div>

<div className="block" data-cy="TabContent">
{tabs.map(tab => (tab.id === isSelected ? tab.content : ''))}

Choose a reason for hiding this comment

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

Update the condition to use selectedTabId instead of isSelected to match the corrected prop name.

Copy link

@Zibi95 Zibi95 left a comment

Choose a reason for hiding this comment

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

Hey. Fix suggestion from AI and rest is fine

@nex1994 nex1994 requested a review from Zibi95 February 4, 2025 20:03
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.

3 participants