Refactor UI imports and update component paths
Some checks failed
Build Frontend / build (push) Failing after 7s
Some checks failed
Build Frontend / build (push) Failing after 7s
Replaces imports from 'components/ui' with 'components/common' across the app and dashboard pages, and updates model and API imports to use new paths under 'lib'. Removes redundant authentication checks from several dashboard pages. Adds new dashboard components and utility files, and reorganizes hooks and services into the 'lib' directory for improved structure.
This commit is contained in:
@@ -4,8 +4,8 @@ import { useState, useEffect, ChangeEvent, Suspense } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Layout from "@/components/layout/layout";
|
||||
import { Edit, Plus, Trash, Truck } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { Button } from "@/components/common/button";
|
||||
import { Skeleton } from "@/components/common/skeleton";
|
||||
import {
|
||||
fetchShippingMethods,
|
||||
addShippingMethod,
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
ShippingData
|
||||
} from "@/lib/services/shipping-service";
|
||||
import dynamic from "next/dynamic";
|
||||
import { Card, CardContent, CardHeader } from "@/components/ui/card";
|
||||
import { Card, CardContent, CardHeader } from "@/components/common/card";
|
||||
|
||||
// Lazy load components with error handling
|
||||
const ShippingModal = dynamic(() => import("@/components/modals/shipping-modal").then(mod => ({ default: mod.ShippingModal })).catch((err) => {
|
||||
@@ -142,11 +142,6 @@ export default function ShippingPage() {
|
||||
.find((row) => row.startsWith("Authorization="))
|
||||
?.split("=")[1];
|
||||
|
||||
if (!authToken) {
|
||||
router.push("/login");
|
||||
return;
|
||||
}
|
||||
|
||||
const fetchedMethods: ShippingMethod[] = await fetchShippingMethods(
|
||||
authToken
|
||||
);
|
||||
@@ -317,4 +312,4 @@ export default function ShippingPage() {
|
||||
/>
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user