Skip to content

Commit

Permalink
Hide nav menu item "Dashboard" if not configured in config (ohcnetwor…
Browse files Browse the repository at this point in the history
…k#7072)

* Hide dashboard nav menu item if not configured

* remove `dashboard_url` from config
  • Loading branch information
rithviknishad authored Jan 22, 2024
1 parent f6159eb commit 5e08bd4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
3 changes: 1 addition & 2 deletions public/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"dashboard_url": "https://dashboard.coronasafe.in",
"github_url": "https://github.com/coronasafe",
"coronasafe_url": "https://coronasafe.network?ref=care",
"site_url": "care.coronasafe.in",
Expand All @@ -23,4 +22,4 @@
"sample_format_asset_import": "https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=11JaEhNHdyCHth4YQs_44YaRlP77Rrqe81VSEfg1glko&exportFormat=xlsx",
"sample_format_external_result_import": "/External-Results-Template.csv",
"enable_abdm": true
}
}
2 changes: 1 addition & 1 deletion src/Common/hooks/useConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface ILogo {
}

export interface IConfig {
dashboard_url: string;
dashboard_url?: string;
github_url: string;
coronasafe_url: string;
site_url: string;
Expand Down
16 changes: 9 additions & 7 deletions src/Components/Common/Sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,15 @@ const StatelessSidebar = ({
handleOverflow={handleOverflow}
onClickCB={() => onItemClick && onItemClick(false)}
/>
<Item
text="Dashboard"
to={dashboard_url}
icon={<CareIcon className="care-l-dashboard text-lg" />}
external
handleOverflow={handleOverflow}
/>
{dashboard_url && (
<Item
text="Dashboard"
to={dashboard_url}
icon={<CareIcon className="care-l-dashboard text-lg" />}
external
handleOverflow={handleOverflow}
/>
)}
</div>
<div className="hidden md:block md:flex-1" />

Expand Down

0 comments on commit 5e08bd4

Please sign in to comment.