Skip to content

Commit

Permalink
format complete
Browse files Browse the repository at this point in the history
  • Loading branch information
lksnjw committed Oct 7, 2024
1 parent 823dde3 commit 620d565
Show file tree
Hide file tree
Showing 42 changed files with 3,132 additions and 2,347 deletions.
265 changes: 138 additions & 127 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,62 @@ import {
createBrowserRouter,
createRoutesFromElements,
Route,
} from 'react-router-dom';
} from 'react-router-dom'

// Layouts and Components
import MainLayout from './Layouts/MainLayout';
import DLayout from './Layouts/DLayout';
import MainLayout from './Layouts/MainLayout'
import DLayout from './Layouts/DLayout'

import SidebarLayout from './Layouts/SidebarLayout'; // Layout with Sidebar
import PrivateRoute from './Components/PrivateRoute';
import SidebarLayout from './Layouts/SidebarLayout' // Layout with Sidebar
import PrivateRoute from './Components/PrivateRoute'

// Customer Pages
import HomePage from './Pages/HomePage';
import NotFound from './Pages/NotFound';
import Login from './Pages/Customer/LoginForm';
import Register from './Pages/Customer/RegisterForm';
import VerifyEmail from './Pages/Customer/VerifyEmail';
import CheckEmail from './Pages/Customer/CheckEmail';
import ForgotPassword from './Pages/Customer/ForgotPassword';
import ResetPassword from './Pages/Customer/PasswordReset';
import UserDashboard from './Pages/Customer/UserDashboard';
import Settings from './Pages/Customer/Settings';
import UserAllOrders from './Pages/Customer/UserAllOrders';
import MembershipUpgrade from './Pages/Customer/MembershipUpgrade';
import OrderStatus from './Pages/Customer/OrderStatus';
import Address from './Components/Address';
import PaymentConfirmation from './Pages/Customer/PaymentConfirmation';
import PaymentComplete from './Pages/Customer/PaymentComplete';
import HomePage from './Pages/HomePage'
import NotFound from './Pages/NotFound'
import Login from './Pages/Customer/LoginForm'
import Register from './Pages/Customer/RegisterForm'
import VerifyEmail from './Pages/Customer/VerifyEmail'
import CheckEmail from './Pages/Customer/CheckEmail'
import ForgotPassword from './Pages/Customer/ForgotPassword'
import ResetPassword from './Pages/Customer/PasswordReset'
import UserDashboard from './Pages/Customer/UserDashboard'
import Settings from './Pages/Customer/Settings'
import UserAllOrders from './Pages/Customer/UserAllOrders'
import MembershipUpgrade from './Pages/Customer/MembershipUpgrade'
import OrderStatus from './Pages/Customer/OrderStatus'
import Address from './Components/Address'
import PaymentConfirmation from './Pages/Customer/PaymentConfirmation'
import PaymentComplete from './Pages/Customer/PaymentComplete'

// Shop Pages
import ShopList from './Pages/Shop/ShopList';
import ShopPage from './Pages/Shop/ShopPage';
import ProductPage from './Pages/Shop/ProductPage';
import Cart from './Pages/order/Cart';
import CheckOut from './Pages/order/checkOut';
import ShopList from './Pages/Shop/ShopList'
import ShopPage from './Pages/Shop/ShopPage'
import ProductPage from './Pages/Shop/ProductPage'
import Cart from './Pages/order/Cart'
import CheckOut from './Pages/order/checkOut'

//Admin
import DashboardLayout from './Components/Admin/DashboardLayout';
import CustomerPage from './Components/Admin/CustomerPage';
import StaffPage from './Components/Admin/StaffPage';
import PromotionPage from './Components/Admin/PromotionPage';
import FinancialAnalysisPage from './Components/Admin/FinancialAnalysisPage';
import CreateStaff from './Components/Admin/AdminCreateStaffPage';
import CreateCustomer from './Components/Admin/AdminCreateCustomerPage';
import DashboardLayout from './Components/Admin/DashboardLayout'
import CustomerPage from './Components/Admin/CustomerPage'
import StaffPage from './Components/Admin/StaffPage'
import PromotionPage from './Components/Admin/PromotionPage'
import FinancialAnalysisPage from './Components/Admin/FinancialAnalysisPage'
import CreateStaff from './Components/Admin/AdminCreateStaffPage'
import CreateCustomer from './Components/Admin/AdminCreateCustomerPage'

// Farmer Pages
import FarmerLogin from './Pages/farmer/FarmerLogin';
import FarmerDashboard from './Pages/farmer/FarmerDashboard';
import ProfilePage from './Pages/farmer/FarmerProfile';
import FarmerLogout from './Pages/farmer/FarmerLogOut';
import FarmerRegister from './Pages/farmer/FarmerRegistration';
import MyShop from './Pages/farmer/Myshops';
import AddShop from './Pages/farmer/shopcreate';
import Shop from './Pages/farmer/ShopDashboard';
import ShopProfile from './Pages/farmer/shopProfile';
import Products from './Pages/farmer/products';
import AddProduct from './Pages/farmer/addProduct';
import UpdateProduct from './Pages/farmer/UpdateProduct';


