-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
base: master
Are you sure you want to change the base?
init commit #1854
Conversation
There was a problem hiding this 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} |
There was a problem hiding this comment.
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.
src/components/Tabs/Tabs.tsx
Outdated
title: string; | ||
content: string; | ||
}[]; | ||
isSelected: string; |
There was a problem hiding this comment.
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.
src/components/Tabs/Tabs.tsx
Outdated
onTabSelected: (tabID: string) => void; | ||
}; | ||
|
||
export const Tabs = ({ tabs, isSelected, onTabSelected }: Props) => { |
There was a problem hiding this comment.
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.
src/components/Tabs/Tabs.tsx
Outdated
return ( | ||
<li | ||
key={tab.id} | ||
className={isSelected === tab.id ? 'is-active' : ''} |
There was a problem hiding this comment.
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
.
src/components/Tabs/Tabs.tsx
Outdated
</div> | ||
|
||
<div className="block" data-cy="TabContent"> | ||
{tabs.map(tab => (tab.id === isSelected ? tab.content : ''))} |
There was a problem hiding this comment.
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.
There was a problem hiding this 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
DEMO LINK