|
|
@@ -17,14 +17,14 @@ type Props = {
|
|
|
}
|
|
|
|
|
|
function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, ref: any) {
|
|
|
- const { myData,myLangue } = useSelector((state: RootState) => state.A0Layout)
|
|
|
+ const { myData, myLangue } = useSelector((state: RootState) => state.A0Layout)
|
|
|
|
|
|
const [selectedTab, setSelectedTab] = useState(0)
|
|
|
const selectedTabRef = useRef(0)
|
|
|
|
|
|
- useEffect(()=>{
|
|
|
- selectedTabRef.current=selectedTab
|
|
|
- },[selectedTab])
|
|
|
+ useEffect(() => {
|
|
|
+ selectedTabRef.current = selectedTab
|
|
|
+ }, [selectedTab])
|
|
|
|
|
|
const sonSetStaFu = useCallback(() => {
|
|
|
setSelectedTab(0)
|
|
|
@@ -322,28 +322,32 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
callIframeFu('showInscription', 0)
|
|
|
}
|
|
|
|
|
|
- const handleTabClick = useCallback((tabIndex: number, txt: string) => {
|
|
|
- let index = tabIndex
|
|
|
+ const handleTabClick = useCallback(
|
|
|
+ (tabIndex: number, txt: string) => {
|
|
|
+ let index = tabIndex
|
|
|
|
|
|
- const flag = selectedTabRef.current === index
|
|
|
+ const flag = selectedTabRef.current === index
|
|
|
|
|
|
- if (flag) index = 0
|
|
|
- setBottomTxt(flag ? '' : txt)
|
|
|
- setSelectedTab(index)
|
|
|
- callIframeFu('showInscription', index === 0 ? -1 : index)
|
|
|
+ if (flag) index = 0
|
|
|
+ setBottomTxt(flag ? '' : txt)
|
|
|
+ setSelectedTab(index)
|
|
|
+ callIframeFu('showInscription', index === 0 ? -1 : index)
|
|
|
|
|
|
- if (index === 0) setIsShowMzmTitle(false)
|
|
|
- }
|
|
|
-,[setBottomTxt, setIsShowMzmTitle])
|
|
|
+ if (index === 0) setIsShowMzmTitle(false)
|
|
|
+ },
|
|
|
+ [setBottomTxt, setIsShowMzmTitle]
|
|
|
+ )
|
|
|
return (
|
|
|
- <div className={classNames(styles.modalTxt, myLangue==='ZH' ? '' : styles.modalTxtEn)} id='modalTxt'>
|
|
|
+ <div
|
|
|
+ className={classNames(styles.modalTxt, myLangue === 'ZH' ? '' : styles.modalTxtEn)}
|
|
|
+ id='modalTxt'
|
|
|
+ >
|
|
|
<div className='modalTxtContainner'>
|
|
|
<div className='topBar'>
|
|
|
<div className='beie' hidden={selectedTab !== 0}>
|
|
|
<img src={require('@/assets/img/beie.png')} alt='' />
|
|
|
- <div className='txt' onClick={handleBeie}>
|
|
|
- {myLangue==='EN'?'forehead':'碑额'}
|
|
|
-
|
|
|
+ <div className='txt songFont' onClick={handleBeie}>
|
|
|
+ {myLangue === 'EN' ? 'forehead' : '碑额'}
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -359,14 +363,14 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
}.png`)}
|
|
|
alt=''
|
|
|
/>
|
|
|
- <div className={`tabNub ${selectedTab === item.key ? 'tabNubAc' : ''}`}>
|
|
|
+ <div className={`tabNub songFont ${selectedTab === item.key ? 'tabNubAc' : ''}`}>
|
|
|
{item.sonTxt}
|
|
|
</div>
|
|
|
<div
|
|
|
- className={classNames('txt',selectedTab === item.key ? 'txtAc' : '')}
|
|
|
+ className={classNames('txt songFont', selectedTab === item.key ? 'txtAc' : '')}
|
|
|
style={{ opacity: selectedTab === item.key || selectedTab === 0 ? '1' : '0' }}
|
|
|
>
|
|
|
- {myLangue==='EN'?item.nameEn: item.name}
|
|
|
+ {myLangue === 'EN' ? item.nameEn : item.name}
|
|
|
</div>
|
|
|
</div>
|
|
|
))}
|
|
|
@@ -408,13 +412,27 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
|
|
|
{selectedTab === 0 && (
|
|
|
<div className='content'>
|
|
|
- <div className='title songFontc'>{myLangue==='EN'?'Overview of the Inscription':'碑文概述'}</div>
|
|
|
+ <div className='title songFontc'>
|
|
|
+ {myLangue === 'EN' ? 'Overview of the Inscription' : '碑文概述'}
|
|
|
+ </div>
|
|
|
<div className='text'>
|
|
|
- {myLangue==='EN'?'The inscription on the Cheng Zhe Stele consists of 31 lines of regular script,':'程哲碑碑文,'}
|
|
|
- <br />{myLangue==='EN'?'with 45 characters per line at maximum. ':'31行楷书,满行45字,'}
|
|
|
- <br /> {myLangue==='EN'?' The characters are approximately 2 cm in size, set within square grids, totaling 1,404 characters.':'字径约2厘米,带方界格,总计1404字;'}
|
|
|
- <br /> {myLangue==='EN'?'No formal title of the stele is engraved. ':'未刻正式碑名。 '}<br />
|
|
|
- {myLangue==='EN'?'The entire text praises the historical achievements of the Cheng family.':'通篇颂德程氏家族的历史功绩。'}
|
|
|
+ {myLangue === 'EN'
|
|
|
+ ? 'The inscription on the Cheng Zhe Stele consists of 31 lines of regular script,'
|
|
|
+ : '程哲碑碑文,'}
|
|
|
+ <br />
|
|
|
+ {myLangue === 'EN'
|
|
|
+ ? 'with 45 characters per line at maximum. '
|
|
|
+ : '31行楷书,满行45字,'}
|
|
|
+ <br />{' '}
|
|
|
+ {myLangue === 'EN'
|
|
|
+ ? ' The characters are approximately 2 cm in size, set within square grids, totaling 1,404 characters.'
|
|
|
+ : '字径约2厘米,带方界格,总计1404字;'}
|
|
|
+ <br />{' '}
|
|
|
+ {myLangue === 'EN' ? 'No formal title of the stele is engraved. ' : '未刻正式碑名。 '}
|
|
|
+ <br />
|
|
|
+ {myLangue === 'EN'
|
|
|
+ ? 'The entire text praises the historical achievements of the Cheng family.'
|
|
|
+ : '通篇颂德程氏家族的历史功绩。'}
|
|
|
</div>
|
|
|
</div>
|
|
|
)}
|