import FarmerLogin from './Pages/farmer/FarmerLogin'
import FarmerDashboard from './Pages/farmer/FarmerDashboard'
import ProfilePage from './Pages/farmer/FarmerProfile'
import FarmerLogout from './Pages/farmer/FarmerLogOut'
import FarmerRegister from './Pages/farmer/FarmerRegistration'
import MyShop from './Pages/farmer/Myshops'
import AddShop from './Pages/farmer/shopcreate'
import Shop from './Pages/farmer/ShopDashboard'
import ShopProfile from './Pages/farmer/shopProfile'
import Products from './Pages/farmer/products'
import AddProduct from './Pages/farmer/addProduct'
import UpdateProduct from './Pages/farmer/UpdateProduct'

// DElivery supervisor and driver
import DLDriverRegistrationForm from './Pages/delivery/DLDriverRegistrationForm'
Expand All @@ -70,26 +68,22 @@ import DLImageUpload from './Pages/delivery/DLImageUpload'
import DLSendEmail from './Pages/delivery/DLSendEmail' // Import the DLSendEmail component
import DLLogin from './Pages/delivery/DLLogin' // Added DLLogin import

import DeliveryDashboard from './Pages/delivery/DLDriverDashboard';
import DeliveryDashboard from './Pages/delivery/DLDriverDashboard'
import DLDriverProfile from './Pages/delivery/DLDriverProfile' // Import the driver profile component
import DLEditProfile from './Pages/delivery/Dleditprofile';
import DLALLdrivers from './Pages/delivery/DLALLdrivers'; // Import the DLALLdrivers component
import DLmanageDash from './Pages/delivery/DLmangeDash'; // Adjust the path if necessary
import DLViewDriver from './Pages/delivery/DLViewDriver'; // Adjust the path according to your project structure
import DLlogout from './Pages/delivery/DLlogout'; // Import the DLlogout component
import DLeditdriver from './Pages/delivery/DLeditdriver'; // Import the new DLeditdriver page
import OrderForm from './Pages/delivery/DLoooo'; // Assuming OrderForm component is in 'components' folder
import OrderTable from './Pages/delivery/DLOtable'; // Assuming you store it in the components folder
import Od from './Pages/delivery/or/orderdelete'; //
import DLAllDeliveries from './Pages/delivery/DLviewDeliveries'; // Import the DLAllDeliveries component
import DLViewDelivery from './Pages/delivery/DLviewDelivery'; // Import the
import OngoingDelivery from './Pages/delivery/driver/OngoingDelivery'; // Import the OngoingDelivery component
import ViewDelivery from './Pages/delivery/driver/ViewDelivery'; // Import the ViewDelivery page
import ViewDeliveries from './Pages/delivery/driver/ViewDeliveries'; // Import the ViewDeliveries page




import DLEditProfile from './Pages/delivery/Dleditprofile'
import DLALLdrivers from './Pages/delivery/DLALLdrivers' // Import the DLALLdrivers component
import DLmanageDash from './Pages/delivery/DLmangeDash' // Adjust the path if necessary
import DLViewDriver from './Pages/delivery/DLViewDriver' // Adjust the path according to your project structure
import DLlogout from './Pages/delivery/DLlogout' // Import the DLlogout component
import DLeditdriver from './Pages/delivery/DLeditdriver' // Import the new DLeditdriver page
import OrderForm from './Pages/delivery/DLoooo' // Assuming OrderForm component is in 'components' folder
import OrderTable from './Pages/delivery/DLOtable' // Assuming you store it in the components folder
import Od from './Pages/delivery/or/orderdelete' //
import DLAllDeliveries from './Pages/delivery/DLviewDeliveries' // Import the DLAllDeliveries component
import DLViewDelivery from './Pages/delivery/DLviewDelivery' // Import the
import OngoingDelivery from './Pages/delivery/driver/OngoingDelivery' // Import the OngoingDelivery component
import ViewDelivery from './Pages/delivery/driver/ViewDelivery' // Import the ViewDelivery page
import ViewDeliveries from './Pages/delivery/driver/ViewDeliveries' // Import the ViewDeliveries page

