Skip to content

Commit

Permalink
design changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchoeler committed Sep 18, 2024
1 parent 664ac5b commit 1570964
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Box, Skeleton } from '@rocket.chat/fuselage';
import { usePermission } from '@rocket.chat/ui-contexts';
import React from 'react';

import { useLicense } from '../../../hooks/useLicense';
Expand All @@ -9,13 +8,12 @@ import PrivateEmptyStateUpgrade from './PrivateEmptyStateUpgrade';
const PrivateEmptyState = () => {
const { data, isLoading } = useLicense({ loadValues: true });
const { limits } = data || {};
const isAdmin = usePermission('manage-apps');

if (isLoading) {
return <Skeleton />;
}

return <Box mbs='24px'>{isAdmin && limits?.privateApps?.max === 0 ? <PrivateEmptyStateUpgrade /> : <PrivateEmptyStateDefault />}</Box>;
return <Box mbs='24px'>{limits?.privateApps?.max === 0 ? <PrivateEmptyStateUpgrade /> : <PrivateEmptyStateDefault />}</Box>;
};

export default PrivateEmptyState;
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
import { States, StatesIcon, StatesTitle, StatesSubtitle, StatesActions } from '@rocket.chat/fuselage';
import { usePermission } from '@rocket.chat/ui-contexts';
import React from 'react';
import { useTranslation } from 'react-i18next';

import UpgradeButton from '../../admin/subscription/components/UpgradeButton';

const PrivateEmptyStateUpgrade = () => {
const { t } = useTranslation();
const isAdmin = usePermission('manage-apps');

return (
<States>
<StatesIcon name='cube' />
<StatesIcon name='lightning' />
<StatesTitle>{t('Private_apps_upgrade_empty_state_title')}</StatesTitle>
<StatesSubtitle>{t('Private_apps_upgrade_empty_state_description')}</StatesSubtitle>
<StatesActions>
<UpgradeButton primary icon={undefined} target='private-apps-header' action='upgrade'>
{t('Upgrade')}
</UpgradeButton>
</StatesActions>
{isAdmin && (
<StatesActions>
<UpgradeButton primary icon={undefined} target='private-apps-header' action='upgrade'>
{t('Upgrade')}
</UpgradeButton>
</StatesActions>
)}
</States>
);
};
Expand Down

0 comments on commit 1570964

Please sign in to comment.