mirror of
https://github.com/pheralb/svgl.git
synced 2025-02-06 06:58:04 +08:00
ref: remove unused imports
This commit is contained in:
parent
0d7bb0cf09
commit
b42afebd9d
@ -1,73 +1,70 @@
|
|||||||
import React from "react";
|
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Flex,
|
Flex,
|
||||||
useColorModeValue,
|
useColorModeValue,
|
||||||
HStack,
|
HStack,
|
||||||
Button,
|
|
||||||
Container,
|
Container,
|
||||||
Heading,
|
Heading,
|
||||||
Icon,
|
Icon,
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
Collapse,
|
Collapse,
|
||||||
Text,
|
} from '@chakra-ui/react'
|
||||||
} from "@chakra-ui/react";
|
import { ArrowSquareOut, MagnifyingGlass, Sticker, X } from 'phosphor-react'
|
||||||
import { ArrowSquareOut, MagnifyingGlass, Sticker, X } from "phosphor-react";
|
import Theme from './theme'
|
||||||
import Theme from "./theme";
|
import Tap from '@/animations/tap'
|
||||||
import Tap from "@/animations/tap";
|
import Mobile from './mobile'
|
||||||
import Mobile from "./mobile";
|
import { Links } from './links'
|
||||||
import { Links } from "./links";
|
import CustomLink from '@/common/link'
|
||||||
import CustomLink from "@/common/link";
|
import Categories from './categories'
|
||||||
import Categories from "./categories";
|
import Search from '@/components/search'
|
||||||
import Search from "@/components/search";
|
import CustomIconBtn from '@/common/iconBtn'
|
||||||
import CustomIconBtn from "@/common/iconBtn";
|
import { useHotkeys } from 'react-hotkeys-hook'
|
||||||
import { useHotkeys } from "react-hotkeys-hook";
|
|
||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
const bg = useColorModeValue("bg.light", "bg.dark");
|
const bg = useColorModeValue('bg.light', 'bg.dark')
|
||||||
const { isOpen, onToggle } = useDisclosure();
|
const { isOpen, onToggle } = useDisclosure()
|
||||||
useHotkeys("ctrl+k", (e) => {
|
useHotkeys('ctrl+k', (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault()
|
||||||
onToggle();
|
onToggle()
|
||||||
});
|
})
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box
|
<Box
|
||||||
as="header"
|
as='header'
|
||||||
position="sticky"
|
position='sticky'
|
||||||
top="0"
|
top='0'
|
||||||
bg={bg}
|
bg={bg}
|
||||||
borderBottomWidth="1px"
|
borderBottomWidth='1px'
|
||||||
w="full"
|
w='full'
|
||||||
py={6}
|
py={6}
|
||||||
zIndex={1}
|
zIndex={1}
|
||||||
shadow="sm"
|
shadow='sm'
|
||||||
>
|
>
|
||||||
<Container maxW={{ base: "full", md: "70%" }}>
|
<Container maxW={{ base: 'full', md: '70%' }}>
|
||||||
<Flex alignItems="center" justifyContent="space-between" mx="auto">
|
<Flex alignItems='center' justifyContent='space-between' mx='auto'>
|
||||||
<CustomLink href="/">
|
<CustomLink href='/'>
|
||||||
<Tap>
|
<Tap>
|
||||||
<HStack spacing={3} cursor="pointer">
|
<HStack spacing={3} cursor='pointer'>
|
||||||
<Sticker size={32} color="#4343e5" weight="bold" />
|
<Sticker size={32} color='#4343e5' weight='bold' />
|
||||||
<Heading fontSize="19px">svgl</Heading>
|
<Heading fontSize='19px'>svgl</Heading>
|
||||||
</HStack>
|
</HStack>
|
||||||
</Tap>
|
</Tap>
|
||||||
</CustomLink>
|
</CustomLink>
|
||||||
<HStack display="flex" alignItems="center" spacing={2}>
|
<HStack display='flex' alignItems='center' spacing={2}>
|
||||||
<Box display={{ base: "none", md: "inline-flex" }}>
|
<Box display={{ base: 'none', md: 'inline-flex' }}>
|
||||||
{Links.map((link) => (
|
{Links.map((link) => (
|
||||||
<CustomLink
|
<CustomLink
|
||||||
key={link.title}
|
key={link.title}
|
||||||
href={link.slug}
|
href={link.slug}
|
||||||
external={link.external}
|
external={link.external}
|
||||||
font="Inter-Semibold"
|
font='Inter-Semibold'
|
||||||
mr="4"
|
mr='4'
|
||||||
ml="3"
|
ml='3'
|
||||||
>
|
>
|
||||||
<Tap>
|
<Tap>
|
||||||
{link.title}
|
{link.title}
|
||||||
{link.external ? (
|
{link.external ? (
|
||||||
<Icon as={ArrowSquareOut} ml="2" />
|
<Icon as={ArrowSquareOut} ml='2' />
|
||||||
) : null}
|
) : null}
|
||||||
</Tap>
|
</Tap>
|
||||||
</CustomLink>
|
</CustomLink>
|
||||||
@ -76,10 +73,10 @@ const Header = () => {
|
|||||||
<HStack
|
<HStack
|
||||||
spacing={1}
|
spacing={1}
|
||||||
mr={1}
|
mr={1}
|
||||||
display={{ base: "none", md: "inline-flex" }}
|
display={{ base: 'none', md: 'inline-flex' }}
|
||||||
>
|
>
|
||||||
<CustomIconBtn
|
<CustomIconBtn
|
||||||
title="Toggle Search bar"
|
title='Toggle Search bar'
|
||||||
icon={
|
icon={
|
||||||
isOpen ? <X size={22} /> : <MagnifyingGlass size={22} />
|
isOpen ? <X size={22} /> : <MagnifyingGlass size={22} />
|
||||||
}
|
}
|
||||||
@ -87,37 +84,37 @@ const Header = () => {
|
|||||||
/>
|
/>
|
||||||
<Theme />
|
<Theme />
|
||||||
</HStack>
|
</HStack>
|
||||||
<Box display={{ base: "inline-flex", md: "none" }}>
|
<Box display={{ base: 'inline-flex', md: 'none' }}>
|
||||||
<Mobile />
|
<Mobile />
|
||||||
</Box>
|
</Box>
|
||||||
</HStack>
|
</HStack>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Collapse in={isOpen} animateOpacity>
|
<Collapse in={isOpen} animateOpacity>
|
||||||
<Box mt="3" display={{ base:"none", md:"block" }}>
|
<Box mt='3' display={{ base: 'none', md: 'block' }}>
|
||||||
<Search />
|
<Search />
|
||||||
</Box>
|
</Box>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
<Box mt="2" display={{ base: "block", md: "none" }}>
|
<Box mt='2' display={{ base: 'block', md: 'none' }}>
|
||||||
<Search />
|
<Search />
|
||||||
</Box>
|
</Box>
|
||||||
</Container>
|
</Container>
|
||||||
</Box>
|
</Box>
|
||||||
<Box p="4" overflowX="hidden" overflowY="auto">
|
<Box p='4' overflowX='hidden' overflowY='auto'>
|
||||||
<HStack
|
<HStack
|
||||||
justifyContent={{ base: "none", lg: "center" }}
|
justifyContent={{ base: 'none', lg: 'center' }}
|
||||||
flexWrap={{ base: "initial", lg: "wrap" }}
|
flexWrap={{ base: 'initial', lg: 'wrap' }}
|
||||||
spacing={4}
|
spacing={4}
|
||||||
overflowX="auto"
|
overflowX='auto'
|
||||||
overflowY="hidden"
|
overflowY='hidden'
|
||||||
bg={bg}
|
bg={bg}
|
||||||
pb="4"
|
pb='4'
|
||||||
borderBottomWidth="1px"
|
borderBottomWidth='1px'
|
||||||
>
|
>
|
||||||
<Categories />
|
<Categories />
|
||||||
</HStack>
|
</HStack>
|
||||||
</Box>
|
</Box>
|
||||||
</>
|
</>
|
||||||
);
|
)
|
||||||
};
|
}
|
||||||
|
|
||||||
export default Header;
|
export default Header
|
||||||
|
Loading…
x
Reference in New Issue
Block a user