Skip to content

Commit

Permalink
hide some footer icons in readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalmi committed Dec 4, 2023
1 parent ca6fde4 commit dc3cd20
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/app/src/Pages/Layout/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ import { useIntl } from "react-intl";

const MENU_ITEMS = [
{ url: "/", icon: "home" },
{ url: "/messages", icon: "mail" },
{ url: "/messages", icon: "mail", hideReadOnly: true },
{
el: (
<div className="flex flex-grow items-center justify-center">
<NoteCreatorButton alwaysShow={true} />
</div>
),
hideReadOnly: true,
},
{ url: "/search", icon: "search" },
];
Expand All @@ -31,6 +32,9 @@ const Footer = () => {
const { formatMessage } = useIntl();

const renderButton = item => {
if (readonly && item.hideReadOnly) {
return null;
}
if (item.el) {
return item.el;
}
Expand All @@ -40,7 +44,7 @@ const Footer = () => {
className={({ isActive }) =>
classNames(
{ "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} />
Expand Down

0 comments on commit dc3cd20

Please sign in to comment.