// Define all routes in a single Router
const router = createBrowserRouter(
Expand All @@ -115,7 +109,10 @@ const router = createBrowserRouter(
element={<UserDashboard />}
/>
<Route path="/settings" element={<Settings />} />
<Route path="/orderhistory" element={<UserAllOrders />} />
<Route
path="/orderhistory"
element={<UserAllOrders />}
/>
<Route path="/orderStatus" element={<OrderStatus />} />
<Route
path="/membership"
Expand Down Expand Up @@ -171,79 +168,93 @@ const router = createBrowserRouter(

{/* Admin Routes */}
<Route path="/">
<Route path="/Admindashboard" element={<DashboardLayout />}/>
<Route path="/Admindashboard/customer" element={<CustomerPage />} />
<Route path="/Admindashboard" element={<DashboardLayout />} />
<Route
path="/Admindashboard/customer"
element={<CustomerPage />}
/>
<Route path="/Admindashboard/staff" element={<StaffPage />} />
<Route path="/Admindashboard/offers" element={<PromotionPage />} />
<Route path="/Admindashboard/financial-analysis" element={<FinancialAnalysisPage />} />
<Route path="/Admindashboard/staff/create" element={<CreateStaff />} /> {/* Updated path */}
<Route path="/Admindashboard/Customer/create" element={<CreateCustomer />} />

<Route
path="/Admindashboard/offers"
element={<PromotionPage />}
/>
<Route
path="/Admindashboard/financial-analysis"
element={<FinancialAnalysisPage />}
/>
<Route
path="/Admindashboard/staff/create"
element={<CreateStaff />}
/>{' '}
{/* Updated path */}
<Route
path="/Admindashboard/Customer/create"
element={<CreateCustomer />}
/>
<Route path="*" element={<NotFound />} />
</Route>

{/* delivery and driver Routes */}
<Route path="/" element={<DLayout />}>

<Route path="/register-driver" element={<DLDriverRegistrationForm />} />
<Route
path="/register-driver"
element={<DLDriverRegistrationForm />}
/>
<Route path="/upload-image" element={<DLImageUpload />} />
<Route path="/manager/approve-driver" element={<DLApproveDriver />} />
<Route path="/manager/approve-driver/:id" element={<DLDriverAccept />} />
{/*<Route path="/manager/approve-driver/:id/send-email" element={<DLSendEmail />} />*/}

<Route path="/driver/login" element={<DLLogin />} /> {/* Driver Login Route */}
<Route path="/driver/dashboard" element={<DeliveryDashboard />} />
<Route path="/driver/profile" element={<DLDriverProfile />} /> {/* Add profile route */}
<Route path="/driver/profile/edit" element={<DLEditProfile />} />
<Route path="/alldrivers" element={<DLALLdrivers />} />
<Route path="/manager/dashboard" element={<DLmanageDash />} />
<Route path="/manager/view-driver/:id" element={<DLViewDriver />} />
<Route path="/driver/logout" element={<DLlogout />} />
<Route path="/driver/edit/:id" element={<DLeditdriver />} />
<Route path="/a" element={<OrderForm />} />
<Route path="/b" element={<OrderTable />} />
<Route path="/d" element={<Od/>} />
<Route path="/DLAllDeliveries" element={<DLAllDeliveries/>} />
<Route path="/manager/delivery/:id" element={<DLViewDelivery />} />
<Route path="/ongoing" element={<OngoingDelivery />} />
<Route path="/driver/delivery/:id" element={<ViewDelivery />} /> {/* Route for viewing a specific delivery */}
<Route path="/driver/deliveries" element={<ViewDeliveries />} />

<Route
path="/manager/approve-driver"
element={<DLApproveDriver />}
/>
<Route
path="/manager/approve-driver/:id"
element={<DLDriverAccept />}
/>
{/*<Route path="/manager/approve-driver/:id/send-email" element={<DLSendEmail />} />*/}
<Route path="/driver/login" element={<DLLogin />} />{' '}
{/* Driver Login Route */}
<Route
path="/driver/dashboard"
element={<DeliveryDashboard />}
/>
<Route path="/driver/profile" element={<DLDriverProfile />} />{' '}
{/* Add profile route */}
<Route
path="/driver/profile/edit"
element={<DLEditProfile />}
/>
<Route path="/alldrivers" element={<DLALLdrivers />} />
<Route path="/manager/dashboard" element={<DLmanageDash />} />
<Route
path="/manager/view-driver/:id"
element={<DLViewDriver />}
/>
<Route path="/driver/logout" element={<DLlogout />} />
<Route path="/driver/edit/:id" element={<DLeditdriver />} />
<Route path="/a" element={<OrderForm />} />
<Route path="/b" element={<OrderTable />} />
<Route path="/d" element={<Od />} />
<Route path="/DLAllDeliveries" element={<DLAllDeliveries />} />
<Route
path="/manager/delivery/:id"
element={<DLViewDelivery />}
/>
<Route path="/ongoing" element={<OngoingDelivery />} />
<Route
path="/driver/delivery/:id"
element={<ViewDelivery />}
/>{' '}
{/* Route for viewing a specific delivery */}
<Route path="/driver/deliveries" element={<ViewDeliveries />} />
<Route path="*" element={<NotFound />} />
</Route>



{/* Add Other Roots Below */}























</>
)
);
)

const App = () => {
return <RouterProvider router={router}></RouterProvider>;
};
return <RouterProvider router={router}></RouterProvider>
}

export default App;
export default App
Loading

0 comments on commit 620d565

Please sign in to comment.