From 3ff80ee0320d41b766b57cffc981233caaae85ae Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Sat, 13 Dec 2025 11:20:16 +0530 Subject: [PATCH] Sorting in Subscription page. --- src/pages/Home/SubscriptionPlans.jsx | 99 ++++++++++++++-------------- 1 file changed, 51 insertions(+), 48 deletions(-) diff --git a/src/pages/Home/SubscriptionPlans.jsx b/src/pages/Home/SubscriptionPlans.jsx index 8637e121..cdf33454 100644 --- a/src/pages/Home/SubscriptionPlans.jsx +++ b/src/pages/Home/SubscriptionPlans.jsx @@ -104,61 +104,64 @@ const SubscriptionPlans = () => {
{plan.features?.modules && - Object.entries(plan.features.modules).map(([key, mod]) => { - if (!mod || !mod.name) return null; + Object.entries(plan.features.modules) + .sort(([, a], [, b]) => Number(b.enabled) - Number(a.enabled)) + .map(([key, mod]) => { - return ( -
-

- +

+ +
- - {mod.enabled ? ( - +
+ {mod.features?.length > 0 ? ( +
    + {mod.features.map((feat) => ( +
  • + + {feat.name} +
  • + ))} +
) : ( - +

No additional features

)} - {mod.name} - - - - - - -
-
- {mod.features?.length > 0 ? ( -
    - {mod.features.map((feat) => ( -
  • - - {feat.name} -
  • - ))} -
- ) : ( -

No additional features

- )} +
-
- ); - })} + ); + })}