mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-30 01:48:13 +00:00
fixes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { AppShell } from '@mantine/core';
|
||||
import { useDisclosure } from '@mantine/hooks';
|
||||
import { AppShell } from "@mantine/core";
|
||||
import { useDisclosure } from "@mantine/hooks";
|
||||
import {
|
||||
IconArrowsExchange,
|
||||
IconBell,
|
||||
@@ -17,62 +17,170 @@ import {
|
||||
IconTruck,
|
||||
IconUserCircle,
|
||||
IconUsers,
|
||||
} from '@tabler/icons-react';
|
||||
import { Outlet, useLocation, useNavigate } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { notify, AppHeader, AppSidebar } from '@ema-platform/ui';
|
||||
import type { NavItem } from '@ema-platform/ui';
|
||||
import { logout } from '@ema-platform/auth';
|
||||
import { SUPPORTED_LANGUAGES } from '../i18n/config';
|
||||
import { useAppSelector } from '../store/hooks';
|
||||
IconAnchor,
|
||||
} from "@tabler/icons-react";
|
||||
import { Outlet, useLocation, useNavigate } from "react-router-dom";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { notify, AppHeader, AppSidebar } from "@ema-platform/ui";
|
||||
import type { NavItem } from "@ema-platform/ui";
|
||||
import { logout } from "@ema-platform/auth";
|
||||
import { SUPPORTED_LANGUAGES } from "../i18n/config";
|
||||
import { useAppSelector } from "../store/hooks";
|
||||
|
||||
const NAV_ITEMS: (NavItem & { i18nKey: string })[] = [
|
||||
{ to: '/dashboard', label: 'Dashboard', i18nKey: 'nav.dashboard', icon: IconHome2 },
|
||||
{ to: '/seafarer-registry', label: 'Seafarer Registry', i18nKey: 'nav.seafarerRegistry', icon: IconList },
|
||||
{ to: '/seaman-book', label: 'My Application', i18nKey: 'nav.myApplication', icon: IconSend },
|
||||
{ to: '/vessel-registration-dashboard', label: 'Vessel Registration Dashboard', i18nKey: 'nav.vesselRegistrationDashboard', icon: IconGauge },
|
||||
{ to: '/vessel-registration', label: 'Vessel Registration', i18nKey: 'nav.vesselRegistration', icon: IconShip },
|
||||
{ to: '/vessel-registration/transfer', label: 'Ownership Transfer', i18nKey: 'nav.ownershipTransfer', icon: IconArrowsExchange },
|
||||
{ to: '/logistics-dashboard', label: 'Logistics Licenses Dashboard', i18nKey: 'nav.logisticsDashboard', icon: IconGauge },
|
||||
{ to: '/freight-forwarder-license', label: 'Freight Forwarder License', i18nKey: 'nav.freightForwarderLicense', icon: IconTruck },
|
||||
{ to: '/shipping-agent-license', label: 'Shipping Agent License', i18nKey: 'nav.shippingAgentLicense', icon: IconShip },
|
||||
{ to: '/combined-license', label: 'Combined License', i18nKey: 'nav.combinedLicense', icon: IconStack2 },
|
||||
{ to: '/joint-investment-license', label: 'Joint Investment License', i18nKey: 'nav.jointInvestmentLicense', icon: IconUsers },
|
||||
{ to: '/mto-license', label: 'MTO License', i18nKey: 'nav.mtoLicense', icon: IconTruck },
|
||||
{ to: '/waiver', label: 'Waiver', i18nKey: 'nav.waiver', icon: IconShieldOff },
|
||||
{ to: '/certificates', label: 'Certificates', i18nKey: 'nav.certificates', icon: IconShieldCheck },
|
||||
{ to: '/endorsements', label: 'Endorsements', i18nKey: 'nav.endorsements', icon: IconRubberStamp },
|
||||
{ to: '/vessel-registrations', label: 'Vessel Registration', i18nKey: 'nav.vesselRegistrations', icon: IconAnchor },
|
||||
{ to: '/vessel-transfers', label: 'Vessel Transfers', i18nKey: 'nav.vesselTransfers', icon: IconShip },
|
||||
{ to: '/documents', label: 'My Documents', i18nKey: 'nav.documents', icon: IconFolderOpen },
|
||||
{ to: '/notifications',label: 'Notifications', i18nKey: 'nav.notifications', icon: IconBell },
|
||||
{ to: '/profile', label: 'Profile', i18nKey: 'nav.profile', icon: IconUserCircle },
|
||||
{ to: '/support', label: 'Help & Support', i18nKey: 'nav.support', icon: IconHeadset },
|
||||
{
|
||||
to: "/dashboard",
|
||||
label: "Dashboard",
|
||||
i18nKey: "nav.dashboard",
|
||||
icon: IconHome2,
|
||||
},
|
||||
{
|
||||
to: "/seafarer-registry",
|
||||
label: "Seafarer Registry",
|
||||
i18nKey: "nav.seafarerRegistry",
|
||||
icon: IconList,
|
||||
},
|
||||
{
|
||||
to: "/seaman-book",
|
||||
label: "My Application",
|
||||
i18nKey: "nav.myApplication",
|
||||
icon: IconSend,
|
||||
},
|
||||
{
|
||||
to: "/vessel-registration-dashboard",
|
||||
label: "Vessel Registration Dashboard",
|
||||
i18nKey: "nav.vesselRegistrationDashboard",
|
||||
icon: IconGauge,
|
||||
},
|
||||
{
|
||||
to: "/vessel-registration",
|
||||
label: "Vessel Registration",
|
||||
i18nKey: "nav.vesselRegistration",
|
||||
icon: IconShip,
|
||||
},
|
||||
{
|
||||
to: "/vessel-registration/transfer",
|
||||
label: "Ownership Transfer",
|
||||
i18nKey: "nav.ownershipTransfer",
|
||||
icon: IconArrowsExchange,
|
||||
},
|
||||
{
|
||||
to: "/logistics-dashboard",
|
||||
label: "Logistics Licenses Dashboard",
|
||||
i18nKey: "nav.logisticsDashboard",
|
||||
icon: IconGauge,
|
||||
},
|
||||
{
|
||||
to: "/freight-forwarder-license",
|
||||
label: "Freight Forwarder License",
|
||||
i18nKey: "nav.freightForwarderLicense",
|
||||
icon: IconTruck,
|
||||
},
|
||||
{
|
||||
to: "/shipping-agent-license",
|
||||
label: "Shipping Agent License",
|
||||
i18nKey: "nav.shippingAgentLicense",
|
||||
icon: IconShip,
|
||||
},
|
||||
{
|
||||
to: "/combined-license",
|
||||
label: "Combined License",
|
||||
i18nKey: "nav.combinedLicense",
|
||||
icon: IconStack2,
|
||||
},
|
||||
{
|
||||
to: "/joint-investment-license",
|
||||
label: "Joint Investment License",
|
||||
i18nKey: "nav.jointInvestmentLicense",
|
||||
icon: IconUsers,
|
||||
},
|
||||
{
|
||||
to: "/mto-license",
|
||||
label: "MTO License",
|
||||
i18nKey: "nav.mtoLicense",
|
||||
icon: IconTruck,
|
||||
},
|
||||
{
|
||||
to: "/waiver",
|
||||
label: "Waiver",
|
||||
i18nKey: "nav.waiver",
|
||||
icon: IconShieldOff,
|
||||
},
|
||||
{
|
||||
to: "/certificates",
|
||||
label: "Certificates",
|
||||
i18nKey: "nav.certificates",
|
||||
icon: IconShieldCheck,
|
||||
},
|
||||
{
|
||||
to: "/endorsements",
|
||||
label: "Endorsements",
|
||||
i18nKey: "nav.endorsements",
|
||||
icon: IconRubberStamp,
|
||||
},
|
||||
{
|
||||
to: "/vessel-registrations",
|
||||
label: "Vessel Registration",
|
||||
i18nKey: "nav.vesselRegistrations",
|
||||
icon: IconAnchor,
|
||||
},
|
||||
{
|
||||
to: "/vessel-transfers",
|
||||
label: "Vessel Transfers",
|
||||
i18nKey: "nav.vesselTransfers",
|
||||
icon: IconShip,
|
||||
},
|
||||
{
|
||||
to: "/documents",
|
||||
label: "My Documents",
|
||||
i18nKey: "nav.documents",
|
||||
icon: IconFolderOpen,
|
||||
},
|
||||
{
|
||||
to: "/notifications",
|
||||
label: "Notifications",
|
||||
i18nKey: "nav.notifications",
|
||||
icon: IconBell,
|
||||
},
|
||||
{
|
||||
to: "/profile",
|
||||
label: "Profile",
|
||||
i18nKey: "nav.profile",
|
||||
icon: IconUserCircle,
|
||||
},
|
||||
{
|
||||
to: "/support",
|
||||
label: "Help & Support",
|
||||
i18nKey: "nav.support",
|
||||
icon: IconHeadset,
|
||||
},
|
||||
];
|
||||
|
||||
const PAGE_META: Record<string, { i18nKey: string }> = {
|
||||
'/dashboard': { i18nKey: 'nav.dashboard' },
|
||||
'/vessel-registration-dashboard': { i18nKey: 'nav.vesselRegistrationDashboard' },
|
||||
'/vessel-registration': { i18nKey: 'nav.vesselRegistration' },
|
||||
'/vessel-registration/transfer': { i18nKey: 'nav.ownershipTransfer' },
|
||||
'/logistics-dashboard': { i18nKey: 'nav.logisticsDashboard' },
|
||||
'/freight-forwarder-license': { i18nKey: 'nav.freightForwarderLicense' },
|
||||
'/shipping-agent-license': { i18nKey: 'nav.shippingAgentLicense' },
|
||||
'/combined-license': { i18nKey: 'nav.combinedLicense' },
|
||||
'/joint-investment-license': { i18nKey: 'nav.jointInvestmentLicense' },
|
||||
'/mto-license': { i18nKey: 'nav.mtoLicense' },
|
||||
'/waiver': { i18nKey: 'nav.waiver' },
|
||||
'/seafarer-registry': { i18nKey: 'nav.seafarerRegistry' },
|
||||
'/seaman-book': { i18nKey: 'nav.myApplication' },
|
||||
'/certificates': { i18nKey: 'nav.certificates' },
|
||||
'/endorsements': { i18nKey: 'nav.endorsements' },
|
||||
'/vessel-registrations': { i18nKey: 'nav.vesselRegistrations' },
|
||||
'/vessel-transfers': { i18nKey: 'nav.vesselTransfers' },
|
||||
'/documents': { i18nKey: 'nav.documents' },
|
||||
'/notifications':{ i18nKey: 'nav.notifications' },
|
||||
'/profile': { i18nKey: 'nav.profile' },
|
||||
'/support': { i18nKey: 'nav.support' },
|
||||
"/dashboard": { i18nKey: "nav.dashboard" },
|
||||
"/vessel-registration-dashboard": {
|
||||
i18nKey: "nav.vesselRegistrationDashboard",
|
||||
},
|
||||
"/vessel-registration": { i18nKey: "nav.vesselRegistration" },
|
||||
"/vessel-registration/transfer": { i18nKey: "nav.ownershipTransfer" },
|
||||
"/logistics-dashboard": { i18nKey: "nav.logisticsDashboard" },
|
||||
"/freight-forwarder-license": { i18nKey: "nav.freightForwarderLicense" },
|
||||
"/shipping-agent-license": { i18nKey: "nav.shippingAgentLicense" },
|
||||
"/combined-license": { i18nKey: "nav.combinedLicense" },
|
||||
"/joint-investment-license": { i18nKey: "nav.jointInvestmentLicense" },
|
||||
"/mto-license": { i18nKey: "nav.mtoLicense" },
|
||||
"/waiver": { i18nKey: "nav.waiver" },
|
||||
"/seafarer-registry": { i18nKey: "nav.seafarerRegistry" },
|
||||
"/seaman-book": { i18nKey: "nav.myApplication" },
|
||||
"/certificates": { i18nKey: "nav.certificates" },
|
||||
"/endorsements": { i18nKey: "nav.endorsements" },
|
||||
"/vessel-registrations": { i18nKey: "nav.vesselRegistrations" },
|
||||
"/vessel-transfers": { i18nKey: "nav.vesselTransfers" },
|
||||
"/documents": { i18nKey: "nav.documents" },
|
||||
"/notifications": { i18nKey: "nav.notifications" },
|
||||
"/profile": { i18nKey: "nav.profile" },
|
||||
"/support": { i18nKey: "nav.support" },
|
||||
};
|
||||
|
||||
export function PortalLayout() {
|
||||
@@ -85,12 +193,12 @@ export function PortalLayout() {
|
||||
const [sidebarCollapsed, { toggle: toggleSidebar }] = useDisclosure(false);
|
||||
|
||||
// Breadcrumb trail
|
||||
const segments = location.pathname.split('/').filter(Boolean);
|
||||
const segments = location.pathname.split("/").filter(Boolean);
|
||||
const crumbs = [
|
||||
{ label: t('nav.dashboard'), path: '/dashboard' },
|
||||
{ label: t("nav.dashboard"), path: "/dashboard" },
|
||||
...segments
|
||||
.map((_, i) => '/' + segments.slice(0, i + 1).join('/'))
|
||||
.filter((path) => PAGE_META[path] && path !== '/dashboard')
|
||||
.map((_, i) => "/" + segments.slice(0, i + 1).join("/"))
|
||||
.filter((path) => PAGE_META[path] && path !== "/dashboard")
|
||||
.map((path) => ({ label: t(PAGE_META[path].i18nKey), path })),
|
||||
];
|
||||
|
||||
@@ -107,28 +215,33 @@ export function PortalLayout() {
|
||||
|
||||
const handleLogout = () => {
|
||||
dispatch(logout());
|
||||
navigate('/login');
|
||||
navigate("/login");
|
||||
};
|
||||
|
||||
const displayName = user?.name?.en || user?.username || '';
|
||||
const displayName = user?.name?.en || user?.username || "";
|
||||
const initials = displayName
|
||||
? displayName.split(/\s+/).map((s) => s[0]).join('').toUpperCase().slice(0, 2)
|
||||
: '?';
|
||||
? displayName
|
||||
.split(/\s+/)
|
||||
.map((s) => s[0])
|
||||
.join("")
|
||||
.toUpperCase()
|
||||
.slice(0, 2)
|
||||
: "?";
|
||||
|
||||
return (
|
||||
<AppShell
|
||||
header={{ height: 74 }}
|
||||
navbar={{
|
||||
width: sidebarCollapsed ? 72 : 264,
|
||||
breakpoint: 'sm',
|
||||
breakpoint: "sm",
|
||||
collapsed: { mobile: !navOpened },
|
||||
}}
|
||||
padding="lg"
|
||||
>
|
||||
<AppShell.Header
|
||||
style={{
|
||||
background: 'var(--mantine-color-body)',
|
||||
borderBottom: '1px solid var(--mantine-color-gray-2)',
|
||||
background: "var(--mantine-color-body)",
|
||||
borderBottom: "1px solid var(--mantine-color-gray-2)",
|
||||
}}
|
||||
>
|
||||
<AppHeader
|
||||
@@ -138,7 +251,7 @@ export function PortalLayout() {
|
||||
breadcrumbs={crumbs}
|
||||
onNavigate={navigate}
|
||||
onLogout={handleLogout}
|
||||
userName={displayName || t('app.name')}
|
||||
userName={displayName || t("app.name")}
|
||||
userInitials={initials}
|
||||
supportedLanguages={SUPPORTED_LANGUAGES}
|
||||
/>
|
||||
@@ -147,20 +260,23 @@ export function PortalLayout() {
|
||||
<AppShell.Navbar
|
||||
p={0}
|
||||
style={{
|
||||
overflow: 'hidden',
|
||||
transition: 'width 200ms ease',
|
||||
background: 'var(--mantine-color-body)',
|
||||
borderRight: '1px solid var(--mantine-color-gray-2)',
|
||||
overflow: "hidden",
|
||||
transition: "width 200ms ease",
|
||||
background: "var(--mantine-color-body)",
|
||||
borderRight: "1px solid var(--mantine-color-gray-2)",
|
||||
}}
|
||||
>
|
||||
<AppSidebar
|
||||
navItems={NAV_ITEMS.map(({ i18nKey, ...rest }) => ({ ...rest, label: t(i18nKey) }))}
|
||||
navItems={NAV_ITEMS.map(({ i18nKey, ...rest }) => ({
|
||||
...rest,
|
||||
label: t(i18nKey),
|
||||
}))}
|
||||
collapsed={sidebarCollapsed}
|
||||
activePath={location.pathname}
|
||||
onToggleCollapse={toggleSidebar}
|
||||
onNavigate={go}
|
||||
brandName={t('app.name')}
|
||||
brandSubtitle={t('app.authority')}
|
||||
brandName={t("app.name")}
|
||||
brandSubtitle={t("app.authority")}
|
||||
/>
|
||||
</AppShell.Navbar>
|
||||
|
||||
|
||||
@@ -1,89 +1,105 @@
|
||||
import { createBrowserRouter, Navigate } from 'react-router-dom';
|
||||
import { I18nextProvider } from 'react-i18next';
|
||||
import { i18n } from './i18n/config';
|
||||
import { PortalLayout } from './layouts/PortalLayout';
|
||||
import { ProtectedRoute } from './components/ProtectedRoute';
|
||||
import { ProfileGuard } from './components/ProfileGuard';
|
||||
import { createBrowserRouter, Navigate } from "react-router-dom";
|
||||
import { I18nextProvider } from "react-i18next";
|
||||
import { i18n } from "./i18n/config";
|
||||
import { PortalLayout } from "./layouts/PortalLayout";
|
||||
import { ProtectedRoute } from "./components/ProtectedRoute";
|
||||
import { ProfileGuard } from "./components/ProfileGuard";
|
||||
|
||||
// Auth (standalone pages, no portal chrome)
|
||||
import { LoginPage, SignupPage, OTPVerificationPage, ForgotPasswordPage } from '@ema-platform/auth';
|
||||
import {
|
||||
LoginPage,
|
||||
SignupPage,
|
||||
OTPVerificationPage,
|
||||
ForgotPasswordPage,
|
||||
} from "@ema-platform/auth";
|
||||
|
||||
// Profile setup
|
||||
import { ProfileSetupPage } from './features/profile-setup/pages/ProfileSetupPage';
|
||||
import { ProfileSetupPage } from "./features/profile-setup/pages/ProfileSetupPage";
|
||||
|
||||
// Portal feature pages
|
||||
import { DashboardPage } from './features/dashboard/pages/DashboardPage';
|
||||
import { ProfilePage } from './features/profile/pages/ProfilePage';
|
||||
import { SupportPage } from './features/support/pages/SupportPage';
|
||||
import { SeafarerRegistrationPage } from './features/seafarer/pages/SeafarerRegistrationPage';
|
||||
import { SeafarerRegistryPage } from './features/seafarer/pages/SeafarerRegistryPage';
|
||||
import { SeafarerProfilePage } from './features/seafarer/pages/SeafarerProfilePage';
|
||||
import { DashboardPage } from "./features/dashboard/pages/DashboardPage";
|
||||
import { ProfilePage } from "./features/profile/pages/ProfilePage";
|
||||
import { SupportPage } from "./features/support/pages/SupportPage";
|
||||
import { SeafarerRegistrationPage } from "./features/seafarer/pages/SeafarerRegistrationPage";
|
||||
import { SeafarerRegistryPage } from "./features/seafarer/pages/SeafarerRegistryPage";
|
||||
import { SeafarerProfilePage } from "./features/seafarer/pages/SeafarerProfilePage";
|
||||
|
||||
// Phase 1 pages
|
||||
import { DocumentVaultPage } from './features/documents/pages/DocumentVaultPage';
|
||||
import { SeamanBookPage } from './features/seaman-book/pages/SeamanBookPage';
|
||||
import { SeamanBookApplicationPage } from './features/seaman-book/pages/SeamanBookApplicationPage';
|
||||
import { NotificationsPage } from './features/notifications/pages/NotificationsPage';
|
||||
import { DocumentVaultPage } from "./features/documents/pages/DocumentVaultPage";
|
||||
import { SeamanBookPage } from "./features/seaman-book/pages/SeamanBookPage";
|
||||
import { SeamanBookApplicationPage } from "./features/seaman-book/pages/SeamanBookApplicationPage";
|
||||
import { NotificationsPage } from "./features/notifications/pages/NotificationsPage";
|
||||
|
||||
// Phase 2 — CoC / CoP
|
||||
import { CertificatesPage } from './features/certificates/pages/CertificatesPage';
|
||||
import { CoCApplicationPage } from './features/certificates/pages/CoCApplicationPage';
|
||||
import { CertificatesPage } from "./features/certificates/pages/CertificatesPage";
|
||||
import { CoCApplicationPage } from "./features/certificates/pages/CoCApplicationPage";
|
||||
|
||||
// Phase 3 — Endorsement
|
||||
import { EndorsementPage } from './features/endorsement/pages/EndorsementPage';
|
||||
import { VesselRegistrationPage } from './features/vessel-registration/pages/VesselRegistrationPage';
|
||||
import { VesselRegistrationApplicationPage } from './features/vessel-registration/pages/VesselRegistrationApplicationPage';
|
||||
import { OwnershipTransferPage } from './features/vessel-registration/pages/OwnershipTransferPage';
|
||||
import { VesselRegistrationDashboardPage } from './features/vessel-registration-dashboard/pages/VesselRegistrationDashboardPage';
|
||||
import { VesselOwnerLayout } from './layouts/VesselOwnerLayout';
|
||||
import { VesselOwnerLoginPage } from './features/vessel-owner/pages/VesselOwnerLoginPage';
|
||||
import { VesselOwnerRegisterPage } from './features/vessel-owner/pages/VesselOwnerRegisterPage';
|
||||
import { VesselOwnerDashboardPage } from './features/vessel-owner/pages/VesselOwnerDashboardPage';
|
||||
import { LogisticsDashboardPage } from './features/logistics-dashboard/pages/LogisticsDashboardPage';
|
||||
import { FreightForwarderLicensePage } from './features/freight-forwarder-license/pages/FreightForwarderLicensePage';
|
||||
import { FreightForwarderLicenseApplicationPage } from './features/freight-forwarder-license/pages/FreightForwarderLicenseApplicationPage';
|
||||
import { FreightForwarderLicenseRenewalPage } from './features/freight-forwarder-license/pages/FreightForwarderLicenseRenewalPage';
|
||||
import { ShippingAgentLicensePage } from './features/shipping-agent-license/pages/ShippingAgentLicensePage';
|
||||
import { ShippingAgentLicenseApplicationPage } from './features/shipping-agent-license/pages/ShippingAgentLicenseApplicationPage';
|
||||
import { ShippingAgentLicenseRenewalPage } from './features/shipping-agent-license/pages/ShippingAgentLicenseRenewalPage';
|
||||
import { CombinedLicensePage } from './features/combined-license/pages/CombinedLicensePage';
|
||||
import { CombinedLicenseApplicationPage } from './features/combined-license/pages/CombinedLicenseApplicationPage';
|
||||
import { CombinedLicenseRenewalPage } from './features/combined-license/pages/CombinedLicenseRenewalPage';
|
||||
import { JointInvestmentLicensePage } from './features/joint-investment-license/pages/JointInvestmentLicensePage';
|
||||
import { JointInvestmentLicenseApplicationPage } from './features/joint-investment-license/pages/JointInvestmentLicenseApplicationPage';
|
||||
import { JointInvestmentLicenseRenewalPage } from './features/joint-investment-license/pages/JointInvestmentLicenseRenewalPage';
|
||||
import { MtoLicensePage } from './features/mto-license/pages/MtoLicensePage';
|
||||
import { MtoLicenseApplicationPage } from './features/mto-license/pages/MtoLicenseApplicationPage';
|
||||
import { MtoLicenseRenewalPage } from './features/mto-license/pages/MtoLicenseRenewalPage';
|
||||
import { WaiverPage } from './features/waiver/pages/WaiverPage';
|
||||
import { WaiverApplicationPage } from './features/waiver/pages/WaiverApplicationPage';
|
||||
import { EndorsementPage } from "./features/endorsement/pages/EndorsementPage";
|
||||
import { VesselRegistrationPage } from "./features/vessel-registration/pages/VesselRegistrationPage";
|
||||
import { VesselRegistrationApplicationPage } from "./features/vessel-registration/pages/VesselRegistrationApplicationPage";
|
||||
import { OwnershipTransferPage } from "./features/vessel-registration/pages/OwnershipTransferPage";
|
||||
import { VesselRegistrationDashboardPage } from "./features/vessel-registration-dashboard/pages/VesselRegistrationDashboardPage";
|
||||
import { VesselOwnerLayout } from "./layouts/VesselOwnerLayout";
|
||||
import { VesselOwnerLoginPage } from "./features/vessel-owner/pages/VesselOwnerLoginPage";
|
||||
import { VesselOwnerRegisterPage } from "./features/vessel-owner/pages/VesselOwnerRegisterPage";
|
||||
import { VesselOwnerDashboardPage } from "./features/vessel-owner/pages/VesselOwnerDashboardPage";
|
||||
import { LogisticsDashboardPage } from "./features/logistics-dashboard/pages/LogisticsDashboardPage";
|
||||
import { FreightForwarderLicensePage } from "./features/freight-forwarder-license/pages/FreightForwarderLicensePage";
|
||||
import { FreightForwarderLicenseApplicationPage } from "./features/freight-forwarder-license/pages/FreightForwarderLicenseApplicationPage";
|
||||
import { FreightForwarderLicenseRenewalPage } from "./features/freight-forwarder-license/pages/FreightForwarderLicenseRenewalPage";
|
||||
import { ShippingAgentLicensePage } from "./features/shipping-agent-license/pages/ShippingAgentLicensePage";
|
||||
import { ShippingAgentLicenseApplicationPage } from "./features/shipping-agent-license/pages/ShippingAgentLicenseApplicationPage";
|
||||
import { ShippingAgentLicenseRenewalPage } from "./features/shipping-agent-license/pages/ShippingAgentLicenseRenewalPage";
|
||||
import { CombinedLicensePage } from "./features/combined-license/pages/CombinedLicensePage";
|
||||
import { CombinedLicenseApplicationPage } from "./features/combined-license/pages/CombinedLicenseApplicationPage";
|
||||
import { CombinedLicenseRenewalPage } from "./features/combined-license/pages/CombinedLicenseRenewalPage";
|
||||
import { JointInvestmentLicensePage } from "./features/joint-investment-license/pages/JointInvestmentLicensePage";
|
||||
import { JointInvestmentLicenseApplicationPage } from "./features/joint-investment-license/pages/JointInvestmentLicenseApplicationPage";
|
||||
import { JointInvestmentLicenseRenewalPage } from "./features/joint-investment-license/pages/JointInvestmentLicenseRenewalPage";
|
||||
import { MtoLicensePage } from "./features/mto-license/pages/MtoLicensePage";
|
||||
import { MtoLicenseApplicationPage } from "./features/mto-license/pages/MtoLicenseApplicationPage";
|
||||
import { MtoLicenseRenewalPage } from "./features/mto-license/pages/MtoLicenseRenewalPage";
|
||||
import { WaiverPage } from "./features/waiver/pages/WaiverPage";
|
||||
import { WaiverApplicationPage } from "./features/waiver/pages/WaiverApplicationPage";
|
||||
|
||||
// Vessel Ownership Transfer
|
||||
import { VesselTransferPage } from './features/vessel-transfer/pages/VesselTransferPage';
|
||||
import { VesselTransferApplicationPage } from './features/vessel-transfer/pages/VesselTransferApplicationPage';
|
||||
import { VesselTransferPage } from "./features/vessel-transfer/pages/VesselTransferPage";
|
||||
import { VesselTransferApplicationPage } from "./features/vessel-transfer/pages/VesselTransferApplicationPage";
|
||||
|
||||
// Vessel Registration
|
||||
import { VesselRegistrationPage } from './features/vessel-registration/pages/VesselRegistrationPage';
|
||||
import { VesselRegistrationApplicationPage } from './features/vessel-registration/pages/VesselRegistrationApplicationPage';
|
||||
import { VesselRegistrationStatusPage } from './features/vessel-registration/pages/VesselRegistrationStatusPage';
|
||||
|
||||
import { VesselRegistrationStatusPage } from "./features/vessel-registration/pages/VesselRegistrationStatusPage";
|
||||
|
||||
export const router = createBrowserRouter([
|
||||
// Public auth pages
|
||||
{ path: '/login', element: <LoginPage /> },
|
||||
{ path: '/signup', element: <SignupPage /> },
|
||||
{ path: "/login", element: <LoginPage /> },
|
||||
{ path: "/signup", element: <SignupPage /> },
|
||||
|
||||
// Protected auth pages
|
||||
{
|
||||
element: <ProtectedRoute><OTPVerificationPage /></ProtectedRoute>,
|
||||
path: '/otp-verify',
|
||||
element: (
|
||||
<ProtectedRoute>
|
||||
<OTPVerificationPage />
|
||||
</ProtectedRoute>
|
||||
),
|
||||
path: "/otp-verify",
|
||||
},
|
||||
{
|
||||
element: <ProtectedRoute><ForgotPasswordPage /></ProtectedRoute>,
|
||||
path: '/forgot-password',
|
||||
element: (
|
||||
<ProtectedRoute>
|
||||
<ForgotPasswordPage />
|
||||
</ProtectedRoute>
|
||||
),
|
||||
path: "/forgot-password",
|
||||
},
|
||||
{
|
||||
element: <ProtectedRoute><ProfileSetupPage /></ProtectedRoute>,
|
||||
path: '/profile-setup',
|
||||
element: (
|
||||
<ProtectedRoute>
|
||||
<ProfileSetupPage />
|
||||
</ProtectedRoute>
|
||||
),
|
||||
path: "/profile-setup",
|
||||
},
|
||||
|
||||
// Portal — protected
|
||||
@@ -98,66 +114,117 @@ export const router = createBrowserRouter([
|
||||
</ProtectedRoute>
|
||||
),
|
||||
children: [
|
||||
{ path: '/', element: <Navigate to="/dashboard" replace /> },
|
||||
{ path: '/dashboard', element: <DashboardPage /> },
|
||||
{ path: "/", element: <Navigate to="/dashboard" replace /> },
|
||||
{ path: "/dashboard", element: <DashboardPage /> },
|
||||
|
||||
// Seafarer
|
||||
{ path: '/seafarer-registration', element: <SeafarerRegistrationPage /> },
|
||||
{ path: '/seafarer-registry', element: <SeafarerRegistryPage /> },
|
||||
{ path: '/seafarer-registry/:id', element: <SeafarerProfilePage /> },
|
||||
{ path: "/seafarer-registration", element: <SeafarerRegistrationPage /> },
|
||||
{ path: "/seafarer-registry", element: <SeafarerRegistryPage /> },
|
||||
{ path: "/seafarer-registry/:id", element: <SeafarerProfilePage /> },
|
||||
|
||||
// Phase 1
|
||||
{ path: '/documents', element: <DocumentVaultPage /> },
|
||||
{ path: '/seaman-book', element: <SeamanBookPage /> },
|
||||
{ path: '/seaman-book/apply', element: <SeamanBookApplicationPage /> },
|
||||
{ path: '/notifications', element: <NotificationsPage /> },
|
||||
{ path: "/documents", element: <DocumentVaultPage /> },
|
||||
{ path: "/seaman-book", element: <SeamanBookPage /> },
|
||||
{ path: "/seaman-book/apply", element: <SeamanBookApplicationPage /> },
|
||||
{ path: "/notifications", element: <NotificationsPage /> },
|
||||
|
||||
// Phase 2 — CoC / CoP
|
||||
{ path: '/certificates', element: <CertificatesPage /> },
|
||||
{ path: '/certificates/apply', element: <CoCApplicationPage /> },
|
||||
{ path: "/certificates", element: <CertificatesPage /> },
|
||||
{ path: "/certificates/apply", element: <CoCApplicationPage /> },
|
||||
|
||||
// Phase 3 — Endorsement
|
||||
{ path: '/endorsements', element: <EndorsementPage /> },
|
||||
{ path: '/vessel-registration-dashboard', element: <VesselRegistrationDashboardPage /> },
|
||||
{ path: '/vessel-registration', element: <VesselRegistrationPage /> },
|
||||
{ path: '/vessel-registration/apply', element: <VesselRegistrationApplicationPage /> },
|
||||
{ path: '/vessel-registration/transfer', element: <OwnershipTransferPage /> },
|
||||
{ path: '/logistics-dashboard', element: <LogisticsDashboardPage /> },
|
||||
{ path: '/freight-forwarder-license', element: <FreightForwarderLicensePage /> },
|
||||
{ path: '/freight-forwarder-license/apply', element: <FreightForwarderLicenseApplicationPage /> },
|
||||
{ path: '/freight-forwarder-license/:id/renew', element: <FreightForwarderLicenseRenewalPage /> },
|
||||
{ path: '/shipping-agent-license', element: <ShippingAgentLicensePage /> },
|
||||
{ path: '/shipping-agent-license/apply', element: <ShippingAgentLicenseApplicationPage /> },
|
||||
{ path: '/shipping-agent-license/:id/renew', element: <ShippingAgentLicenseRenewalPage /> },
|
||||
{ path: '/combined-license', element: <CombinedLicensePage /> },
|
||||
{ path: '/combined-license/apply', element: <CombinedLicenseApplicationPage /> },
|
||||
{ path: '/combined-license/:id/renew', element: <CombinedLicenseRenewalPage /> },
|
||||
{ path: '/joint-investment-license', element: <JointInvestmentLicensePage /> },
|
||||
{ path: '/joint-investment-license/apply', element: <JointInvestmentLicenseApplicationPage /> },
|
||||
{ path: '/joint-investment-license/:id/renew', element: <JointInvestmentLicenseRenewalPage /> },
|
||||
{ path: '/mto-license', element: <MtoLicensePage /> },
|
||||
{ path: '/mto-license/apply', element: <MtoLicenseApplicationPage /> },
|
||||
{ path: '/mto-license/:id/renew', element: <MtoLicenseRenewalPage /> },
|
||||
{ path: '/waiver', element: <WaiverPage /> },
|
||||
{ path: '/waiver/apply', element: <WaiverApplicationPage /> },
|
||||
{ path: "/endorsements", element: <EndorsementPage /> },
|
||||
{
|
||||
path: "/vessel-registration-dashboard",
|
||||
element: <VesselRegistrationDashboardPage />,
|
||||
},
|
||||
{ path: "/vessel-registration", element: <VesselRegistrationPage /> },
|
||||
{
|
||||
path: "/vessel-registration/apply",
|
||||
element: <VesselRegistrationApplicationPage />,
|
||||
},
|
||||
{
|
||||
path: "/vessel-registration/transfer",
|
||||
element: <OwnershipTransferPage />,
|
||||
},
|
||||
{ path: "/logistics-dashboard", element: <LogisticsDashboardPage /> },
|
||||
{
|
||||
path: "/freight-forwarder-license",
|
||||
element: <FreightForwarderLicensePage />,
|
||||
},
|
||||
{
|
||||
path: "/freight-forwarder-license/apply",
|
||||
element: <FreightForwarderLicenseApplicationPage />,
|
||||
},
|
||||
{
|
||||
path: "/freight-forwarder-license/:id/renew",
|
||||
element: <FreightForwarderLicenseRenewalPage />,
|
||||
},
|
||||
{
|
||||
path: "/shipping-agent-license",
|
||||
element: <ShippingAgentLicensePage />,
|
||||
},
|
||||
{
|
||||
path: "/shipping-agent-license/apply",
|
||||
element: <ShippingAgentLicenseApplicationPage />,
|
||||
},
|
||||
{
|
||||
path: "/shipping-agent-license/:id/renew",
|
||||
element: <ShippingAgentLicenseRenewalPage />,
|
||||
},
|
||||
{ path: "/combined-license", element: <CombinedLicensePage /> },
|
||||
{
|
||||
path: "/combined-license/apply",
|
||||
element: <CombinedLicenseApplicationPage />,
|
||||
},
|
||||
{
|
||||
path: "/combined-license/:id/renew",
|
||||
element: <CombinedLicenseRenewalPage />,
|
||||
},
|
||||
{
|
||||
path: "/joint-investment-license",
|
||||
element: <JointInvestmentLicensePage />,
|
||||
},
|
||||
{
|
||||
path: "/joint-investment-license/apply",
|
||||
element: <JointInvestmentLicenseApplicationPage />,
|
||||
},
|
||||
{
|
||||
path: "/joint-investment-license/:id/renew",
|
||||
element: <JointInvestmentLicenseRenewalPage />,
|
||||
},
|
||||
{ path: "/mto-license", element: <MtoLicensePage /> },
|
||||
{ path: "/mto-license/apply", element: <MtoLicenseApplicationPage /> },
|
||||
{ path: "/mto-license/:id/renew", element: <MtoLicenseRenewalPage /> },
|
||||
{ path: "/waiver", element: <WaiverPage /> },
|
||||
{ path: "/waiver/apply", element: <WaiverApplicationPage /> },
|
||||
|
||||
// Vessel Registration
|
||||
{ path: '/vessel-registrations', element: <VesselRegistrationPage /> },
|
||||
{ path: '/vessel-registrations/apply', element: <VesselRegistrationApplicationPage /> },
|
||||
{ path: '/vessel-registrations/:id', element: <VesselRegistrationStatusPage /> },
|
||||
{ path: "/vessel-registrations", element: <VesselRegistrationPage /> },
|
||||
{
|
||||
path: "/vessel-registrations/apply",
|
||||
element: <VesselRegistrationApplicationPage />,
|
||||
},
|
||||
{
|
||||
path: "/vessel-registrations/:id",
|
||||
element: <VesselRegistrationStatusPage />,
|
||||
},
|
||||
|
||||
// Vessel Ownership Transfer
|
||||
{ path: '/vessel-transfers', element: <VesselTransferPage /> },
|
||||
{ path: '/vessel-transfers/apply', element: <VesselTransferApplicationPage /> },
|
||||
{ path: "/vessel-transfers", element: <VesselTransferPage /> },
|
||||
{
|
||||
path: "/vessel-transfers/apply",
|
||||
element: <VesselTransferApplicationPage />,
|
||||
},
|
||||
|
||||
// General
|
||||
{ path: '/profile', element: <ProfilePage /> },
|
||||
{ path: '/support', element: <SupportPage /> },
|
||||
{ path: "/profile", element: <ProfilePage /> },
|
||||
{ path: "/support", element: <SupportPage /> },
|
||||
],
|
||||
},
|
||||
|
||||
{ path: '/vessel-owner/login', element: <VesselOwnerLoginPage /> },
|
||||
{ path: '/vessel-owner/register', element: <VesselOwnerRegisterPage /> },
|
||||
{ path: "/vessel-owner/login", element: <VesselOwnerLoginPage /> },
|
||||
{ path: "/vessel-owner/register", element: <VesselOwnerRegisterPage /> },
|
||||
{
|
||||
element: (
|
||||
<ProtectedRoute>
|
||||
@@ -167,12 +234,24 @@ export const router = createBrowserRouter([
|
||||
</ProtectedRoute>
|
||||
),
|
||||
children: [
|
||||
{ path: '/vessel-owner/dashboard', element: <VesselOwnerDashboardPage /> },
|
||||
{ path: '/vessel-owner/registration', element: <VesselRegistrationPage /> },
|
||||
{ path: '/vessel-owner/registration/apply', element: <VesselRegistrationApplicationPage /> },
|
||||
{ path: '/vessel-owner/registration/transfer', element: <OwnershipTransferPage /> },
|
||||
{
|
||||
path: "/vessel-owner/dashboard",
|
||||
element: <VesselOwnerDashboardPage />,
|
||||
},
|
||||
{
|
||||
path: "/vessel-owner/registration",
|
||||
element: <VesselRegistrationPage />,
|
||||
},
|
||||
{
|
||||
path: "/vessel-owner/registration/apply",
|
||||
element: <VesselRegistrationApplicationPage />,
|
||||
},
|
||||
{
|
||||
path: "/vessel-owner/registration/transfer",
|
||||
element: <OwnershipTransferPage />,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{ path: '*', element: <Navigate to="/" replace /> },
|
||||
{ path: "*", element: <Navigate to="/" replace /> },
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user