feat: filter nav sidebar
This commit is contained in:
@ -22,6 +22,7 @@
|
|||||||
"signUp": {
|
"signUp": {
|
||||||
"moderation": true
|
"moderation": true
|
||||||
},
|
},
|
||||||
|
"hideFromNavbar": ["/graph"],
|
||||||
"eventLinkPrefix": "nevent",
|
"eventLinkPrefix": "nevent",
|
||||||
"profileLinkPrefix": "nprofile",
|
"profileLinkPrefix": "nprofile",
|
||||||
"defaultRelays": {
|
"defaultRelays": {
|
||||||
|
1
packages/app/custom.d.ts
vendored
1
packages/app/custom.d.ts
vendored
@ -63,6 +63,7 @@ declare const CONFIG: {
|
|||||||
signUp: {
|
signUp: {
|
||||||
moderation: boolean;
|
moderation: boolean;
|
||||||
};
|
};
|
||||||
|
hideFromNavbar?: Array<string>;
|
||||||
eventLinkPrefix: NostrPrefix;
|
eventLinkPrefix: NostrPrefix;
|
||||||
profileLinkPrefix: NostrPrefix;
|
profileLinkPrefix: NostrPrefix;
|
||||||
defaultRelays: Record<string, RelaySettings>;
|
defaultRelays: Record<string, RelaySettings>;
|
||||||
|
@ -80,7 +80,7 @@ export default function NavSidebar({ narrow = false }) {
|
|||||||
<LogoHeader showText={!narrow} />
|
<LogoHeader showText={!narrow} />
|
||||||
<div className="flex-grow flex flex-col justify-between">
|
<div className="flex-grow flex flex-col justify-between">
|
||||||
<div className={classNames({ "xl:items-start": !narrow }, "flex flex-col items-center font-bold text-lg")}>
|
<div className={classNames({ "xl:items-start": !narrow }, "flex flex-col items-center font-bold text-lg")}>
|
||||||
{MENU_ITEMS.map(item => {
|
{MENU_ITEMS.filter(a => !(CONFIG.hideFromNavbar ?? []).includes(a.link)).map(item => {
|
||||||
if (!item.nonLoggedIn && !publicKey) {
|
if (!item.nonLoggedIn && !publicKey) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user