File tree 2 files changed +25
-11
lines changed
services/web-ui/src/features/blogs/pages
2 files changed +25
-11
lines changed Original file line number Diff line number Diff line change 1
1
import { Fragment , ReactElement } from "react" ;
2
+ import { useNavigate } from "react-router" ;
2
3
3
4
import { ImageList , ImageListItem , Typography } from "@mui/material" ;
4
5
@@ -28,6 +29,7 @@ interface GroupProps {
28
29
29
30
function Group ( { data } : GroupProps ) : ReactElement {
30
31
const groupedData = groupDataByDate ( data ) ;
32
+ const navigate = useNavigate ( ) ;
31
33
32
34
return (
33
35
< >
@@ -40,7 +42,11 @@ function Group({ data }: GroupProps): ReactElement {
40
42
< ImageList cols = { 3 } gap = { 8 } sx = { { m : 0 } } variant = "masonry" >
41
43
{ entries . map ( ( item ) => (
42
44
< ImageListItem key = { item . id } >
43
- < img src = { item . url } loading = "lazy" />
45
+ < img
46
+ src = { item . url }
47
+ loading = "lazy"
48
+ onClick = { ( ) => navigate ( `/blog/${ item . blogId } ` ) }
49
+ />
44
50
</ ImageListItem >
45
51
) ) }
46
52
</ ImageList >
Original file line number Diff line number Diff line change 1
1
import { ReactElement , ReactNode } from "react" ;
2
+ import { Link as ReactRouterLink } from "react-router-dom" ;
3
+
4
+ import { ArrowBack } from "@mui/icons-material" ;
5
+ import { IconButton } from "@mui/material" ;
2
6
3
- import { NavLayout } from "src/components/layout" ;
4
7
import { Nav } from "src/components/nav" ;
5
- import { useTranslation } from "src/core/i18n" ;
6
8
7
9
interface BlogPostPageNavProps {
8
10
children : ReactNode ;
@@ -11,13 +13,19 @@ interface BlogPostPageNavProps {
11
13
export function BlogPostPageNav ( {
12
14
children,
13
15
} : BlogPostPageNavProps ) : ReactElement {
14
- const { t } = useTranslation ( "blog" ) ;
15
-
16
- return (
17
- < Nav >
18
- < NavLayout linkText = { t ( "links.back" ) } to = "/" >
19
- { children }
20
- </ NavLayout >
21
- </ Nav >
16
+ const appBarContent = (
17
+ < >
18
+ < IconButton
19
+ component = { ReactRouterLink }
20
+ sx = { {
21
+ mr : 2 ,
22
+ } }
23
+ to = "/"
24
+ >
25
+ < ArrowBack />
26
+ </ IconButton >
27
+ </ >
22
28
) ;
29
+
30
+ return < Nav appBarContent = { appBarContent } > { children } </ Nav > ;
23
31
}
You can’t perform that action at this time.
0 commit comments