@@ -9,14 +9,14 @@ import {
9
9
__experimentalVStack as VStack ,
10
10
__experimentalText as Text ,
11
11
Button ,
12
- Notice ,
13
12
} from '@wordpress/components' ;
14
13
import { useDispatch } from '@wordpress/data' ;
15
14
import { createInterpolateElement } from '@wordpress/element' ;
16
15
import { __ , sprintf } from '@wordpress/i18n' ;
17
16
import { store as noticesStore } from '@wordpress/notices' ;
18
17
import { useState } from 'react' ;
19
18
import { siteQuery , siteDefensiveModeQuery , siteDefensiveModeMutation } from '../../app/queries' ;
19
+ import Notice from '../../components/notice' ;
20
20
import PageLayout from '../../components/page-layout' ;
21
21
import SettingsPageHeader from '../settings-page-header' ;
22
22
import type { DefensiveModeSettingsUpdate , Site } from '../../data/types' ;
@@ -120,42 +120,46 @@ export default function DefensiveModeSettings( { siteSlug }: { siteSlug: string
120
120
} ;
121
121
122
122
return (
123
- < Notice status = "success" isDismissible = { false } >
124
- < Text as = "p" > { __ ( 'Defensive mode is enabled' ) } </ Text >
123
+ < Notice
124
+ variant = "success"
125
+ title = { __ ( 'Defensive mode is enabled' ) }
126
+ actions = {
127
+ ! enabled_by_a11n && (
128
+ < Button
129
+ variant = "primary"
130
+ type = "submit"
131
+ isBusy = { isPending }
132
+ disabled = { isPending }
133
+ onClick = { handleDisable }
134
+ >
135
+ { __ ( 'Disable' ) }
136
+ </ Button >
137
+ )
138
+ }
139
+ >
140
+ < VStack >
141
+ { enabled_by_a11n && (
142
+ < Text as = "p" >
143
+ { createInterpolateElement (
144
+ __ (
145
+ 'We’ve enabled defensive mode to protect your site. <link>Contact a Happiness Engineer</link> if you need assistance.'
146
+ ) ,
147
+ {
148
+ // @ts -expect-error children prop is injected by createInterpolateElement
149
+ link : < ExternalLink href = "/help/contact" /> ,
150
+ }
151
+ ) }
152
+ </ Text >
153
+ ) }
125
154
126
- { enabled_by_a11n && (
127
155
< Text as = "p" >
128
- { createInterpolateElement (
129
- __ (
130
- 'We’ve enabled defensive mode to protect your site. <link>Contact a Happiness Engineer</link> if you need assistance.'
131
- ) ,
132
- {
133
- // @ts -expect-error children prop is injected by createInterpolateElement
134
- link : < ExternalLink href = "/help/contact" /> ,
135
- }
156
+ { sprintf (
157
+ // translators: %s: timestamp, e.g. May 27, 2025 11:02 AM
158
+ __ ( 'This will be automatically disabled on %s.' ) ,
159
+ enabledUntil
136
160
) }
137
161
</ Text >
138
- ) }
139
-
140
- < Text as = "p" >
141
- { sprintf (
142
- // translators: %s: timestamp, e.g. May 27, 2025 11:02 AM
143
- __ ( 'This will be automatically disabled on %s.' ) ,
144
- enabledUntil
145
- ) }
146
- </ Text >
147
-
148
- { ! enabled_by_a11n && (
149
- < Button
150
- variant = "primary"
151
- type = "submit"
152
- isBusy = { isPending }
153
- disabled = { isPending }
154
- onClick = { handleDisable }
155
- >
156
- { __ ( 'Disable' ) }
157
- </ Button >
158
- ) }
162
+ </ VStack >
159
163
</ Notice >
160
164
) ;
161
165
} ;
@@ -171,9 +175,7 @@ export default function DefensiveModeSettings( { siteSlug }: { siteSlug: string
171
175
172
176
return (
173
177
< VStack spacing = { 8 } >
174
- < Notice status = "info" isDismissible = { false } >
175
- < Text > { __ ( 'Defensive mode is disabled' ) } </ Text >
176
- </ Notice >
178
+ < Notice > { __ ( 'Defensive mode is disabled.' ) } </ Notice >
177
179
< Card >
178
180
< CardBody >
179
181
< VStack spacing = { 8 } style = { { padding : '8px 0' } } >
0 commit comments