Skip to content

Commit 4777742

Browse files
juliajforestiMartinSchoeler
authored andcommitted
feat: add theme palette to AppErrorPage (#36321)
1 parent 14906c3 commit 4777742

File tree

2 files changed

+34
-23
lines changed

2 files changed

+34
-23
lines changed

.changeset/big-bees-crash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket.chat/meteor': minor
3+
---
4+
5+
Adds theme palette to Application error page

apps/meteor/client/views/root/AppErrorPage.tsx

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Box, States, StatesAction, StatesActions, StatesIcon, StatesSubtitle, StatesTitle } from '@rocket.chat/fuselage';
1+
import { Box, PaletteStyleTag, States, StatesAction, StatesActions, StatesIcon, StatesSubtitle, StatesTitle } from '@rocket.chat/fuselage';
2+
import { useThemeMode } from '@rocket.chat/ui-theming';
23
import type { ErrorInfo, ReactElement } from 'react';
34

45
type AppErrorPageProps = {
@@ -8,30 +9,35 @@ type AppErrorPageProps = {
89
};
910

1011
const AppErrorPage = (_props: AppErrorPageProps): ReactElement => {
12+
const [, , theme] = useThemeMode();
13+
1114
return (
12-
<Box display='flex' justifyContent='center' height='full' backgroundColor='surface'>
13-
<States>
14-
<StatesIcon name='error-circle' />
15-
<StatesTitle>Application Error</StatesTitle>
16-
<StatesSubtitle>The application GUI just crashed.</StatesSubtitle>
15+
<>
16+
<PaletteStyleTag theme={theme} tagId='app-error-palette' />
17+
<Box display='flex' justifyContent='center' height='full' backgroundColor='surface'>
18+
<States>
19+
<StatesIcon name='error-circle' />
20+
<StatesTitle>Application Error</StatesTitle>
21+
<StatesSubtitle>The application GUI just crashed.</StatesSubtitle>
1722

18-
<StatesActions>
19-
<StatesAction
20-
onClick={() => {
21-
const result = indexedDB.deleteDatabase('MeteorDynamicImportCache');
22-
result.onsuccess = () => {
23-
window.location.reload();
24-
};
25-
result.onerror = () => {
26-
window.location.reload();
27-
};
28-
}}
29-
>
30-
Reload Application
31-
</StatesAction>
32-
</StatesActions>
33-
</States>
34-
</Box>
23+
<StatesActions>
24+
<StatesAction
25+
onClick={() => {
26+
const result = indexedDB.deleteDatabase('MeteorDynamicImportCache');
27+
result.onsuccess = () => {
28+
window.location.reload();
29+
};
30+
result.onerror = () => {
31+
window.location.reload();
32+
};
33+
}}
34+
>
35+
Reload Application
36+
</StatesAction>
37+
</StatesActions>
38+
</States>
39+
</Box>
40+
</>
3541
);
3642
};
3743

0 commit comments

Comments
 (0)