-
Notifications
You must be signed in to change notification settings - Fork 2
BA-1794: storybook cleanup #134
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { Meta } from '@storybook/addon-docs' | ||
|
|
||
| <Meta title="Introduction" /> | ||
|
|
||
| # BaseApp Packages Storybook | ||
|
|
||
| ## What is Storybook? | ||
|
|
||
| Storybook is an open-source tool for building and documenting UI components and pages in isolation. It allows developers to create, test, and document components without needing to rely on the backend or navigate through the entire application. This approach enhances the speed and reliability of UI development by enabling component-focused workflows. | ||
|
|
||
| ## Purpose of This Storybook | ||
|
|
||
| The Storybook for **BaseApp Components Package** serves as a centralized resource for developers, designers or any interested person to: | ||
|
|
||
| - **Explore Components**: View, test, and understand the various UI components and pages available in the project. | ||
| - **Document Features**: Provide comprehensive documentation for each component and page, ensuring that their purpose, usage, and customization options are clear to all team members. | ||
| - **Facilitate Collaboration**: Storybook enables both developers and non-developers to review and discuss UI elements, fostering better communication across the team. | ||
|
|
||
| ## How to Use This Storybook | ||
|
|
||
| 1. **Browse Components and Pages**: Navigate through the sidebar to explore the different components and pages. Each item has a detailed documentation section outlining its purpose, props, and usage examples. | ||
| 2. **Check Component States**: Each component has multiple stories showcasing its different states, such as default, loading, or error configurations. This provides a comprehensive view of how each component behaves in various scenarios. | ||
| 3. **View Documentation**: Each component and page includes an MDX documentation file with information on usage, props, and additional notes. This documentation is intended to be a reference for all team members, from developers to designers. | ||
|
|
||
| ## Contribution and Maintenance | ||
|
|
||
| For consistency, please follow the documentation standards when adding new components or updating existing ones. You can refer to our [Tettra page](https://app.tettra.co/teams/TSL/pages/frontend-documentation) for detailed guidelines on writing stories and MDX documentation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...s/components/modules/__shared__/ReactionButton/__storybook__/ReactionButton.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { Meta } from '@storybook/addon-docs' | ||
|
|
||
| <Meta title="@baseapp-frontend | components/Shared/ReactionButton" /> | ||
|
|
||
| # Component Documentation | ||
|
|
||
| ## ReactionButton | ||
|
|
||
| - **Purpose**: The `ReactionButton` component provides an interactive button for users to react to content (e.g., like or dislike) with options to handle success and error responses. The component also displays the current reaction count and supports Relay for efficient data loading. | ||
| - **Expected Behavior**: When clicked, the button triggers a reaction action and updates the UI to reflect the new state. If the user has already reacted, it shows a "selected" icon. The component should handle loading states and display the total count of reactions. | ||
|
|
||
| ## Use Cases | ||
|
|
||
| - **Current Usage**: This component is currently used within `CommentReactionButton` for `CommentItem`. | ||
| - **Potential Usage**: The `ReactionButton` could also be used for other content types that support reactions, such as posts, images, or articles. | ||
|
|
||
| ## Props | ||
|
|
||
| - **target** (ReactionButton_target$key): The target data for the reaction button. Typically a comment or post, providing data about the current reactions. | ||
| - **reactionType** (string): Specifies the type of reaction, such as "LIKE" or "DISLIKE". | ||
| - **children** (function): Function to render children components with reaction handlers and data. Expected format: | ||
| `(props: { handleReaction: () => void, isLoading: boolean, target: ReactionButton_target$data }) => ReactElement | null` | ||
| - **handleError** (function): Callback function to handle errors during the reaction process. | ||
| - **handleSuccess** (function): Callback function to handle success, executed after a successful reaction. | ||
|
|
||
| ## Notes | ||
|
|
||
| - **Related Components**: `CommentReactionButton`, `CommentItem`. | ||
|
|
||
| ## Example Usage | ||
|
|
||
| ```javascript | ||
| import ReactionButton from '../ReactionButton' | ||
|
|
||
| export const DefaultComments = (target) => ( | ||
| <ReactionButton | ||
| target={target} | ||
| reactionType="LIKE" | ||
| handleError={() => console.log('Error handling reaction')} | ||
| handleSuccess={() => console.log('Successfully handled reaction')} | ||
| /> | ||
| ) | ||
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
💡 Codebase verification
No MDX files found in specified directories.
Please ensure that MDX files exist in the following paths:
packages/components/modules/**/__storybook__packages/design-system/components/**/__storybook__🔗 Analysis chain
LGTM! Proper organization of story paths.
The story paths are well-organized with documentation files (.mdx) preceding the story files, which follows best practices for Storybook configuration.
Let's verify the existence of MDX files in the specified paths:
Shell script corrected to verify MDX file existence:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 1803
Script:
Length of output: 341