diff --git a/src/pages/Home/PlanCardSkeleton.jsx b/src/pages/Home/PlanCardSkeleton.jsx new file mode 100644 index 00000000..837ea686 --- /dev/null +++ b/src/pages/Home/PlanCardSkeleton.jsx @@ -0,0 +1,44 @@ +import React from "react"; + +const SubscriptionPlanSkeleton = () => { + return ( +
+
+ {/* Header */} +
+
+
+
+
+ + {/* Price */} +
+
+
+ + {/* Storage & Trial */} +
+
+
+
+ + {/* Features */} +
+ Features +
+ + + {/* Button */} +
+
+
+ ); +}; + +export default SubscriptionPlanSkeleton; diff --git a/src/pages/Home/SubscriptionPlans.jsx b/src/pages/Home/SubscriptionPlans.jsx index 6799efb6..24be62f9 100644 --- a/src/pages/Home/SubscriptionPlans.jsx +++ b/src/pages/Home/SubscriptionPlans.jsx @@ -1,6 +1,7 @@ import React, { useState, useEffect } from "react"; import axios from "axios"; import { Link } from "react-router-dom"; +import PlanCardSkeleton from "./PlanCardSkeleton"; const SubscriptionPlans = () => { const [plans, setPlans] = useState([]); @@ -27,10 +28,10 @@ const SubscriptionPlans = () => { const frequencyLabel = (freq) => { switch (freq) { - case 0: return "1mo"; - case 1: return "3mo"; - case 2: return "6mo"; - case 3: return "1yr"; + case 0: return "1 mo"; + case 1: return "3 mo"; + case 2: return "6 mo"; + case 3: return "1 yr"; default: return "mo"; } }; @@ -54,15 +55,20 @@ const SubscriptionPlans = () => { {/* Cards */} -
+
{loading ? ( -
Loading...
+ // Show 3 skeletons + <> + + + + ) : plans.length === 0 ? (
No plans found
) : ( plans.map((plan) => (
-
+
{/* Header */}
@@ -90,7 +96,6 @@ const SubscriptionPlans = () => {
- {/* Features */}
Features @@ -120,7 +125,7 @@ const SubscriptionPlans = () => { to="/auth/reqest/demo" className="btn btn-outline-primary w-100 fw-bold" > - Enquiry + Request a Demo