hide some footer icons in readonly
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
ca6fde4f10
commit
dc3cd20c2d
@ -11,13 +11,14 @@ import { useIntl } from "react-intl";
|
|||||||
|
|
||||||
const MENU_ITEMS = [
|
const MENU_ITEMS = [
|
||||||
{ url: "/", icon: "home" },
|
{ url: "/", icon: "home" },
|
||||||
{ url: "/messages", icon: "mail" },
|
{ url: "/messages", icon: "mail", hideReadOnly: true },
|
||||||
{
|
{
|
||||||
el: (
|
el: (
|
||||||
<div className="flex flex-grow items-center justify-center">
|
<div className="flex flex-grow items-center justify-center">
|
||||||
<NoteCreatorButton alwaysShow={true} />
|
<NoteCreatorButton alwaysShow={true} />
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
|
hideReadOnly: true,
|
||||||
},
|
},
|
||||||
{ url: "/search", icon: "search" },
|
{ url: "/search", icon: "search" },
|
||||||
];
|
];
|
||||||
@ -31,6 +32,9 @@ const Footer = () => {
|
|||||||
const { formatMessage } = useIntl();
|
const { formatMessage } = useIntl();
|
||||||
|
|
||||||
const renderButton = item => {
|
const renderButton = item => {
|
||||||
|
if (readonly && item.hideReadOnly) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (item.el) {
|
if (item.el) {
|
||||||
return item.el;
|
return item.el;
|
||||||
}
|
}
|
||||||
@ -40,7 +44,7 @@ const Footer = () => {
|
|||||||
className={({ isActive }) =>
|
className={({ isActive }) =>
|
||||||
classNames(
|
classNames(
|
||||||
{ "text-nostr-purple": isActive, "hover:text-nostr-purple": !isActive },
|
{ "text-nostr-purple": isActive, "hover:text-nostr-purple": !isActive },
|
||||||
"flex flex-grow p-2 justify-center items-center cursor-pointer",
|
"flex flex-grow p-4 justify-center items-center cursor-pointer",
|
||||||
)
|
)
|
||||||
}>
|
}>
|
||||||
<Icon name={item.icon} width={24} />
|
<Icon name={item.icon} width={24} />
|
||||||
|
Loading…
Reference in New Issue
Block a user