File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ export default function DetailPage({
8080 heroAside,
8181 pageClassName = '' ,
8282} : DetailPageProps ) {
83+ const homeSectionLabel = backLabel . replace ( / ^ 返 回 / , '' ) ;
84+
8385 return < main className = { `detail-page ${ pageClassName } ` } style = { { '--detail-accent' : accent } as CSSProperties } >
8486 < nav className = "detail-nav" aria-label = "详情页导航" >
8587 < a className = "detail-back" href = { backHref } > < PiArrowLeftBold aria-hidden = "true" /> { backLabel } </ a >
@@ -129,8 +131,12 @@ export default function DetailPage({
129131 { showcase }
130132
131133 < nav className = "detail-pagination" aria-label = "详情页切换" >
132- { previous ? < a href = { previous . href } > < PiArrowLeftBold aria-hidden = "true" /> < span > < small > 上一个</ small > { previous . label } </ span > </ a > : < span /> }
133- { next ? < a href = { next . href } > < span > < small > 下一个</ small > { next . label } </ span > < PiArrowRightBold aria-hidden = "true" /> </ a > : < span /> }
134+ { previous
135+ ? < a href = { previous . href } > < PiArrowLeftBold aria-hidden = "true" /> < span > < small > 上一个</ small > { previous . label } </ span > </ a >
136+ : < a href = { backHref } > < PiArrowLeftBold aria-hidden = "true" /> < span > < small > 返回首页</ small > { homeSectionLabel } </ span > </ a > }
137+ { next
138+ ? < a href = { next . href } > < span > < small > 下一个</ small > { next . label } </ span > < PiArrowRightBold aria-hidden = "true" /> </ a >
139+ : < a href = { backHref } > < span > < small > 返回首页</ small > { homeSectionLabel } </ span > < PiArrowRightBold aria-hidden = "true" /> </ a > }
134140 </ nav >
135141 </ main > ;
136142}
You can’t perform that action at this time.
0 commit comments