Skip to content

Commit

Permalink
feat: add 'homepage' btn on 'room not found' page
Browse files Browse the repository at this point in the history
  • Loading branch information
guijun13 committed Aug 8, 2022
1 parent c3e15ac commit 1dc3c66
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/meteor/client/views/room/Room/RoomNotFound/RoomNotFound.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { States, StatesIcon, StatesTitle, StatesSubtitle, Box } from '@rocket.chat/fuselage';
import { useLayout, useTranslation } from '@rocket.chat/ui-contexts';
import { States, StatesIcon, StatesTitle, StatesSubtitle, Box, StatesActions, StatesAction } from '@rocket.chat/fuselage';
import { useLayout, useRoute, useTranslation } from '@rocket.chat/ui-contexts';
import React, { ReactElement } from 'react';

import BurgerMenu from '../../../../components/BurgerMenu';
Expand All @@ -9,6 +9,11 @@ import { RoomTemplate } from '../../components/RoomTemplate/RoomTemplate';
const RoomNotFound = (): ReactElement => {
const { isMobile } = useLayout();
const t = useTranslation();
const homeRoute = useRoute('home');

const handleGoHomeClick = (): void => {
homeRoute.push();
};

return (
<RoomTemplate>
Expand All @@ -27,6 +32,9 @@ const RoomNotFound = (): ReactElement => {
<StatesIcon name='magnifier' />
<StatesTitle>{t('Room_not_found')}</StatesTitle>
<StatesSubtitle>{t('Room_not_exist_or_not_permission')}</StatesSubtitle>
<StatesActions mbs='x16'>
<StatesAction onClick={handleGoHomeClick}>{t('Homepage')}</StatesAction>
</StatesActions>
</States>
</Box>
</RoomTemplate.Body>
Expand Down

0 comments on commit 1dc3c66

Please sign in to comment.