File tree 9 files changed +39
-27
lines changed
9 files changed +39
-27
lines changed Original file line number Diff line number Diff line change 15
15
"order_t7" : " Projects" ,
16
16
"order_t8" : " Items" ,
17
17
"order_t9" : " Welcome to recommend" ,
18
+ "vol_prev" : " Previous" ,
19
+ "vol_next" : " Next" ,
18
20
"page_prev" : " Previous" ,
19
21
"page_next" : " Next" ,
20
22
"category" : {
Original file line number Diff line number Diff line change 15
15
"order_t7" : " 项目数" ,
16
16
"order_t8" : " 个" ,
17
17
"order_t9" : " 欢迎推荐和自荐项目" ,
18
+ "vol_prev" : " 上一期" ,
19
+ "vol_next" : " 下一期" ,
18
20
"page_prev" : " 上一页" ,
19
21
"page_next" : " 下一页" ,
20
22
"category" : {
Original file line number Diff line number Diff line change 1
- import RcImage , { ImageProps } from 'rc-image' ;
1
+ import RcImage from 'rc-image' ;
2
2
import { useEffect , useState } from 'react' ;
3
3
import { AiOutlineClose } from 'react-icons/ai' ;
4
4
@@ -8,11 +8,13 @@ import GifPlayButton from './loading/GifPlayButton';
8
8
9
9
const gifCoverImage = '!gif' ;
10
10
11
- const ImageWithPreview = ( props : ImageProps ) => {
11
+ const ImageWithPreview = ( props : {
12
+ src : string ;
13
+ alt : string ;
14
+ [ key : string ] : any ;
15
+ } ) => {
12
16
const [ imgSrc , setImgSrc ] = useState (
13
- props . src ?. endsWith ( 'gif' )
14
- ? `${ props . src } ${ gifCoverImage } `
15
- : ( props . src as string )
17
+ props . src ?. endsWith ( 'gif' ) ? `${ props . src } ${ gifCoverImage } ` : props . src
16
18
) ;
17
19
const isGifThumb = imgSrc . endsWith ( gifCoverImage ) ;
18
20
const isGif = imgSrc ?. endsWith ( 'gif' ) && ! isGifThumb ;
@@ -22,11 +24,11 @@ const ImageWithPreview = (props: ImageProps) => {
22
24
if ( props . src ?. endsWith ( 'gif' ) ) {
23
25
setImgSrc ( `${ props . src } ${ gifCoverImage } ` ) ;
24
26
} else {
25
- setImgSrc ( props . src as string ) ;
27
+ setImgSrc ( props . src ) ;
26
28
}
27
29
} , [ props . src ] ) ;
28
30
29
- const handleLoadGif = ( e : any ) => {
31
+ const handleLoadGif = ( e : React . MouseEvent ) => {
30
32
e . stopPropagation ( ) ;
31
33
setTimeout ( ( ) => {
32
34
if ( sourceIsGif ) {
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ const HeaderBtn = (props: HeaderBtnProps) => {
15
15
16
16
return (
17
17
< Button
18
- className = 'font-normal text-current hover:bg-transparent dark:text-gray-300 dark: hover:bg-gray-700 '
18
+ className = 'font-normal text-current hover:bg-transparent dark:hover:bg-transparent '
19
19
variant = 'ghost'
20
20
onClick = { debounce ( ( ) => {
21
21
router . push ( pathname ) ;
Original file line number Diff line number Diff line change @@ -28,10 +28,11 @@ const Header = () => {
28
28
29
29
const liClassName = ( path : string ) =>
30
30
classNames (
31
- 'hidden md:block hover:font-bold hover:text-gray-800 hover:border-blue-500 hover:border-b-2 h-12' ,
31
+ 'hidden md:block hover:font-bold hover:text-gray-700 dark:hover:text-gray-100 hover:border-blue-500 hover:border-b-2 h-12' ,
32
32
{
33
- 'text-blue-500' : curPath === path ,
34
- 'text-gray-500' : curPath !== path ,
33
+ 'text-blue-500' :
34
+ curPath === path || ( path !== '/' && curPath . startsWith ( path ) ) ,
35
+ 'text-gray-500 dark:text-gray-300' : curPath !== path ,
35
36
}
36
37
) ;
37
38
Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ type PaginationProps = {
12
12
13
13
export default function Pagination ( {
14
14
className,
15
- PreviousText = '上一期' ,
16
- NextText = '下一期' ,
15
+ PreviousText,
16
+ NextText,
17
17
total,
18
18
current = 1 ,
19
19
onPageChange,
@@ -56,13 +56,13 @@ export default function Pagination({
56
56
return (
57
57
< div className = { clsxm ( '' , className ) } { ...rest } >
58
58
< nav className = 'flex items-center justify-center space-x-2' >
59
- < a
59
+ < div
60
60
onClick = { ( ) => handlePageChange ( page - 1 ) }
61
61
className = { JumpBtnClass ( - 1 ) }
62
62
>
63
63
< span aria-hidden = 'true' > «</ span >
64
64
< span > { PreviousText } </ span >
65
- </ a >
65
+ </ div >
66
66
67
67
< input
68
68
type = 'number'
@@ -91,13 +91,13 @@ export default function Pagination({
91
91
< span className = 'mx-0 inline-flex h-10 w-10 items-center rounded-full p-4 font-medium text-gray-500 dark:text-gray-400' >
92
92
{ total }
93
93
</ span >
94
- < a
94
+ < div
95
95
onClick = { ( ) => handlePageChange ( page + 1 ) }
96
96
className = { JumpBtnClass ( 1 ) }
97
97
>
98
98
< span > { NextText } </ span >
99
99
< span aria-hidden = 'true' > »</ span >
100
- </ a >
100
+ </ div >
101
101
</ nav >
102
102
</ div >
103
103
) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import { useTranslation } from 'next-i18next';
3
3
import { serverSideTranslations } from 'next-i18next/serverSideTranslations' ;
4
4
5
5
import ItemBottom from '@/components/home/ItemBottom' ;
6
- import ImageWithPreview from '@/components/ImageWithPreview' ;
7
6
import { MDRender } from '@/components/mdRender/MDRender' ;
8
7
import Navbar from '@/components/navbar/Navbar' ;
9
8
import Seo from '@/components/Seo' ;
@@ -29,8 +28,8 @@ const ArticlePage: NextPage<ArticleProps> = ({ article }) => {
29
28
</ article >
30
29
{ i18n . language === 'zh' ? (
31
30
< div className = 'my-2 flex justify-center' >
32
- < ImageWithPreview
33
- className = 'hidden cursor-zoom-in rounded-lg md:block'
31
+ < img
32
+ className = 'hidden rounded-lg md:block'
34
33
src = 'https://img.hellogithub.com/ad/footer.png'
35
34
alt = 'weixin_footer'
36
35
/>
Original file line number Diff line number Diff line change @@ -88,7 +88,13 @@ const PeriodicalCategoryPage: NextPage<CategoryPageProps> = ({ category }) => {
88
88
</ div >
89
89
90
90
{ allItems ?. map ( ( item : PeriodicalItem , index : number ) => {
91
- return < PeriodItem key = { index } item = { item } index = { index } /> ;
91
+ return (
92
+ < PeriodItem
93
+ key = { index }
94
+ item = { item }
95
+ index = { ( category ?. current_page - 1 ) * 10 + index }
96
+ />
97
+ ) ;
92
98
} ) }
93
99
</ div >
94
100
Original file line number Diff line number Diff line change @@ -233,8 +233,8 @@ const PeriodicalVolumePage: NextPage<VolumePageProps> = ({ volume }) => {
233
233
total = { volume ?. total }
234
234
current = { volume ?. current_num }
235
235
onPageChange = { onPageChange }
236
- PreviousText = { t ( 'page_prev ' ) }
237
- NextText = { t ( 'page_next ' ) }
236
+ PreviousText = { t ( 'vol_prev ' ) }
237
+ NextText = { t ( 'vol_next ' ) }
238
238
/>
239
239
</ div >
240
240
@@ -296,8 +296,8 @@ const PeriodicalVolumePage: NextPage<VolumePageProps> = ({ volume }) => {
296
296
total = { volume ?. total }
297
297
current = { volume ?. current_num }
298
298
onPageChange = { onPageChange }
299
- PreviousText = { t ( 'page_prev ' ) }
300
- NextText = { t ( 'page_next ' ) }
299
+ PreviousText = { t ( 'vol_prev ' ) }
300
+ NextText = { t ( 'vol_next ' ) }
301
301
/>
302
302
303
303
< div className = 'hidden md:block' >
@@ -311,9 +311,9 @@ const PeriodicalVolumePage: NextPage<VolumePageProps> = ({ volume }) => {
311
311
< div >
312
312
< div className = 'top-15 fixed w-full max-w-[244px]' >
313
313
< div className = 'mt-2 ml-3 bg-white p-4 dark:bg-gray-800 md:rounded-lg' >
314
- < h4 className = 'mb-2 border-b border-gray-200 pb-2 dark:border-gray-700' >
314
+ < h3 className = 'mb-2 border-b border-gray-200 pb-2 text-lg dark:border-gray-700' >
315
315
{ t ( 'volume.catalog' ) }
316
- </ h4 >
316
+ </ h3 >
317
317
< ul
318
318
className = 'custom-scrollbar overflow-scroll'
319
319
style = { { maxHeight : 560 } }
You can’t perform that action at this time.
0 commit comments