This repository was archived by the owner on Feb 3, 2025. It is now read-only.
File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import prettyBytes from 'pretty-bytes';
30
30
import { NextLink } from '@mantine/next' ;
31
31
import relativeTime from 'dayjs/plugin/relativeTime' ;
32
32
import { ReactNode , useEffect , useState } from 'react' ;
33
+ import { useRouter } from 'next/router' ;
33
34
import { AppRouter } from '../server/trpc/router' ;
34
35
import { trpc } from '../utils/trpc' ;
35
36
import { MadeWith } from './madeWith' ;
@@ -48,6 +49,9 @@ const useStyles = createStyles((theme) => ({
48
49
history : {
49
50
textDecoration : 'none' ,
50
51
} ,
52
+ historyItem : {
53
+ cursor : 'pointer' ,
54
+ } ,
51
55
badge : {
52
56
padding : 5 ,
53
57
minWidth : 20 ,
@@ -142,13 +146,16 @@ function HistoryItem({ chapter }: { chapter: HistoryItemType }) {
142
146
143
147
function History ( { data } : { data : HistoryType } ) {
144
148
const { classes } = useStyles ( ) ;
149
+ const router = useRouter ( ) ;
145
150
146
151
return (
147
152
< Timeline lineWidth = { 2 } className = { classes . history } >
148
153
{ data . map ( ( chapter ) => {
149
154
return (
150
155
< Timeline . Item
151
156
key = { chapter . id }
157
+ className = { classes . historyItem }
158
+ onClick = { ( ) => router . push ( `/manga/${ chapter . mangaId } ` ) }
152
159
lineVariant = "dotted"
153
160
bullet = { < Image mt = { 20 } alt = "header" src = { chapter . manga . metadata . cover } height = { 40 } width = { 26 } /> }
154
161
title = { < HistoryItemTitle chapter = { chapter } /> }
You can’t perform that action at this time.
0 commit comments