Skip to content

Commit

Permalink
fix(LandingNav): rectify types error
Browse files Browse the repository at this point in the history
issue #82
  • Loading branch information
sabertazimi committed Aug 4, 2021
1 parent 4a7233f commit 512fef2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/LandingNav/LandingNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Routes } from '@config';
import { Close, Hamburger } from '@components/Icons';
import LandingNavLink from './LandingNavLink';

const LandingNav = () => {
const LandingNav = (): JSX.Element => {
const [expanded, setExpanded] = useState(false);

const handleClick = useCallback(() => {
Expand Down Expand Up @@ -37,7 +37,7 @@ const LandingNav = () => {
'cursor-pointer top-12 left-12 z-100'
)}
role="button"
tabIndex="0"
tabIndex={0}
onClick={handleClick}
onKeyDown={handleClick}
>
Expand Down
12 changes: 11 additions & 1 deletion src/components/LandingNav/LandingNavLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ import classNames from 'classnames';
import { Link } from 'gatsby';
import { Tooltip } from 'antd';

const LandingNavLink = ({ title = 'Tooltip', to = '/', children }) => (
interface Props {
title: string;
to: string;
children: React.ReactNode;
}

const LandingNavLink = ({
title = 'Tooltip',
to = '/',
children,
}: Props): JSX.Element => (
<Tooltip className="mb-16" placement="left" title={title}>
<Link to={to}>
<span
Expand Down

0 comments on commit 512fef2

Please sign in to comment.