From ed3edb58588cd111be4961f5df61fc2e0bc4bfeb Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 25 Oct 2023 00:26:54 -0300 Subject: [PATCH] review --- .../sidebar/footer/SidebarFooterWatermark.tsx | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/apps/meteor/ee/client/sidebar/footer/SidebarFooterWatermark.tsx b/apps/meteor/ee/client/sidebar/footer/SidebarFooterWatermark.tsx index 549b4ca9df39c..f0f0ce8cca513 100644 --- a/apps/meteor/ee/client/sidebar/footer/SidebarFooterWatermark.tsx +++ b/apps/meteor/ee/client/sidebar/footer/SidebarFooterWatermark.tsx @@ -1,4 +1,4 @@ -import { Box, Skeleton } from '@rocket.chat/fuselage'; +import { Box } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; @@ -8,28 +8,29 @@ import { useLicense } from '../../../../client/hooks/useLicense'; export const SidebarFooterWatermark = (): ReactElement | null => { const t = useTranslation(); - const { data: { activeModules = [], trial: isTrial = false, tags } = {}, isLoading, isError } = useLicense(); - const [{ name: planName }] = tags ?? [{ name: 'Community' }]; + const response = useLicense(); - const isWatermarkHidden = !isTrial && activeModules.includes('hide-watermark'); + if (response.isLoading || response.isError) { + return null; + } + + const license = response.data; - if (isWatermarkHidden) { + if (license.activeModules.includes('hide-watermark') && !license.trial) { return null; } + const [{ name: planName }] = license.tags ?? [{ name: 'Community' }]; + return ( {t('Powered_by_RocketChat')} - {isLoading || isError ? ( - - ) : ( - - {planName} {isTrial ? 'trial' : ''} - - )} + + {[planName, license.trial ? 'trial' : ''].filter(Boolean).join(' ')} + );