File tree 2 files changed +17
-11
lines changed
2 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ export default function EditResource({
102
102
return (
103
103
< div >
104
104
{ errors . map ( ( error , index ) => (
105
- < Alert key = { index } color = "danger" >
105
+ < Alert key = { index } color = "danger" dismissable = { true } >
106
106
{ error }
107
107
</ Alert >
108
108
) ) }
@@ -114,7 +114,9 @@ export default function EditResource({
114
114
return (
115
115
< div className = "edit-resource" >
116
116
{ successMessage . message && (
117
- < Alert color = { successMessage . color } > { successMessage . message } </ Alert >
117
+ < Alert color = { successMessage . color } dismissable = { true } >
118
+ { successMessage . message }
119
+ </ Alert >
118
120
) }
119
121
< div >
120
122
< h2 > Resource Propeties</ h2 >
Original file line number Diff line number Diff line change 1
- const Alert = ( { children, color } ) => {
1
+ // TODO: Make alerts dismissable on Bootstrap 5. Currently the dismiss feature
2
+ // only works on Bootstrap 2 sites (e.g., Admin).
3
+ const Alert = ( { children, color, dismissable = false } ) => {
2
4
return (
3
5
< div
4
6
className = { `alert alert-${ color } mt-3 alert-dismissible show` }
5
7
role = "alert"
6
8
>
7
9
{ children }
8
- < button
9
- type = "button"
10
- className = "close"
11
- data-dismiss = "alert"
12
- aria-label = "Close"
13
- >
14
- < span aria-hidden = "true" > ×</ span >
15
- </ button >
10
+ { dismissable && (
11
+ < button
12
+ type = "button"
13
+ className = "close"
14
+ data-dismiss = "alert"
15
+ aria-label = "Close"
16
+ >
17
+ < span aria-hidden = "true" > ×</ span >
18
+ </ button >
19
+ ) }
16
20
</ div >
17
21
) ;
18
22
} ;
You can’t perform that action at this time.
0 commit comments