Skip to content

Commit

Permalink
FIX: Unstract Payment Integration Related Improvements in the Plugins…
Browse files Browse the repository at this point in the history
… Usage (#1104)

* Added a conditional top navbar dropdown link for the pricing page

* Updated the route from /subscription-plans to /pricing
  • Loading branch information
tahierhussain authored Jan 31, 2025
1 parent 10f48e0 commit 33978af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 10 additions & 0 deletions frontend/src/components/navigations/top-nav-bar/TopNavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ try {
let unstractSubscriptionPlan;
let unstractSubscriptionPlanStore;
let UNSTRACT_SUBSCRIPTION_PLANS;
let UnstractPricingMenuLink;
try {
unstractSubscriptionPlanStore = require("../../../plugins/store/unstract-subscription-plan-store");
UNSTRACT_SUBSCRIPTION_PLANS =
require("../../../plugins/unstract-subscription/helper/constants").UNSTRACT_SUBSCRIPTION_PLANS;
UnstractPricingMenuLink =
require("../../../plugins/unstract-subscription/components/UnstractPricingMenuLink.jsx").UnstractPricingMenuLink;
} catch (err) {
// Plugin unavailable.
}
Expand Down Expand Up @@ -294,6 +297,13 @@ function TopNavBar({ isSimpleLayout, topNavBarOptions }) {
});
}

if (isUnstract && UnstractPricingMenuLink) {
menuItems.push({
key: "7",
label: <UnstractPricingMenuLink orgName={orgName} />,
});
}

// Logout
menuItems.push({
key: "2",
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/routes/useMainAppRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ function useMainAppRoutes() {
<Route path="dashboard" element={<UnstractUsagePage />} />
)}
{UnstractSubscriptionPage && (
<Route
path="subscription-plans"
element={<UnstractSubscriptionPage />}
/>
<Route path="pricing" element={<UnstractSubscriptionPage />} />
)}
<Route path="profile" element={<ProfilePage />} />
<Route
Expand Down

0 comments on commit 33978af

Please sign in to comment.