Skip to content

Commit

Permalink
⚒️ Fix layout & responsive.
Browse files Browse the repository at this point in the history
  • Loading branch information
pheralb committed Jun 28, 2022
1 parent 17b36d7 commit 8ec5735
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 22 deletions.
12 changes: 7 additions & 5 deletions src/components/svgInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,30 @@ const SVGInfo = (props: SVGCardProps) => {
<Heading mt={6} mb={6} fontSize="4xl">
{props.title}
</Heading>
<HStack spacing={4}>
<Flex direction={{ base: "column", md: "row" }}>
<Button
variant="ghost"
borderWidth="1px"
leftIcon={<Copy />}
onClick={() => copyToClipboard(props.slug)}
mb={{ base: "2", md: "0" }}
mr={{ base: "0", md: "3" }}
>
Copy to clipboard
</Button>
<Button
mb={{ base: "2", md: "0" }}
leftIcon={<DownloadSimple />}
variant="primary"
mr="2"
onClick={() => downloadSvg(props.slug)}
mb={{ base: "2", md: "0" }}
mr={{ base: "0", md: "3" }}
>
Download .svg
</Button>
<Link href={props.url} isExternal={true}>
{props.title} website <Icon as={ArrowSquareOut} ml="1" />
{props.title} website <Icon as={ArrowSquareOut} mt="2" />
</Link>
</HStack>
</Flex>
</Flex>
);
};
Expand Down
31 changes: 20 additions & 11 deletions src/layout/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const Header = () => {
return (
<>
<Box
as="header"
position="sticky"
top="0"
bg={bg}
Expand Down Expand Up @@ -68,7 +69,9 @@ const Header = () => {
))}
<CustomIconBtn
title="Toggle Search bar"
icon={isOpen ? <X size={22} /> : <MagnifyingGlass size={22} />}
icon={
isOpen ? <X size={22} /> : <MagnifyingGlass size={22} />
}
onClick={onToggle}
/>
<Theme />
Expand All @@ -83,18 +86,24 @@ const Header = () => {
<Search />
</Box>
</Collapse>
<Box mt="2" display={{ base: "block", md: "none" }}>
<Search />
</Box>
</Container>
</Box>
<HStack
justifyContent="center"
p="4"
spacing={4}
overflowY="hidden"
bg={bg}
borderBottomWidth="1px"
>
<Categories />
</HStack>
<Box p="4" overflowX="hidden" overflowY="auto">
<HStack
justifyContent={{ base: "none", md: "center" }}
spacing={4}
overflowX="auto"
overflowY="hidden"
bg={bg}
pb="4"
borderBottomWidth="1px"
>
<Categories />
</HStack>
</Box>
</>
);
};
Expand Down
5 changes: 3 additions & 2 deletions src/layout/header/mobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ const Mobile = () => {
right={0}
display={mobileNav.isOpen ? "flex" : "none"}
flexDirection="column"
p={2}
p={4}
pb={4}
m={2}
bg={bg}
spacing={3}
rounded="sm"
shadow="sm"
borderWidth="1px"
zIndex={2}
>
<CloseButton aria-label="Close menu" onClick={mobileNav.onClose} />
{Links.map((link) => (
Expand Down
2 changes: 1 addition & 1 deletion src/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Index = ({ children }: LayoutProps) => {
return (
<>
<Header />
<Container maxW="70%" mt="5">{children}</Container>
<Container maxW={{ base: "100%", md: "70%" }} mt={{ base: "1", md: "3" }}>{children}</Container>
<Footer />
</>
);
Expand Down
4 changes: 1 addition & 3 deletions src/pages/category/[category].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ export default function Category() {
</Head>
<Show>
<Center>
<Heading mt="4" mb="5">
{router.query.category}
</Heading>
<Heading mb="5">{router.query.category}</Heading>
</Center>
</Show>

Expand Down

0 comments on commit 8ec5735

Please sign in to comment.