@@ -4,10 +4,9 @@ import { useI18n, useSoftkey, usePopup, useRange, useArticleMediaInfo } from 'ho
44
55const MAX_DESCRIPTION_HEIGHT = 45
66
7- const AboutContainer = ( { lang , dir, title, caption, fromCommon , close } ) => {
7+ const AboutContainer = ( { mediaInfo , dir, title, caption, close } ) => {
88 const i18n = useI18n ( )
99 const containerRef = useRef ( )
10- const mediaInfo = useArticleMediaInfo ( lang , title , fromCommon )
1110
1211 useSoftkey ( 'About' , {
1312 left : i18n ( 'softkey-close' ) ,
@@ -88,6 +87,7 @@ export const Gallery = ({ close, closeAll, items, startFileName, lang, dir }) =>
8887 currentIndex , onPrevImage , onNextImage
8988 ] = useRange ( getInitialIndex ( items , startFileName ) , items . length - 1 )
9089 const [ showAboutPopup ] = usePopup ( AboutContainer , { stack : true } )
90+ const mediaInfo = useArticleMediaInfo ( lang , items [ currentIndex ] . title , items [ currentIndex ] . fromCommon , currentIndex )
9191
9292 const onImageLoad = ( { target : img } ) => {
9393 const galleryNode = containerRef . current
@@ -105,7 +105,7 @@ export const Gallery = ({ close, closeAll, items, startFileName, lang, dir }) =>
105105 left : i18n ( 'softkey-close' ) ,
106106 onKeyLeft : closeAll ,
107107 center : i18n ( 'softkey-about' ) ,
108- onKeyCenter : ( ) => showAboutPopup ( { ...items [ currentIndex ] , lang , dir } ) ,
108+ onKeyCenter : ( ) => showAboutPopup ( { ...items [ currentIndex ] , mediaInfo , dir } ) ,
109109 [ dir === 'rtl' ? 'onKeyFixedArrowLeft' : 'onKeyFixedArrowRight' ] : onNextImage ,
110110 [ dir === 'rtl' ? 'onKeyFixedArrowRight' : 'onKeyFixedArrowLeft' ] : onPrevImage ,
111111 onKeyBackspace : close
@@ -124,7 +124,7 @@ export const Gallery = ({ close, closeAll, items, startFileName, lang, dir }) =>
124124 )
125125 }
126126 < div class = 'img' >
127- < img onLoad = { onImageLoad } src = { items [ currentIndex ] . thumbnail } />
127+ < img onLoad = { onImageLoad } src = { mediaInfo && mediaInfo . source } />
128128 </ div >
129129 </ div >
130130 )
0 commit comments