1
+ import { styled } from '@mui/material' ;
1
2
import Stack from '@mui/material/Stack' ;
2
3
import { useSnackbar } from 'notistack' ;
3
4
import * as React from 'react' ;
@@ -16,6 +17,7 @@ import { TableRow } from 'src/components/TableRow';
16
17
import { TableRowError } from 'src/components/TableRowError/TableRowError' ;
17
18
import { TableRowLoading } from 'src/components/TableRowLoading/TableRowLoading' ;
18
19
import { Typography } from 'src/components/Typography' ;
20
+ import { useFlags } from 'src/hooks/useFlags' ;
19
21
import {
20
22
useAccountSettings ,
21
23
useMutateAccountSettings ,
@@ -32,7 +34,6 @@ import {
32
34
getTotalBackupsPrice ,
33
35
useEnableBackupsOnLinodesMutation ,
34
36
} from './utils' ;
35
- import { styled } from '@mui/material' ;
36
37
37
38
interface Props {
38
39
onClose : ( ) => void ;
@@ -43,6 +44,8 @@ export const BackupDrawer = (props: Props) => {
43
44
const { onClose, open } = props ;
44
45
const { enqueueSnackbar } = useSnackbar ( ) ;
45
46
47
+ const flags = useFlags ( ) ;
48
+
46
49
const {
47
50
data : linodes ,
48
51
error : linodesError ,
@@ -85,6 +88,13 @@ export const BackupDrawer = (props: Props) => {
85
88
86
89
const linodeCount = linodesWithoutBackups . length ;
87
90
91
+ const backupsConfirmationHelperText = (
92
+ < >
93
+ Confirm to add backups to{ ' ' }
94
+ < strong > { pluralize ( 'Linode' , 'Linodes' , linodeCount ) } </ strong > .
95
+ </ >
96
+ ) ;
97
+
88
98
const renderBackupsTable = ( ) => {
89
99
if ( linodesLoading || typesLoading || accountSettingsLoading ) {
90
100
return < TableRowLoading columns = { 3 } /> ;
@@ -138,7 +148,12 @@ all new Linodes will automatically be backed up.`
138
148
} ;
139
149
140
150
return (
141
- < Drawer onClose = { onClose } open = { open } title = "Enable All Backups" wide >
151
+ < Drawer
152
+ onClose = { onClose }
153
+ open = { open }
154
+ title = "Enable All Backups"
155
+ wide = { flags . dcSpecificPricing }
156
+ >
142
157
< Stack spacing = { 2 } >
143
158
< Typography variant = "body1" >
144
159
Three backup slots are executed and rotated automatically: a daily
@@ -147,7 +162,8 @@ all new Linodes will automatically be backed up.`
147
162
< Link to = "https://www.linode.com/docs/platform/disk-images/linode-backup-service/" >
148
163
guide on Backups
149
164
</ Link > { ' ' }
150
- for more information on features and limitations.
165
+ for more information on features and limitations.{ ' ' }
166
+ { ! flags . dcSpecificPricing ? backupsConfirmationHelperText : undefined }
151
167
</ Typography >
152
168
{ failedEnableBackupsCount > 0 && (
153
169
< Box >
@@ -168,9 +184,11 @@ all new Linodes will automatically be backed up.`
168
184
/>
169
185
) }
170
186
< StyledPricingBox >
171
- < Typography variant = "h2" >
172
- Total for { pluralize ( 'Linode' , 'Linodes' , linodeCount ) } :
173
- </ Typography >
187
+ { flags . dcSpecificPricing ? (
188
+ < StyledTypography variant = "h2" >
189
+ Total for { pluralize ( 'Linode' , 'Linodes' , linodeCount ) } :
190
+ </ StyledTypography >
191
+ ) : undefined }
174
192
175
193
< DisplayPrice
176
194
interval = "mo"
@@ -194,7 +212,9 @@ all new Linodes will automatically be backed up.`
194
212
< TableRow >
195
213
< TableCell > Label</ TableCell >
196
214
< TableCell > Plan</ TableCell >
197
- < TableCell > Region</ TableCell >
215
+ { flags . dcSpecificPricing ? (
216
+ < TableCell > Region</ TableCell >
217
+ ) : undefined }
198
218
< TableCell > Price</ TableCell >
199
219
</ TableRow >
200
220
</ TableHead >
@@ -205,10 +225,13 @@ all new Linodes will automatically be backed up.`
205
225
) ;
206
226
} ;
207
227
208
- const StyledPricingBox = styled ( Box , { label : 'StyledPricingBox' } ) (
228
+ const StyledPricingBox = styled ( Box , { label : 'StyledPricingBox' } ) ( ( { } ) => ( {
229
+ alignItems : 'center' ,
230
+ display : 'flex' ,
231
+ } ) ) ;
232
+
233
+ const StyledTypography = styled ( Typography , { label : 'StyledTypography' } ) (
209
234
( { theme } ) => ( {
210
- alignItems : 'center' ,
211
235
color : theme . palette . text . primary ,
212
- display : 'flex' ,
213
236
} )
214
237
) ;
0 commit comments