5
5
AlertTitle ,
6
6
Box ,
7
7
CloseButton ,
8
+ Container ,
8
9
useDisclosure ,
9
10
} from '@chakra-ui/react'
10
11
@@ -16,34 +17,41 @@ export const Banner = ({ title, description, children }) => {
16
17
} = useDisclosure ( { defaultIsOpen : true } )
17
18
18
19
return isVisible ? (
19
- < Box pt = { 16 } px = { 20 } >
20
- < Alert
21
- status = 'info'
22
- variant = 'solid'
23
- alignItems = 'flex-start' // Align icon nicely with multi-line text
24
- >
25
- < AlertIcon />
26
- < Box flex = '1' ml = { 3 } >
27
- { ' ' }
28
- { /* Container for text content, allows vertical flow */ }
29
- < AlertTitle > { title } </ AlertTitle >
30
- { description && (
31
- < AlertDescription mt = { 1 } > { description } </ AlertDescription >
32
- ) }
33
- < Box mt = { 2 } >
20
+ < Box pt = { 16 } >
21
+ { ' ' }
22
+ { /* This Box provides top padding to clear the header */ }
23
+ < Container maxW = 'container.lg' >
24
+ { ' ' }
25
+ { /* Constrains the width of the banner */ }
26
+ < Alert
27
+ status = 'info'
28
+ variant = 'solid'
29
+ alignItems = 'flex-start' // Align icon nicely with multi-line text
30
+ borderRadius = 'md' // Added rounded corners
31
+ >
32
+ < AlertIcon />
33
+ < Box flex = '1' ml = { 3 } >
34
34
{ ' ' }
35
- { /* Wrapper for children, e.g., links */ }
36
- { children }
35
+ { /* Container for text content, allows vertical flow */ }
36
+ < AlertTitle > { title } </ AlertTitle >
37
+ { description && (
38
+ < AlertDescription mt = { 1 } > { description } </ AlertDescription >
39
+ ) }
40
+ < Box mt = { 2 } >
41
+ { ' ' }
42
+ { /* Wrapper for children, e.g., links */ }
43
+ { children }
44
+ </ Box >
37
45
</ Box >
38
- </ Box >
39
- < CloseButton
40
- position = 'absolute' // Position absolutely within the Alert
41
- alignSelf = 'flex-start'
42
- right = '8px' // Adjust as needed
43
- top = '8px' // Adjust as needed
44
- onClick = { onClose }
45
- / >
46
- </ Alert >
46
+ < CloseButton
47
+ position = 'absolute' // Position absolutely within the Alert
48
+ alignSelf = 'flex-start'
49
+ right = '8px' // Adjust as needed
50
+ top = '8px' // Adjust as needed
51
+ onClick = { onClose }
52
+ />
53
+ </ Alert >
54
+ </ Container >
47
55
</ Box >
48
56
) : (
49
57
< > </ >
0 commit comments