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

Migrate ChevronScroll Component from SCSS to Tailwind CSS #602

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

Conversation

RojaPinnamraju
Copy link
Member

  • Migrated the ChevronScroll component from SCSS-based styling to Tailwind CSS for consistency with the design system.
  • Retained all functionality and layout from the original component while implementing Tailwind utilities.
  • New Tailwind component is located in the tw-components folder, following the team's migration plan.
  • Tested thoroughly to ensure no changes in the appearance or behavior of the component.
  • This PR is part of the ongoing effort to fully migrate from SCSS to Tailwind and ensure consistency across the frontend codebase.
    Please review and let me know if there are any issues!

@RojaPinnamraju RojaPinnamraju self-assigned this Oct 21, 2024
@LoTerence LoTerence changed the base branch from main to develop October 25, 2024 02:23
@LoTerence LoTerence self-requested a review October 25, 2024 02:31
Copy link
Member

@LoTerence LoTerence left a comment

Choose a reason for hiding this comment

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

Sorry for the long wait for this review. This PR is a really great start, thank you for your work Roja.

Just have a couple of requested changes, and it will be complete.

After this, we should easily be able to remove the _ChevronScroll.scss file, and move the
ChevronScroll.tsx component file to the /tw-components folder.

Copy link
Member

Choose a reason for hiding this comment

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

Lets revert all the changes to the original ChevronScroll.tsx file. I'd like for it to remain untouched so we have something to compare to, and other pages might still be using this component.

Edit:
On second thought, after reviewing, I see how difficult this instruction realistically is. I didn't realize there would be so much Component functionality to migrate. Sorry about that. I am going to change the instructions so that we just modify the CSS classes directly in the original Component files.

For this PR, lets remove the ChevronScrollTailwind.tsx file and keep the changes within ChevronScroll.tsx.

Thank you for going with the original instruction anyway even though it was silly 😅

const ChevronScroll = () => {
return (
<div className="whitespace-nowrap flex w-[1088px] h-[47px]">
<div className="scroll-snap-x mandatory overflow-auto flex items-center gap-4 scrollbar-none">
Copy link
Member

Choose a reason for hiding this comment

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

  • scroll-snap-x
  • mandatory
  • scrollbar-none

I don't think these are valid tailwind classes

<button
className={combineClasses(
"chevron-scroll-left-btn",
"align-center",
Copy link
Member

Choose a reason for hiding this comment

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

We should convert this align-center class to tailwind. It can be found in the _alignment.scss file.

CSS:
align-items: center

"chevron-scroll-left-btn",
"align-center",
"justify-center",
"row",
Copy link
Member

Choose a reason for hiding this comment

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

We should also convert this row class. Its definition is in _layout.scss

"chevron-scroll-right-btn",
"align-center",
"row",
"bg-white px-[32px] py-0 cursor-pointer border-none justify-center",
Copy link
Member

Choose a reason for hiding this comment

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

px-[32px]

The chevron-scroll-right-btn class has a left padding of 15px and a right padding of 32px.

Copy link
Member

Choose a reason for hiding this comment

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

Lets also keep the CSS for the above "align-center" and "row" classes.

showRightChevron ? undefined : "hidden"
)}
onClick={() => scrollMove("right")}
aria-label="Scroll right"
>
<IconChevronRight />
</button>
<button className="chevron-scroll-clear-btn">Clear all</button>
<button className="flex items-center underline font-bold text-lg text-gray-700 ml-4 bg-transparent p-0 border-none cursor-pointer">Clear all</button>
Copy link
Member

Choose a reason for hiding this comment

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

This line is perfect, very nice 👌

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