-
Notifications
You must be signed in to change notification settings - Fork 370
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
change: [M3-9067] - Improve Backups Banner Styles and Refactor Notice Component #11480
Changes from 13 commits
cb54e6d
58ff6eb
2ea55ec
4f5e85e
7196e5b
3696260
b03cbf4
bdab2e1
de06c40
b99d367
ab6ac44
edc68e8
a5706a7
fac9c48
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/manager": Changed | ||
--- | ||
|
||
Improved backups banner styles ([#11480](https://github.com/linode/manager/pull/11480)) |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import { Box, StyledLinkButton, Typography } from '@linode/ui'; | ||
import { IconButton, Notice, Typography } from '@linode/ui'; | ||
import Close from '@mui/icons-material/Close'; | ||
import * as React from 'react'; | ||
import React from 'react'; | ||
|
||
import { LinkButton } from 'src/components/LinkButton'; | ||
import { useAccountSettings } from 'src/queries/account/settings'; | ||
import { useAllLinodesQuery } from 'src/queries/linodes/linodes'; | ||
import { | ||
|
@@ -11,7 +12,6 @@ import { | |
import { useProfile } from 'src/queries/profile/profile'; | ||
|
||
import { BackupDrawer } from './BackupDrawer'; | ||
import { StyledPaper } from './BackupsCTA.styles'; | ||
|
||
export const BackupsCTA = () => { | ||
const { data: accountSettings } = useAccountSettings(); | ||
|
@@ -20,7 +20,7 @@ export const BackupsCTA = () => { | |
const { data: isBackupsBannerDismissed } = usePreferences( | ||
(preferences) => preferences?.backups_cta_dismissed | ||
); | ||
const { mutateAsync: updatePreferences } = useMutatePreferences(); | ||
const { mutate: updatePreferences } = useMutatePreferences(); | ||
|
||
const [isBackupsDrawerOpen, setIsBackupsDrawerOpen] = React.useState(false); | ||
|
||
|
@@ -44,26 +44,31 @@ export const BackupsCTA = () => { | |
} | ||
|
||
return ( | ||
<StyledPaper> | ||
<Typography sx={{ fontSize: '1rem', marginLeft: '0.5rem' }}> | ||
<StyledLinkButton onClick={() => setIsBackupsDrawerOpen(true)}> | ||
<Notice | ||
bgcolor={(theme) => theme.palette.background.paper} | ||
display="flex" | ||
flexDirection="row" | ||
justifyContent="space-between" | ||
spacingBottom={8} | ||
variant="info" | ||
> | ||
<Typography fontSize="inherit"> | ||
<LinkButton onClick={() => setIsBackupsDrawerOpen(true)}> | ||
Enable Linode Backups | ||
</StyledLinkButton>{' '} | ||
</LinkButton>{' '} | ||
to protect your data and recover quickly in an emergency. | ||
</Typography> | ||
<Box component="span" display="flex"> | ||
<StyledLinkButton | ||
aria-label="Dismiss notice enabling Linode backups" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong component. An |
||
onClick={handleDismiss} | ||
sx={{ lineHeight: '0.5rem', marginLeft: 12 }} | ||
> | ||
<Close /> | ||
</StyledLinkButton> | ||
</Box> | ||
<IconButton | ||
aria-label="Dismiss notice enabling Linode backups" | ||
onClick={handleDismiss} | ||
sx={{ padding: 1 }} | ||
> | ||
<Close /> | ||
</IconButton> | ||
<BackupDrawer | ||
onClose={() => setIsBackupsDrawerOpen(false)} | ||
open={isBackupsDrawerOpen} | ||
/> | ||
</StyledPaper> | ||
</Notice> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ export const VerificationDetailsBanner = ({ | |
} | ||
|
||
return ( | ||
<Notice important spacing={1} variant="warning"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to add spacing here, the child ( |
||
<Notice important variant="warning"> | ||
<Box | ||
alignItems="center" | ||
display="flex" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/ui": Changed | ||
--- | ||
|
||
Refactor and clean up `Notice` ([#11480](https://github.com/linode/manager/pull/11480)) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/ui": Removed | ||
--- | ||
|
||
`marketing` variant on `Notice` component ([#11480](https://github.com/linode/manager/pull/11480)) |
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.
Now that notices only have one test-id and this specific notice uses a custom test-id via props, this was the next best selector to use here.
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.
One unrelated observation: I noticed a console error on the Linode settings tab in both this branch and dev locally, but not in prod. Could this be fixed in this PR, or should we create a separate ticket for it?
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.
That does seem unrelated. Could you create a separate ticket?