mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-29 18:26:34 +02:00
♻️ Refactor logic for showing upgrade button
This commit is contained in:
parent
c208b460aa
commit
9ceb27f6e3
1 changed files with 3 additions and 4 deletions
|
@ -21,7 +21,7 @@ import { Logo } from "@/components/logo";
|
||||||
import { Trans } from "@/components/trans";
|
import { Trans } from "@/components/trans";
|
||||||
import { UserDropdown } from "@/components/user-dropdown";
|
import { UserDropdown } from "@/components/user-dropdown";
|
||||||
import { IfCloudHosted } from "@/contexts/environment";
|
import { IfCloudHosted } from "@/contexts/environment";
|
||||||
import { IfFreeUser } from "@/contexts/plan";
|
import { useSubscription } from "@/contexts/plan";
|
||||||
import { appVersion, isFeedbackEnabled } from "@/utils/constants";
|
import { appVersion, isFeedbackEnabled } from "@/utils/constants";
|
||||||
|
|
||||||
import { IconComponent, NextPageWithLayout } from "../../types";
|
import { IconComponent, NextPageWithLayout } from "../../types";
|
||||||
|
@ -97,6 +97,7 @@ const Changelog = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const MainNav = () => {
|
const MainNav = () => {
|
||||||
|
const subscription = useSubscription();
|
||||||
return (
|
return (
|
||||||
<m.div
|
<m.div
|
||||||
variants={{
|
variants={{
|
||||||
|
@ -122,9 +123,7 @@ const MainNav = () => {
|
||||||
<div className="flex items-center gap-x-2.5">
|
<div className="flex items-center gap-x-2.5">
|
||||||
<nav className="flex items-center gap-x-1 sm:gap-x-1.5">
|
<nav className="flex items-center gap-x-1 sm:gap-x-1.5">
|
||||||
<IfCloudHosted>
|
<IfCloudHosted>
|
||||||
<IfFreeUser>
|
{subscription?.active === false ? <Upgrade /> : null}
|
||||||
<Upgrade />
|
|
||||||
</IfFreeUser>
|
|
||||||
</IfCloudHosted>
|
</IfCloudHosted>
|
||||||
<IfGuest>
|
<IfGuest>
|
||||||
<Button
|
<Button
|
||||||
|
|
Loading…
Add table
Reference in a new issue