mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 09:28:06 +00:00
Hide usage and billing from Navbar in self-hosted
This commit is contained in:
@@ -20,7 +20,7 @@ import { Menu, Transition } from "@headlessui/react";
|
|||||||
import {TFunction} from "i18next";
|
import {TFunction} from "i18next";
|
||||||
|
|
||||||
import guidGenerator from "@app/components/utilities/randomId";
|
import guidGenerator from "@app/components/utilities/randomId";
|
||||||
import { useOrganization, useUser } from "@app/context";
|
import { useOrganization, useSubscription,useUser } from "@app/context";
|
||||||
import { useLogoutUser } from "@app/hooks/api";
|
import { useLogoutUser } from "@app/hooks/api";
|
||||||
|
|
||||||
const supportOptions = (t: TFunction) => [
|
const supportOptions = (t: TFunction) => [
|
||||||
@@ -63,6 +63,9 @@ export interface IUser {
|
|||||||
*/
|
*/
|
||||||
export const Navbar = () => {
|
export const Navbar = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const { subscription } = useSubscription();
|
||||||
|
|
||||||
|
console.log("subscription: ", subscription);
|
||||||
|
|
||||||
const { currentOrg, orgs } = useOrganization();
|
const { currentOrg, orgs } = useOrganization();
|
||||||
const { user } = useUser();
|
const { user } = useUser();
|
||||||
@@ -220,22 +223,24 @@ export const Navbar = () => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
{subscription && subscription.slug !== null && (
|
||||||
// onClick={buttonAction}
|
<button
|
||||||
type="button"
|
// onClick={buttonAction}
|
||||||
className="w-full cursor-pointer"
|
type="button"
|
||||||
>
|
className="w-full cursor-pointer"
|
||||||
<div
|
|
||||||
onKeyDown={() => null}
|
|
||||||
role="button"
|
|
||||||
tabIndex={0}
|
|
||||||
onClick={() => router.push(`/settings/billing/${router.query.id}`)}
|
|
||||||
className="relative mt-1 flex cursor-pointer select-none justify-start rounded-md py-2 px-2 text-gray-400 duration-200 hover:bg-white/5 hover:text-gray-200"
|
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon className="pl-1.5 pr-3 text-lg" icon={faCoins} />
|
<div
|
||||||
<div className="text-sm">{t("nav.user.usage-billing")}</div>
|
onKeyDown={() => null}
|
||||||
</div>
|
role="button"
|
||||||
</button>
|
tabIndex={0}
|
||||||
|
onClick={() => router.push(`/settings/billing/${router.query.id}`)}
|
||||||
|
className="relative mt-1 flex cursor-pointer select-none justify-start rounded-md py-2 px-2 text-gray-400 duration-200 hover:bg-white/5 hover:text-gray-200"
|
||||||
|
>
|
||||||
|
<FontAwesomeIcon className="pl-1.5 pr-3 text-lg" icon={faCoins} />
|
||||||
|
<div className="text-sm">{t("nav.user.usage-billing")}</div>
|
||||||
|
</div>
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
// onClick={buttonAction}
|
// onClick={buttonAction}
|
||||||
|
|||||||
Reference in New Issue
Block a user