diff --git a/client/package.json b/client/package.json index 891e1453..d0fb7643 100644 --- a/client/package.json +++ b/client/package.json @@ -20,6 +20,7 @@ "@radix-ui/react-icons": "1.3.0", "@radix-ui/react-label": "2.1.0", "@radix-ui/react-popover": "1.1.2", + "@radix-ui/react-radio-group": "1.2.1", "@radix-ui/react-scroll-area": "1.2.0", "@radix-ui/react-select": "2.1.2", "@radix-ui/react-separator": "1.1.0", diff --git a/client/src/app/layout.tsx b/client/src/app/layout.tsx index 737ab4fd..664f8596 100644 --- a/client/src/app/layout.tsx +++ b/client/src/app/layout.tsx @@ -39,9 +39,7 @@ export default async function RootLayout({ -
- {children} -
+
{children}
diff --git a/client/src/app/projects/new/page.tsx b/client/src/app/projects/new/page.tsx new file mode 100644 index 00000000..f12ed111 --- /dev/null +++ b/client/src/app/projects/new/page.tsx @@ -0,0 +1,25 @@ +import { + dehydrate, + HydrationBoundary, + QueryClient, +} from "@tanstack/react-query"; + +import { client } from "@/lib/query-client"; +import { queryKeys } from "@/lib/query-keys"; + +import CreateCustomProject from "@/containers/projects/new"; + +export default async function CreateCustomProjectPage() { + const queryClient = new QueryClient(); + + await queryClient.prefetchQuery({ + queryKey: queryKeys.projects.countries.queryKey, + queryFn: () => client.projects.getProjectCountries.query(), + }); + + return ( + + + + ); +} diff --git a/client/src/app/projects/store.ts b/client/src/app/projects/store.ts new file mode 100644 index 00000000..11df0e83 --- /dev/null +++ b/client/src/app/projects/store.ts @@ -0,0 +1,17 @@ +import { useForm } from "react-hook-form"; + +import { atom } from "jotai/index"; + +import { CreateCustomProjectForm } from "@/containers/projects/form/setup"; + +export const projectFormState = atom<{ + setup: ReturnType> | null; + // todo: define schema + assumptions: ReturnType | null; + // todo: define schema + costInputsOverrides: ReturnType | null; +}>({ + setup: null, + assumptions: null, + costInputsOverrides: null, +}); diff --git a/client/src/components/ui/form.tsx b/client/src/components/ui/form.tsx index d5fcbe2e..20125513 100644 --- a/client/src/components/ui/form.tsx +++ b/client/src/components/ui/form.tsx @@ -16,6 +16,7 @@ import { Slot } from "@radix-ui/react-slot"; import { cn } from "@/lib/utils"; +import InfoButton from "@/components/ui/info-button"; import { Label } from "@/components/ui/label"; const Form = FormProvider; @@ -91,10 +92,29 @@ FormItem.displayName = "FormItem"; const FormLabel = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => { + React.ComponentPropsWithoutRef & { + tooltip?: { + title: string; + content: React.ReactNode; + }; + } +>(({ className, tooltip, ...props }, ref) => { const { error, formItemId } = useFormField(); + if (tooltip) { + return ( +
+
+ ); + } + return (