Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing button to change the text and url depend on the size of the screen #2836

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 30 additions & 9 deletions workspaces/website/src/blocks/HomepageHero.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import { Box, Flex, Img, Stack } from "@chakra-ui/react";
import {
Box,
Flex,
Img,
Stack,
useTheme,
useMediaQuery,
} from "@chakra-ui/react";
import { Button } from "@ui/Button";
import { Heading } from "@ui/Typography/Heading";
import { Text } from "@ui/Typography/Text";
Expand All @@ -12,6 +19,14 @@ type Props = {
};

export const HomepageHero = ({ seo }: Props) => {
const theme = useTheme();
const breakpoints = theme.breakpoints;
const { md } = breakpoints;
const [isLargerThanSm] = useMediaQuery(`(min-width: ${md})`, {
ssr: true,
fallback: false,
});

return (
<>
<ProvisionsPopup />
Expand Down Expand Up @@ -129,18 +144,24 @@ export const HomepageHero = ({ seo }: Props) => {
<Button
size="lg"
variant="secondaryHero"
href="https://starkgate.starknet.io/"
target="_blank"
display={!isLargerThanSm ? "flex" : "none"}
href={"/en/what-is-starknet"}
target={"_blank"}
>
{"Explore Starknet"}
</Button>
<Button
size="lg"
display={isLargerThanSm ? "flex" : "none"}
variant="secondaryHero"
href={"https://starkgate.starknet.io/"}
target={"_blank"}
>
Bridge
{"Bridge"}
</Button>
</Stack>
</Box>
<Box
zIndex={0}
order={{ base: 0, lg: 1 }}
// boxSize={{ base: "20", lg: "8" }}
/>
<Box zIndex={0} order={{ base: 0, lg: 1 }} />
<Img
position="relative"
marginRight={{
Expand Down
Loading