diff --git a/apps/meteor/ee/client/sidebar/footer/SidebarFooterWatermark.tsx b/apps/meteor/ee/client/sidebar/footer/SidebarFooterWatermark.tsx index 8fc2bfa5c94c..353fd213e526 100644 --- a/apps/meteor/ee/client/sidebar/footer/SidebarFooterWatermark.tsx +++ b/apps/meteor/ee/client/sidebar/footer/SidebarFooterWatermark.tsx @@ -3,17 +3,25 @@ import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; -import { useIsEnterprise } from '../../../../client/hooks/useIsEnterprise'; +import { useLicense } from '../../../../client/hooks/useLicense'; export const SidebarFooterWatermark = (): ReactElement | null => { const t = useTranslation(); - const { isLoading, isError, data } = useIsEnterprise(); + const response = useLicense(); - if (isError || isLoading || data?.isEnterprise) { + if (response.isLoading || response.isError) { return null; } + const license = response.data; + + if (license.activeModules.includes('hide-watermark') && !license.trial) { + return null; + } + + const [{ name: planName } = { name: 'Community' }] = license.tags ?? []; + return ( @@ -21,7 +29,7 @@ export const SidebarFooterWatermark = (): ReactElement | null => { {t('Powered_by_RocketChat')} - {t('Free_Edition')} + {[planName, license.trial ? 'trial' : ''].filter(Boolean).join(' ')} diff --git a/ee/packages/license/src/definition/LicenseModule.ts b/ee/packages/license/src/definition/LicenseModule.ts index 8ecebba1983b..a67a3fd54cb0 100644 --- a/ee/packages/license/src/definition/LicenseModule.ts +++ b/ee/packages/license/src/definition/LicenseModule.ts @@ -15,4 +15,5 @@ export type LicenseModule = | 'federation' | 'videoconference-enterprise' | 'message-read-receipt' - | 'outlook-calendar'; + | 'outlook-calendar' + | 'hide-watermark';