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

et-501: create drawer component #156

Merged
merged 2 commits into from
Nov 27, 2024
Merged

et-501: create drawer component #156

merged 2 commits into from
Nov 27, 2024

Conversation

bejoinka
Copy link
Contributor

@bejoinka bejoinka commented Nov 27, 2024

User description

there is currently no drawer component. simple drawer component with left/right and flexible size.


PR Type

Enhancement, Tests


Description

  • Implemented a new Drawer component with customizable width and side options.
  • Added styles for the Drawer component and new utility classes for layout and transitions.
  • Created unit tests for the Drawer component to ensure correct rendering and behavior.
  • Exported the Drawer component in the main components index.
  • Added a Storybook story to demonstrate the Drawer component usage.
  • Updated icon types to include RiHistoryLine.

Changes walkthrough 📝

Relevant files
Enhancement
style.css
Add styles for drawer component and utilities                       

style.css

  • Added styles for the new drawer component.
  • Introduced utility classes for grid layout and transitions.
  • Added new width and height utility classes.
  • +75/-0   
    index.ts
    Export Drawer component in index                                                 

    src/components/index.ts

    • Exported the new Drawer component.
    +1/-0     
    drawer.tsx
    Implement Drawer component with customizable options         

    src/components/ui/drawer/drawer.tsx

  • Implemented the Drawer component with customizable width and side.
  • Used clsx for conditional class names.
  • +45/-0   
    index.ts
    Create index file for Drawer component                                     

    src/components/ui/drawer/index.ts

    • Created an index file to export the Drawer component.
    +2/-0     
    types.ts
    Add RiHistoryLine icon to ICONS                                                   

    src/components/ui/icon/types.ts

    • Added RiHistoryLine icon to the ICONS export.
    +4/-2     
    Tests
    drawer.spec.tsx
    Add unit tests for Drawer component                                           

    src/components/ui/drawer/drawer.spec.tsx

  • Added unit tests for the Drawer component.
  • Tested drawer width, position, and transform classes.
  • +55/-0   
    Documentation
    Drawer.stories.tsx
    Add Storybook story for Drawer component                                 

    src/stories/Drawer.stories.tsx

  • Added a Storybook story for the Drawer component.
  • Demonstrated controlled drawer usage in a grid layout.
  • +31/-0   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Redundant Code
    The CSS classes .duration-300 and .ease-in-out are defined twice with the same properties. Consider removing the duplicate definitions to clean up the codebase.

    Copy link

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @bejoinka bejoinka merged commit 9b9b184 into main Nov 27, 2024
    2 checks passed
    side === 'left' ? 'left-0' : 'right-0'
    )
    }
    style={{ width: `${drawerWidth}px` }}
    Copy link
    Collaborator

    Choose a reason for hiding this comment

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

    Suggestion
    What if I want to pass width in '%' or 'rem' ? 🤔 Maybe it make sense to change this to be more generic and allow to pass tailwind class instead of absolute value.

    @skrobek skrobek deleted the drawer branch December 17, 2024 09:05
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants