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

Create Alert Component #744

Merged
merged 10 commits into from
Nov 5, 2024

Conversation

amy-corson-ibigroup
Copy link
Contributor

@amy-corson-ibigroup amy-corson-ibigroup commented May 30, 2024

Creates a basic customizable alert in building blocks

image image image

Copy link
Collaborator

@miles-grant-ibigroup miles-grant-ibigroup 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! The only blocking thing for me is the huge yarn.lock size increase

Icon?: any;
}

const AlertContainer = styled.div<{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we consider going more semantic and using a details tag?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm I think this would actually make the component less customizable, since details always has a toggle, and this alert currently only has a toggle if collapsible is true

Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to hide the toggle with CSS?

packages/building-blocks/src/stories/alerts.story.tsx Outdated Show resolved Hide resolved
packages/building-blocks/src/Alert.tsx Outdated Show resolved Hide resolved
packages/building-blocks/package.json Outdated Show resolved Hide resolved
Copy link
Collaborator

@miles-grant-ibigroup miles-grant-ibigroup left a comment

Choose a reason for hiding this comment

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

Safe enough for now!

Copy link
Contributor

@daniel-heppner-ibigroup daniel-heppner-ibigroup left a comment

Choose a reason for hiding this comment

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

can we fix the issue with the key?

}
];

const alertKey = crypto.randomUUID();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just use i for the key? Does that break something?

Copy link
Contributor

Choose a reason for hiding this comment

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

actually yeah this is bad because all the keys will all be the same!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!! I moved this into the map so it actually does what it's supposed to do, although I guess i would work in this case because the order of the mock alerts in this story isn't going to change? Happy to change it if someone feels strongly?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually I didn't realize this is just the story. It's fine, stories don't have to be perfect!

Copy link
Contributor

@daniel-heppner-ibigroup daniel-heppner-ibigroup left a comment

Choose a reason for hiding this comment

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

Looks good!

}
];

const alertKey = crypto.randomUUID();
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually I didn't realize this is just the story. It's fine, stories don't have to be perfect!

@amy-corson-ibigroup amy-corson-ibigroup merged commit 9d0e1cf into opentripplanner:master Nov 5, 2024
2 checks passed
@amy-corson-ibigroup amy-corson-ibigroup deleted the create-bb-alert branch November 5, 2024 01:05
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.

3 participants