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

Docs: Story for the Alert component #645 #653

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

MichaelLarocca
Copy link

Docs: Add Alert Story (#645)

  • Wrote a Story for the Alert component

Closes #645

Docs: Add Alert Story (#645)\n\n- [x] Wrote a Story for the Alert component.\n\nCloses #645
Copy link

appwrite bot commented Nov 7, 2024

Gridiron Survivor Application 6616ea581ef9f5521c7d

Function ID Status Action
Your function has been successfully deployed.

Project name: Gridiron Survivor Application
Project ID: 6616ea581ef9f5521c7d

Function ID Status Action
userAuth 6626fef885a9f630442b ready Ready View Logs

Only deployments on the production branch are activated automatically. If you'd like to activate this deployment, navigate to your deployments. Learn more about Appwrite Function deployments.

💡 Did you know?
You can use Avatars API to generate QR code for any text or URLs

Copy link

vercel bot commented Nov 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gridiron-survivor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2024 3:34pm
gridiron-survivor-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2024 3:34pm

Docs: Updated Alert Story (#645)\n\n- [x] Wrote a Story for the Alert component.\n\nCloses #645
@shashilo
Copy link
Collaborator

shashilo commented Nov 9, 2024

@MichaelLarocca This is the Storybook inspiration I want to shoot for. Let's discuss next week. https://react.carbondesignsystem.com/?path=/docs/components-button--overview

@@ -0,0 +1,87 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

Copy link
Contributor

@choir241 choir241 Nov 14, 2024

Choose a reason for hiding this comment

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

Are you supposed to write tests for this Alert story? Please confirm with Shashi if this is the case of not

docs: {
description: {
component: `
The \`Alert\` component is a dynamic UI element from the Shadcn UI library, designed to display important notifications to users. It combines several subcomponents—\`AlertTitle\`, \`AlertDescription\`, and \`AlertDefault\`—into a cohesive \`AlertNotification\` component. This component is exported as \`<Alert variant={variant} message="Whatever message" />\`, making it easy to use across applications.
Copy link
Contributor

Choose a reason for hiding this comment

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

Shadcn UI library link to the Shadcn UI library docs


- **Success**: Indicates successful operations, such as a successful user sign-in.
- **Error**: Alerts users to errors, like incorrect login information.
- **Warning**: Reserved for potential issues.
Copy link
Contributor

@choir241 choir241 Nov 14, 2024

Choose a reason for hiding this comment

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

could you provide an example of when a warning message would occur, like the Success and error variants, for consistency?

- **Success**: Indicates successful operations, such as a successful user sign-in.
- **Error**: Alerts users to errors, like incorrect login information.
- **Warning**: Reserved for potential issues.
- **Default**: Used for general information.
Copy link
Contributor

Choose a reason for hiding this comment

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

could you provide an example of when a default message would occur, like the Success and error variants, for consistency?


### Usage

The \`Alert\` component is primarily used to provide users with visual feedback on the status of their actions, such as confirming successful operations or notifying them of errors. It is integrated with \`react-hot-toast\` to enable popup notifications, enhancing user experience by providing immediate feedback.
Copy link
Contributor

Choose a reason for hiding this comment

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

popup should be pop-up

Comment on lines +28 to +30
\`\`\`jsx
<Alert variant="success" message="This is a success alert" />
\`\`\`
Copy link
Contributor

Choose a reason for hiding this comment

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

Please take a look at how the other stories are being defined in stories.tsx files

Comment on lines +34 to +35
- **variant**: Determines the type of alert, affecting its title and color. Options include 'success', 'error', 'warning', and 'default'.
- **message**: The content of the alert message, rendered within the \`AlertDescription\`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this be better as a table?


### Integration with Toast

The component's notification functionality is powered by \`react-hot-toast\`, a package that handles popup notifications. By wrapping \`toast.custom()\` around \`<Alert variant={} message="" />\`, the component can display alerts as pop-up notifications, providing users with immediate visual feedback.`,
Copy link
Contributor

Choose a reason for hiding this comment

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

popup notifications should be pop-up notifications

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.

Stories: Add Alert Story
4 participants