mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-24 02:05:25 +00:00
* sign up copy nits * first pass at new onboarding page * wip join onboard logic * refactor auth provider fetch logic * add member approval and invite link flag logic * update join request flow and remove jit logic * onboard guard * nits, onboard role check, invite link enabled check * fix bg color issue in onboarding page * refactor onboard UI * ui nits and more onboarding resource cards * revamp auth docs * change member approval default behavior and updated docs * merge prisma migrations * add id to resource card * feedback * feedback * feedback and fixed build * settings drop down UI nit * ui nits * handle join when max capacity case * add news data for member toggle * refactor for public access case * add iap bridge to onboard logic * fetch member approval req and invite link enabled flag on server * ui nits * fix invite link enable toggle snapping issue * ui nits * styling and ui nits, pass in invite id from server * add mcp resource in onboard step * get invite link in server * fix build issue * refactor docs on config * minor doc nit
29 lines
627 B
TypeScript
29 lines
627 B
TypeScript
'use client';
|
|
|
|
import { Redirect } from "@/app/components/redirect";
|
|
import { usePathname } from "next/navigation";
|
|
import { useMemo } from "react";
|
|
|
|
interface OnboardGuardProps {
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
export const OnboardGuard = ({ children }: OnboardGuardProps) => {
|
|
const pathname = usePathname();
|
|
|
|
const content = useMemo(() => {
|
|
if (!pathname.endsWith('/onboard')) {
|
|
return (
|
|
<Redirect
|
|
to={`/onboard`}
|
|
/>
|
|
)
|
|
} else {
|
|
return children;
|
|
}
|
|
}, [children, pathname]);
|
|
|
|
return content;
|
|
}
|
|
|
|
|