Skip to content

Commit b178c7d

Browse files
fix(banner-notification): default content alignment to center
1 parent 8d0f7e1 commit b178c7d

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

src/components/BannerNotification.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react"
2-
import { Flex, FlexProps, useMediaQuery } from "@chakra-ui/react"
2+
import { Center, FlexProps, useMediaQuery } from "@chakra-ui/react"
33
import { lightTheme as oldTheme } from "../theme"
44

55
export interface IProps extends FlexProps {
@@ -15,7 +15,7 @@ const BannerNotification: React.FC<IProps> = ({
1515
return (
1616
<>
1717
{shouldShow && (
18-
<Flex
18+
<Center
1919
maxW={isLGScreen ? oldTheme.variables.maxPageWidth : "100%"}
2020
w="100%"
2121
py="4"
@@ -30,7 +30,7 @@ const BannerNotification: React.FC<IProps> = ({
3030
{...props}
3131
>
3232
{children}
33-
</Flex>
33+
</Center>
3434
)}
3535
</>
3636
)

src/components/Banners/PostMergeBanner.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ import BannerNotification from "../BannerNotification"
33
import Translation from "../Translation"
44

55
import { TranslationKey } from "../../utils/translations"
6-
import { Center, Text } from "@chakra-ui/react"
6+
import { Text } from "@chakra-ui/react"
77

88
export interface IProps {
99
translationString: TranslationKey
1010
}
1111

1212
const PostMergeBanner: React.FC<IProps> = ({ translationString }) => (
13-
<Center
14-
as={BannerNotification}
13+
<BannerNotification
1514
shouldShow={true}
1615
zIndex={1}
1716
textAlign="center"
@@ -24,7 +23,7 @@ const PostMergeBanner: React.FC<IProps> = ({ translationString }) => (
2423
<Text maxW="100ch" m={0} p={0}>
2524
<Translation id={translationString} />
2625
</Text>
27-
</Center>
26+
</BannerNotification>
2827
)
2928

3029
export default PostMergeBanner

src/components/UpgradeBannerNotification.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@ import Emoji from "./Emoji"
55
import Link from "./Link"
66

77
const UpgradeBannerNotification: React.FC = () => (
8-
<BannerNotification justifyContent="center" shouldShow>
9-
<Emoji
10-
text=":megaphone:"
11-
alignSelf="center"
12-
mr={4}
13-
fontSize="2xl"
14-
flexShrink="0"
15-
/>
8+
<BannerNotification shouldShow>
9+
<Emoji text=":megaphone:" mr={4} fontSize="2xl" flexShrink="0" />
1610
<Box>
1711
<b>We've deprecated our use of 'Eth1' and 'Eth2' terms.</b>{" "}
1812
<Link to="https://blog.ethereum.org/2022/01/24/the-great-eth2-renaming/">

0 commit comments

Comments
 (0)