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

(feat): Add helper components #154

Merged
merged 2 commits into from
Oct 9, 2023
Merged

Conversation

sudhanshutech
Copy link
Member

@sudhanshutech sudhanshutech commented Oct 9, 2023

Notes for Reviewers

Helper Component: Window Dimensions Hook

Description

This pull request introduces a new helper component, useWindowDimensions, as part of our ongoing effort to enhance code reusability. This custom React hook allows us to efficiently track changes in window dimensions, providing a straightforward way to access the current window's width and height in real-time.

Changes Made

  • Added the useWindowDimensions hook in a new file, windowSize.tsx, and documented its usage.
  • Included a usage example in the README file to showcase the helper's functionality.
  • Created a foundation for adding more such helper components in the future to streamline development.

How to Use

  1. Import the useWindowDimensions hook from dimension.ts into your React component.
  2. Leverage the hook to access the current window's dimensions.
  3. Seamlessly respond to window size changes in your application.

Note

This component is needed specially to declare data-tables structure for responsive columns or we can use across any custom components to ensure there responsiveness.
Further adding any such helper components will be documented under readme.md

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Sudhanshu Dasgupta <[email protected]>
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for providing a README.md on this.

However I am a bit confused, is this hook expected to be used in Meshery and Meshery Cloud? Or just for internal use in the components package.

Copy link
Member Author

Choose a reason for hiding this comment

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

This hook basically will focus initially on internal use for our custom components but we can also export this

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, I made a note to add this to the hooks library once I have this merged in. For now, looks good to me.

@nebula-aac nebula-aac merged commit d9e90a7 into layer5io:master Oct 9, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants