mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix: hide pro label when user becomes pro member
This commit is contained in:
@@ -3,7 +3,6 @@ import { Flex, Box, Text } from "rebass";
|
|||||||
import { useStore as useUserStore } from "../../stores/user-store";
|
import { useStore as useUserStore } from "../../stores/user-store";
|
||||||
|
|
||||||
function Menu(props) {
|
function Menu(props) {
|
||||||
const isPremium = useUserStore((store) => store.user.isPremium);
|
|
||||||
const isTrial = useUserStore(
|
const isTrial = useUserStore(
|
||||||
(store) => store.user?.notesnook?.subscription?.isTrial
|
(store) => store.user?.notesnook?.subscription?.isTrial
|
||||||
);
|
);
|
||||||
@@ -44,13 +43,7 @@ function Menu(props) {
|
|||||||
if (props.closeMenu) {
|
if (props.closeMenu) {
|
||||||
props.closeMenu();
|
props.closeMenu();
|
||||||
}
|
}
|
||||||
|
item.onClick(props.data);
|
||||||
const onlyPro = item.onlyPro && isTrial === undefined;
|
|
||||||
if (onlyPro) {
|
|
||||||
// TODO
|
|
||||||
} else if (item.onClick) {
|
|
||||||
item.onClick(props.data);
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
flexDirection="row"
|
flexDirection="row"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
@@ -72,7 +65,7 @@ function Menu(props) {
|
|||||||
{item.title}
|
{item.title}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
{item.onlyPro && !isPremium && (
|
{item.onlyPro && isTrial === undefined && (
|
||||||
<Text
|
<Text
|
||||||
fontSize="menu"
|
fontSize="menu"
|
||||||
bg="primary"
|
bg="primary"
|
||||||
|
|||||||
Reference in New Issue
Block a user