Skip to content
Snippets Groups Projects
Unverified Commit fd23913a authored by Aleksander Nicacio da Silva's avatar Aleksander Nicacio da Silva Committed by GitHub
Browse files

chore: NBJ watermark support for new licenses (#30469)

parent ef12ac5b
No related branches found
No related tags found
No related merge requests found
......@@ -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 (
<Box pi={16} pbe={8}>
<Box is='a' href='https://rocket.chat/' target='_blank' rel='noopener noreferrer'>
......@@ -21,7 +29,7 @@ export const SidebarFooterWatermark = (): ReactElement | null => {
{t('Powered_by_RocketChat')}
</Box>
<Box fontScale='micro' color='pure-white' pbe={4}>
{t('Free_Edition')}
{[planName, license.trial ? 'trial' : ''].filter(Boolean).join(' ')}
</Box>
</Box>
</Box>
......
......@@ -15,4 +15,5 @@ export type LicenseModule =
| 'federation'
| 'videoconference-enterprise'
| 'message-read-receipt'
| 'outlook-calendar';
| 'outlook-calendar'
| 'hide-watermark';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment