Skip to content

Commit 99fce31

Browse files
johanbookJohan Book
and
Johan Book
authored
fix(web-ui): improve styling for blog error view (#827)
Co-authored-by: Johan Book <{ID}+{username}@users.noreply.github.com>
1 parent 228f00d commit 99fce31

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

services/web-ui/public/locales/en/blog.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"comments": {
2323
"placeholder": "Leave a comment"
2424
},
25+
"error": "Unable to fetch blog posts",
2526
"form": {
2627
"placeholder": "Perhaps say something about your day"
2728
},

services/web-ui/public/locales/sv/blog.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"comments": {
2323
"placeholder": "Lämna en kommentar"
2424
},
25+
"error": "Kunde inte hämta blogposter",
2526
"form": {
2627
"placeholder": "Säg något om din dag"
2728
},

services/web-ui/src/features/blogs/pages/BlogPostListPage/BlogPostListPage.container.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { ReactElement } from "react";
33
import { Box, Typography } from "@mui/material";
44

55
import { blogsApi } from "src/apis";
6-
import { ErrorMessage } from "src/components/ui/ErrorMessage";
76
import { useTranslation } from "src/core/i18n";
87
import { InteractionObserver } from "src/core/infinite-scroll";
98
import { CacheKeysConstants, useInfiniteQuery } from "src/core/query";
109
import { useMetaData } from "src/hooks/useMetaData";
10+
import { ErrorView } from "src/views/ErrorView";
1111

1212
import { BlogPostForm } from "../../components/BlogPostForm";
1313
import { BlogPostPageComponent } from "./BlogPostListPage.component";
@@ -42,7 +42,7 @@ export function BlogPostListPageContainer(): ReactElement {
4242
if (error) {
4343
return (
4444
<BlogPostListPageNav>
45-
<ErrorMessage error={error} />
45+
<ErrorView message={t("error")} />
4646
</BlogPostListPageNav>
4747
);
4848
}

services/web-ui/src/views/ErrorView/ErrorView.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { Box, Typography } from "@mui/material";
55

66
interface ErrorViewProps {
77
description?: string;
8-
message?: string;
8+
message?: string | null;
99
}
1010

1111
export function ErrorView({
1212
description,
13-
message="Un unexpected error occured",
13+
message = "Un unexpected error occured",
1414
}: ErrorViewProps): ReactElement {
1515
return (
1616
<Box

0 commit comments

Comments
 (0)