Skip to content

Commit

Permalink
fix: use link from react router
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-apprentice committed Nov 30, 2024
1 parent 1ee5f55 commit 128802d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/components/common/drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {
DrawerBody,
Text,
IconButton,
Link,
DrawerFooter,
Box,
} from '@chakra-ui/react'
import { HamburgerIcon } from '@chakra-ui/icons'
import { DiGithubAlt } from 'react-icons/di'
import { IconButtonCustom } from '../iconButton'
import React from 'react'
import { Link } from 'react-router-dom'

const SimpleDrawer: React.FC<{ isLogged: boolean }> = ({
isLogged,
Expand All @@ -40,13 +40,13 @@ const SimpleDrawer: React.FC<{ isLogged: boolean }> = ({
<DrawerHeader>Waifuland</DrawerHeader>

<DrawerBody>
<Link href="/">
<Link to="/">
<Text>Home</Text>
</Link>
<Link href="/docs">
<Link to="/docs">
<Text>Documentation</Text>
</Link>
<Link href="/images">
<Link to="/images">
<Text>Images</Text>
</Link>
</DrawerBody>
Expand Down
11 changes: 3 additions & 8 deletions src/components/common/link/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import { Box, Button, Link } from '@chakra-ui/react'
import { useNavigate } from 'react-router-dom'
import { Box, Button } from '@chakra-ui/react'
import { Link } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import React from 'react'

const ButtonLink: React.FC = (): React.ReactElement => {
const navigate = useNavigate()
const { t } = useTranslation()

return (
<Box mt={{ base: 2 }}>
<Link
onClick={() => {
navigate('/docs')
}}
>
<Link to="/docs">
<Button backgroundColor="red.200" color="gray.700">
{t('documentation.button')}
</Button>
Expand Down
12 changes: 8 additions & 4 deletions src/layout/header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Box, Link, Text } from '@chakra-ui/react'
import { useLocation } from 'react-router-dom'
import { Box, Text } from '@chakra-ui/react'
import { Link, useLocation } from 'react-router-dom'
import SimpleDrawer from '../../components/common/drawer'
import { MenuProfile } from '../../components/common/menu'
import { useCheckToken } from '../../hooks/checkToken'
Expand Down Expand Up @@ -29,8 +29,12 @@ const Header: React.FC<ImageProps> = ({
p={2}
>
<SimpleDrawer isLogged={useCheckToken()} />
<Link cursor={behaviorCursor} href={isHome}>
<Text color="gray.700" fontSize={{ base: 20 }}>
<Link to="/">
<Text
cursor={behaviorCursor}
fontSize={{ base: '40px' }}
color="gray.700"
>
Waifuland
</Text>
</Link>
Expand Down

0 comments on commit 128802d

Please sign in to comment.