From 5c65dd3ab37b37f27044c8787fbc374c1211904e Mon Sep 17 00:00:00 2001 From: sunface Date: Wed, 3 Mar 2021 20:53:16 +0800 Subject: [PATCH] update responsive features --- layouts/nav/editor-nav.tsx | 6 +-- layouts/nav/nav.tsx | 6 +-- layouts/nav/post-nav.tsx | 2 +- layouts/nav/vertical-nav.tsx | 17 +++++++-- layouts/page-container1.tsx | 9 +++-- layouts/sidebar/sidebar-link.tsx | 10 ++--- layouts/sidebar/sidebar.tsx | 51 ++++++++++++------------- pages/[username]/[post_id].tsx | 51 +++++++++++++------------ pages/[username]/index.tsx | 15 ++++---- pages/admin/tag/[id].tsx | 8 ++-- pages/admin/tags.tsx | 7 ++-- pages/editor/posts.tsx | 7 ++-- pages/index.tsx | 4 +- pages/tags.tsx | 24 ------------ pages/tags/[name].tsx | 6 +-- pages/tags/index.tsx | 25 ++++++++++++ src/components/card.tsx | 2 +- src/components/comments/comment.tsx | 17 +++++---- src/components/comments/reply.tsx | 15 +++++--- src/components/empty.tsx | 13 +++++++ src/components/posts/post-card.tsx | 2 +- src/components/posts/text-post-card.tsx | 13 ++++--- src/components/svg-icon.tsx | 24 ++++++++++++ src/data/links.tsx | 15 +++----- 24 files changed, 201 insertions(+), 148 deletions(-) delete mode 100644 pages/tags.tsx create mode 100644 pages/tags/index.tsx create mode 100644 src/components/empty.tsx create mode 100644 src/components/svg-icon.tsx diff --git a/layouts/nav/editor-nav.tsx b/layouts/nav/editor-nav.tsx index 922370e7..f6201d24 100644 --- a/layouts/nav/editor-nav.tsx +++ b/layouts/nav/editor-nav.tsx @@ -47,8 +47,8 @@ function HeaderContent(props: Props) { return ( <> - - + + @@ -61,7 +61,7 @@ function HeaderContent(props: Props) { - + - + */} - + {/* */} ) } diff --git a/layouts/nav/post-nav.tsx b/layouts/nav/post-nav.tsx index 53d352f4..a651e092 100644 --- a/layouts/nav/post-nav.tsx +++ b/layouts/nav/post-nav.tsx @@ -40,7 +40,7 @@ function HeaderContent() { - - {navLinks.map(link => {link.title})} + + {navLinks.map(link => + + + {link.icon}{link.title} + + + )} diff --git a/layouts/page-container1.tsx b/layouts/page-container1.tsx index bb597966..fe47742e 100644 --- a/layouts/page-container1.tsx +++ b/layouts/page-container1.tsx @@ -1,4 +1,4 @@ -import { Badge, Box, chakra,Flex,PropsOf } from "@chakra-ui/react" +import { Badge, Box, chakra,Flex,PropsOf, useMediaQuery } from "@chakra-ui/react" import { SkipNavContent, SkipNavLink } from "@chakra-ui/skip-nav" import Container from "components/container" import Footer from "./footer" @@ -34,7 +34,8 @@ type PageContainerProps = PropsOf & { function PageContainer1(props: PageContainerProps) { const { children ,nav, ...rest} = props useHeadingFocusOnRouteChange() - + const [isSmallScreen] = useMediaQuery("(max-width: 768px)") + const header = isSmallScreen ?