feat: add personal project list, add project settings, etc

This commit is contained in:
2024-02-24 03:55:50 +00:00
parent 49b80a2f4c
commit 751210c819
31 changed files with 877 additions and 148 deletions
+17 -8
View File
@@ -9,15 +9,24 @@ type LinkProps = {
children?: React.ReactNode;
};
const Link = ({ asChild, href, ...props }: LinkProps) => {
const pageContext = usePageContext();
const { urlPathname } = pageContext;
const Comp = asChild ? Slot : "a";
const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(
({ asChild, href, ...props }, ref) => {
const pageContext = usePageContext();
const { urlPathname } = pageContext;
const Comp = asChild ? Slot : "a";
const isActive =
href === "/" ? urlPathname === href : urlPathname.startsWith(href!);
const isActive =
href === "/" ? urlPathname === href : urlPathname.startsWith(href!);
return <Comp data-active={isActive || undefined} href={href} {...props} />;
};
return (
<Comp
ref={ref}
data-active={isActive || undefined}
href={href}
{...props}
/>
);
}
);
export default Link;