diff --git a/client/next.config.js b/client/next.config.js index b9c6440d..fbdea080 100644 --- a/client/next.config.js +++ b/client/next.config.js @@ -13,6 +13,15 @@ const nextConfig = { ], }, output: 'standalone', + async redirects() { + return [ + { + source: '/auth', + destination: '/auth/details', + permanent: true, + }, + ]; + }, }; module.exports = withPlugins( diff --git a/client/src/constants/nav.ts b/client/src/constants/nav.ts index 27176617..57b6d397 100644 --- a/client/src/constants/nav.ts +++ b/client/src/constants/nav.ts @@ -1,4 +1,15 @@ -export const NAV = [ +type NavItem = { + label: string; + href: string; + filled?: boolean; + target?: string; + rel?: string; + className?: string; + auth?: boolean; + footer?: boolean; +}; + +export const NAV: NavItem[] = [ { label: 'Home', href: '/', @@ -37,11 +48,26 @@ export const NAV = [ { label: 'Log In', href: '/auth/signin', - className: 'border border-grey-0 rounded-lg !bg-white', + className: 'border border-grey-0 rounded-lg bg-white', auth: true, }, ]; +export const NAV_AUTH: NavItem[] = [ + { + label: 'My details', + href: '/auth/details', + }, + { + label: 'My projects', + href: '/auth/projects', + }, + { + label: 'My investments', + href: '/auth/investments', + }, +]; + export const POLICIES = [ { label: 'Privacy policy', diff --git a/client/src/containers/my-projects/constants.ts b/client/src/containers/auth/projects/constants.ts similarity index 100% rename from client/src/containers/my-projects/constants.ts rename to client/src/containers/auth/projects/constants.ts diff --git a/client/src/containers/my-projects/form/form.test.tsx b/client/src/containers/auth/projects/form/form.test.tsx similarity index 100% rename from client/src/containers/my-projects/form/form.test.tsx rename to client/src/containers/auth/projects/form/form.test.tsx diff --git a/client/src/containers/my-projects/form/index.tsx b/client/src/containers/auth/projects/form/index.tsx similarity index 100% rename from client/src/containers/my-projects/form/index.tsx rename to client/src/containers/auth/projects/form/index.tsx diff --git a/client/src/containers/my-projects/form/label.tsx b/client/src/containers/auth/projects/form/label.tsx similarity index 100% rename from client/src/containers/my-projects/form/label.tsx rename to client/src/containers/auth/projects/form/label.tsx diff --git a/client/src/containers/my-projects/form/legend.tsx b/client/src/containers/auth/projects/form/legend.tsx similarity index 100% rename from client/src/containers/my-projects/form/legend.tsx rename to client/src/containers/auth/projects/form/legend.tsx diff --git a/client/src/containers/my-projects/form/steps/contact-details/index.tsx b/client/src/containers/auth/projects/form/steps/contact-details/index.tsx similarity index 100% rename from client/src/containers/my-projects/form/steps/contact-details/index.tsx rename to client/src/containers/auth/projects/form/steps/contact-details/index.tsx diff --git a/client/src/containers/my-projects/form/steps/contact-details/primary-office-country.tsx b/client/src/containers/auth/projects/form/steps/contact-details/primary-office-country.tsx similarity index 93% rename from client/src/containers/my-projects/form/steps/contact-details/primary-office-country.tsx rename to client/src/containers/auth/projects/form/steps/contact-details/primary-office-country.tsx index 2be581ee..e818e4fc 100644 --- a/client/src/containers/my-projects/form/steps/contact-details/primary-office-country.tsx +++ b/client/src/containers/auth/projects/form/steps/contact-details/primary-office-country.tsx @@ -6,7 +6,7 @@ import { Field as FieldRFF } from 'react-final-form'; import { useSubGeographics } from 'hooks/geographics'; -import { ProjectSchema } from 'containers/my-projects/form/validations'; +import { ProjectSchema } from 'containers/auth/projects/form/validations'; import { Select } from 'components/forms'; diff --git a/client/src/containers/my-projects/form/steps/contact-details/primary-office-state.tsx b/client/src/containers/auth/projects/form/steps/contact-details/primary-office-state.tsx similarity index 95% rename from client/src/containers/my-projects/form/steps/contact-details/primary-office-state.tsx rename to client/src/containers/auth/projects/form/steps/contact-details/primary-office-state.tsx index c937935f..3a8e2087 100644 --- a/client/src/containers/my-projects/form/steps/contact-details/primary-office-state.tsx +++ b/client/src/containers/auth/projects/form/steps/contact-details/primary-office-state.tsx @@ -6,7 +6,7 @@ import { Field as FieldRFF, useForm, useFormState } from 'react-final-form'; import { useSubGeographics } from 'hooks/geographics'; -import { ProjectSchema } from 'containers/my-projects/form/validations'; +import { ProjectSchema } from 'containers/auth/projects/form/validations'; import { Select } from 'components/forms'; diff --git a/client/src/containers/my-projects/form/steps/project-details/demographics.tsx b/client/src/containers/auth/projects/form/steps/project-details/demographics.tsx similarity index 93% rename from client/src/containers/my-projects/form/steps/project-details/demographics.tsx rename to client/src/containers/auth/projects/form/steps/project-details/demographics.tsx index 0973c02e..14d817d7 100644 --- a/client/src/containers/my-projects/form/steps/project-details/demographics.tsx +++ b/client/src/containers/auth/projects/form/steps/project-details/demographics.tsx @@ -6,7 +6,7 @@ import { Field as FieldRFF } from 'react-final-form'; import { useDemographics } from 'hooks/demographics'; -import { ProjectSchema } from 'containers/my-projects/form/validations'; +import { ProjectSchema } from 'containers/auth/projects/form/validations'; import { MultiSelect, Select } from 'components/forms'; diff --git a/client/src/containers/my-projects/form/steps/project-details/index.tsx b/client/src/containers/auth/projects/form/steps/project-details/index.tsx similarity index 100% rename from client/src/containers/my-projects/form/steps/project-details/index.tsx rename to client/src/containers/auth/projects/form/steps/project-details/index.tsx diff --git a/client/src/containers/my-projects/form/steps/project-details/legal-status.tsx b/client/src/containers/auth/projects/form/steps/project-details/legal-status.tsx similarity index 93% rename from client/src/containers/my-projects/form/steps/project-details/legal-status.tsx rename to client/src/containers/auth/projects/form/steps/project-details/legal-status.tsx index 84e41e79..131bccfc 100644 --- a/client/src/containers/my-projects/form/steps/project-details/legal-status.tsx +++ b/client/src/containers/auth/projects/form/steps/project-details/legal-status.tsx @@ -6,7 +6,7 @@ import { Field as FieldRFF } from 'react-final-form'; import { useProjectLegalStatuses } from 'hooks/project-legal-statuses'; -import { ProjectSchema } from 'containers/my-projects/form/validations'; +import { ProjectSchema } from 'containers/auth/projects/form/validations'; import { Select } from 'components/forms'; diff --git a/client/src/containers/my-projects/form/validations.ts b/client/src/containers/auth/projects/form/validations.ts similarity index 100% rename from client/src/containers/my-projects/form/validations.ts rename to client/src/containers/auth/projects/form/validations.ts diff --git a/client/src/containers/my-projects/form/wrapper.tsx b/client/src/containers/auth/projects/form/wrapper.tsx similarity index 100% rename from client/src/containers/my-projects/form/wrapper.tsx rename to client/src/containers/auth/projects/form/wrapper.tsx diff --git a/client/src/containers/my-projects/new/header.tsx b/client/src/containers/auth/projects/new/header.tsx similarity index 100% rename from client/src/containers/my-projects/new/header.tsx rename to client/src/containers/auth/projects/new/header.tsx diff --git a/client/src/containers/my-projects/new/index.tsx b/client/src/containers/auth/projects/new/index.tsx similarity index 52% rename from client/src/containers/my-projects/new/index.tsx rename to client/src/containers/auth/projects/new/index.tsx index 1630e024..bb0c367b 100644 --- a/client/src/containers/my-projects/new/index.tsx +++ b/client/src/containers/auth/projects/new/index.tsx @@ -39,7 +39,7 @@ export default function NewProject() { }); }, onSuccess: () => { - push('/my-projects/new?step=investments'); + push('/projects/new?step=investments'); }, }); @@ -53,48 +53,46 @@ export default function NewProject() { }, [mutation]); return ( -