Skip to content

Commit

Permalink
chore: adjusted footer watermark to license v3
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandernsilva committed Oct 5, 2023
1 parent c15dd76 commit 50bac2f
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import { Box } from '@rocket.chat/fuselage';
import type { ILicenseV3 } from '@rocket.chat/license';
import { useTranslation } from '@rocket.chat/ui-contexts';
import type { ReactElement } from 'react';
import React from 'react';

import { useLicense } from '../../../../client/hooks/useLicense';
import { useHasLicenseModule } from '../../hooks/useHasLicenseModule';

export const SidebarFooterWatermark = (): ReactElement | null => {
const t = useTranslation();

const { data } = useLicense();
const [license] = (data?.licenses ?? []) as (ILicenseV3 & { modules: string[] })[]; // TODO: temporary, remover after #30473 is merged
const [planTag] = license.information?.tags ?? [];
const { data: { license, activeModules = [] } = {} } = useLicense();
const [planTag] = license?.information?.tags ?? [];

const isWatermarkVisible = useHasLicenseModule('watermark') === true;
const isWatermarkVisible = activeModules.includes('watermark');

if (!isWatermarkVisible) {
return null;
Expand Down

0 comments on commit 50bac2f

Please sign in to comment.