-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: New outdated marketplace empty state
- Loading branch information
1 parent
e0050c3
commit b6bdc4a
Showing
7 changed files
with
102 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
apps/meteor/client/views/marketplace/AppsPage/UnsupportedEmptyState.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { ComponentMeta, ComponentStory } from '@storybook/react'; | ||
import React from 'react'; | ||
|
||
import UnsupportedEmptyState from './UnsupportedEmptyState'; | ||
|
||
export default { | ||
title: 'Marketplace/Components/UnsupportedEmptyState', | ||
component: UnsupportedEmptyState, | ||
parameters: { | ||
layout: 'fullscreen', | ||
controls: { hideNoControlsWarning: true }, | ||
}, | ||
} as ComponentMeta<typeof UnsupportedEmptyState>; | ||
|
||
export const Default: ComponentStory<typeof UnsupportedEmptyState> = () => <UnsupportedEmptyState />; | ||
Default.storyName = 'UnsupportedEmptyState'; |
34 changes: 34 additions & 0 deletions
34
apps/meteor/client/views/marketplace/AppsPage/UnsupportedEmptyState.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Box, States, StatesIcon, StatesTitle, StatesSubtitle, StatesActions, Button } from '@rocket.chat/fuselage'; | ||
import { usePermission } from '@rocket.chat/ui-contexts'; | ||
import type { ReactElement } from 'react'; | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
import UpdateRocketChatBtn from '../components/UpdateRocketChatBtn'; | ||
|
||
const UnsupportedEmptyState = (): ReactElement => { | ||
const isAdmin = usePermission('manage-apps'); | ||
const { t } = useTranslation(); | ||
|
||
const title = isAdmin ? t('Update_to_access_marketplace') : t('Marketplace_unavailable'); | ||
const description = isAdmin ? t('Update_to_access_marketplace_description') : t('Marketplace_unavailable_description'); | ||
|
||
// Check why <StatesAction> is always primary | ||
return ( | ||
<Box mbs={64}> | ||
<States> | ||
<StatesIcon name='warning' /> | ||
<StatesTitle>{title}</StatesTitle> | ||
<StatesSubtitle>{description}</StatesSubtitle> | ||
<StatesActions> | ||
<Button secondary is='a' href='https://docs.rocket.chat/docs/support-prerequisites' external> | ||
{t('Learn_more')} | ||
</Button> | ||
<UpdateRocketChatBtn /> | ||
</StatesActions> | ||
</States> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default UnsupportedEmptyState; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
apps/meteor/client/views/marketplace/components/UpdateRocketChatBtn.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Button } from '@rocket.chat/fuselage'; | ||
import { usePermission } from '@rocket.chat/ui-contexts'; | ||
import React from 'react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
const UpdateRocketChatBtn = () => { | ||
const isAdmin = usePermission('manage-apps'); | ||
const { t } = useTranslation(); | ||
|
||
return ( | ||
<> | ||
{isAdmin && ( | ||
<Button primary is='a' href='https://docs.rocket.chat/v1/docs/en/updating-rocketchat' external> | ||
{t('Update_RocketChat')} | ||
</Button> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default UpdateRocketChatBtn; |