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

Leo/feature/103 update main page to have an intro component #138

Merged

Conversation

leolabdev
Copy link
Member

add a template for the intro functional, requires to be update when figma will be done

Introduced an Intro component to the homepage, including a button for smooth scrolling to the main content. Implemented logic to hide the scrollbar while in the intro section and added styles for a seamless user experience.
Reorganized scroll handling logic by separating concerns into distinct functions. Introduced a `scrollToIntro` function to improve readability and maintainability, and encapsulated scroll direction detection within this function. This change aims to make the code more modular and easier to understand.
Updated multiple layout files to remove the 'overlaid' prop from Navbar components for consistency and simpler styling. Changed 'fixed' position to 'sticky' in NavbarDesktopV2 styles for better scrolling behavior.
Removed the `overlayed` class and the `overlaid` prop from `NavbarDesktopV2` component. Changed the position of the `navbar` to `relative` and cleaned up unnecessary comments. This improves code readability and ensures the component uses only necessary styles and props.
Comment out the overlaid class handling and change the fixed positioning to sticky. Additionally, update responsive styles for better alignment and ensure consistent imports on the TypeScript side.
This commit removes an obsolete commented-out `position: absolute;` from the NavbarMobileV2 SCSS file. Cleaning up commented-out code helps to maintain a more readable and maintainable codebase.
Renamed `hideScrollbar` to `isScrollbarHidden` for clarity and consistency. Removed commented-out CSS rules and unused JSX code to clean up the layout component.
Moved scroll-related logic from `HomeLayout` component to a dedicated custom hook `useScrollHandler`. This enhances code modularity and readability, making the component less cluttered and easier to maintain.
Refactored scroll function to handle both upward and downward scrolling more intuitively. Removed old code and replaced it with a more unified approach that smooth scrolls to relevant content based on scroll direction. This ensures a smoother user experience in navigating between intro and main content sections.
Refactor the code to add functions that disable and enable user interaction during scroll animations, ensuring smoother transitions. This prevents the user from interacting with the page while the scroll operation is in progress.
Moved Intro component and related files to a new "_intro" directory for better organization. This change involved updating import paths and renaming associated stylesheet files, ensuring the application structure is cleaner and more maintainable.
Refactor the Intro component to use a Props type for defining prop types, improving the readability and maintainability of the code. Additionally, set the displayName for easier debugging in development tools.
Consolidate styles into Intro.module.scss and replace inline styles. Migrate default button to a styled Button component with a Graffiti theme, simplifying the Intro.tsx code.
Refactored the useScrollHandler function and its import statements to adhere to a new naming convention, adding an underscore prefix. This change ensures consistency across the codebase and aids in better organization.
This change refactors the `Intro` component to use `forwardRef` for better handling of references. The classNames utility is also removed from the home layout file. The code is now more concise and easier to read.
@leolabdev leolabdev self-assigned this Oct 4, 2024
The 'overlaid' prop has been eliminated from multiple Navbar components, including NavbarDesktopV2, NavbarMainOld, and NavbarMain. This simplifies the component interfaces and removes unnecessary prop handling and related logic.
Copy link
Member

@MikhailDeriabin MikhailDeriabin left a comment

Choose a reason for hiding this comment

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

Looks great

@leolabdev leolabdev merged commit 861e56b into dev Oct 4, 2024
1 check failed
@leolabdev leolabdev deleted the leo/feature/103-update-main-page-to-have-an-intro-component branch October 4, 2024 13:31
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