1- import { MouseEvent , useCallback } from "react" ;
1+ import { type MouseEvent , useCallback } from "react" ;
22import { Box , Container , Flex , NavLink } from "theme-ui" ;
33
44import { Logo } from "./logo" ;
55
6- const MenuLink : React . FC < { href : string } > = ( { href, children } ) => {
6+ type LinkComponent = React . FC < { href : string ; children : React . ReactNode } > ;
7+
8+ const MenuLink : LinkComponent = ( { href, children } ) => {
79 const goToSection = useCallback (
810 ( e : MouseEvent ) => {
911 e . preventDefault ( ) ;
@@ -26,7 +28,8 @@ const MenuLink: React.FC<{ href: string }> = ({ href, children }) => {
2628 return (
2729 < NavLink
2830 sx = { {
29- background : `linear-gradient(0deg, #fff .2rem,transparent 0) no-repeat 50%` ,
31+ background :
32+ "linear-gradient(0deg, #fff .2rem,transparent 0) no-repeat 50%" ,
3033 transition : "background-size .3s cubic-bezier(.165,.84,.44,1)" ,
3134 backgroundSize : "0 100%" ,
3235 p : ".4rem" ,
@@ -44,7 +47,7 @@ const MenuLink: React.FC<{ href: string }> = ({ href, children }) => {
4447 ) ;
4548} ;
4649
47- const MenuButton : React . FC < { href : string } > = ( { children, href } ) => (
50+ const MenuButton : LinkComponent = ( { children, href } ) => (
4851 < Box
4952 sx = { {
5053 perspective : "24rem" ,
@@ -77,10 +80,7 @@ const MenuButton: React.FC<{ href: string }> = ({ children, href }) => (
7780 </ Box >
7881) ;
7982
80- export const ContentButton : React . FC < { href : string } > = ( {
81- children,
82- href,
83- } ) => (
83+ export const ContentButton : LinkComponent = ( { children, href } ) => (
8484 < Box
8585 sx = { {
8686 perspective : "24rem" ,
0 commit comments