-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
ref: remove default margin from Alert in sentry #85128
Conversation
53031f9
to
83bfb04
Compare
dee8137
to
5e6b938
Compare
22b032a
to
d245601
Compare
} | ||
> | ||
This alert can be dismissed! | ||
<Alert.Container> |
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.
It's a story i know... but this could go inside the isDismissed
check so there's no "extra" space when it's dismissed
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.
it looks pretty much the same either way...but i updated it😆
@@ -1,5 +1,4 @@ | |||
import {Fragment} from 'react'; | |||
import styled from '@emotion/styled'; |
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.
so many places that removed this import! that's a win too
const AlertWithMarginBottom = styled(Alert)` | ||
const StyledAlert = styled(Alert)` | ||
margin-top: ${space(2)}; | ||
margin-bottom: 0; |
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.
WAT
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.
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.
we need a #shame channel :)
@@ -217,10 +216,6 @@ export const DismissButton = styled(Button)` | |||
} | |||
`; | |||
|
|||
export const StyledAlert = styled(Alert)` |
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.
this wasn't used or imported anywhere
Love to see all those style imports deleted ❤️ Great idea to also target the child via > as it means the container wont take space once |
d0117d0
to
d1936e1
Compare
Context
Because
Alert
used to have a default bottom margin, we had a lot of instances of styledAlerts
across the codebase that looked like this:The goal was to remove these instances entirely. In this PR, the default margin is removed from
Alert
and placed inside aAlert.Container
export instead.This PR also updates all
Alert
instances to eitherAlert.Container
if it was using the default margins of theAlert
component, ormargin: 0
styleIn summary:
tldr, using
Alert
going forwardAlert
will no longer have a default bottom margin. If you'd still like to utilize that old built-in margin, you can wrap your component with<Alert.Container>
:note that components that utilize
Alert
as a child, such asPanelAlert
andProjectPermissionAlert
, already have the<Alert.Container>
wrapped around it inside the component definition.relates to #85109
see also https://github.com/getsentry/getsentry/pull/16482 (getsentry counterpart)