mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-24 06:58:10 -05:00
* side layout initial * add elements to side nav * side buttons links * remove clog * calendar page initial * position sticky working * x trends page initial * new table * same mode selector * mobile friendly table * no underline for nav links * xsearch * x trends page outlined * sr initial * relocate calendar components * calendar fix flex * topnav fancier look * layout looking good edition * relocate xtrends * xtrends remove linecharts * x trends new * calender page new * delete headbanner, new login * remove calendar stuff from api * rename stuff in utils * fix user item margin * new home page initial * remove page concept * no pointer xtrends * remove xrank from app * xtrends service * move fa from app * move plus * maps tweaks * new table for plus history * navigational sidebar flex tweaks * builds page * analyzer * user page * free agents * plans * remove mx * tweaks * change layout to grid * home page finalized * mobile nav * restrict main content width * tweaks style * language switcher * container in css * sticky nav * use duplicate icons for now * change mapsketch width to old * chara tour vid * borzoic icons
50 lines
1.0 KiB
TypeScript
50 lines
1.0 KiB
TypeScript
import { Link as ChakraLink } from "@chakra-ui/react";
|
|
import { useMyTheme } from "hooks/common";
|
|
import NextLink from "next/link";
|
|
|
|
interface Props {
|
|
children: React.ReactNode;
|
|
href: string;
|
|
isExternal?: boolean;
|
|
prefetch?: boolean;
|
|
isColored?: boolean;
|
|
toNewWindow?: boolean;
|
|
noUnderline?: boolean;
|
|
}
|
|
|
|
const MyLink: React.FC<Props> = ({
|
|
children,
|
|
href,
|
|
isExternal,
|
|
prefetch = false,
|
|
isColored = true,
|
|
toNewWindow,
|
|
noUnderline,
|
|
}) => {
|
|
const { themeColorShade } = useMyTheme();
|
|
|
|
if (isExternal) {
|
|
return (
|
|
<ChakraLink
|
|
href={href}
|
|
color={isColored ? themeColorShade : undefined}
|
|
target={toNewWindow ? "_blank" : undefined}
|
|
>
|
|
{children}
|
|
</ChakraLink>
|
|
);
|
|
}
|
|
return (
|
|
<NextLink href={href} prefetch={prefetch ? undefined : false} passHref>
|
|
<ChakraLink
|
|
className={noUnderline ? "nounderline" : undefined}
|
|
color={isColored ? themeColorShade : undefined}
|
|
>
|
|
{children}
|
|
</ChakraLink>
|
|
</NextLink>
|
|
);
|
|
};
|
|
|
|
export default MyLink;
|