Skip to content

Commit ac6cf6d

Browse files
authored
Merge pull request #2910 from tangly1024/feat/theme-game-list
game 主题,页面加上通用的底部列表
2 parents d53ac57 + 9076bc1 commit ac6cf6d

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

themes/game/index.js

+27-21
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ export const useGameGlobal = () => useContext(ThemeGlobalGame)
4444
* @constructor
4545
*/
4646
const LayoutBase = props => {
47-
const { allNavPages, children, siteInfo } = props
47+
const {
48+
allNavPages,
49+
children,
50+
siteInfo,
51+
tagOptions,
52+
currentTag,
53+
categoryOptions,
54+
currentCategory
55+
} = props
4856
const searchModal = useRef(null)
4957
// 在列表中进行实时过滤
5058
const [filterKey, setFilterKey] = useState('')
@@ -107,6 +115,23 @@ const LayoutBase = props => {
107115
{/* 右侧 */}
108116
<main className='flex-grow w-full h-full flex flex-col min-h-screen overflow-x-auto md:p-2'>
109117
<div className='flex-grow h-full'>{children}</div>
118+
{/* 广告 */}
119+
<div className='w-full py-4'>
120+
<AdSlot type='in-article' />
121+
</div>
122+
123+
{/* 主区域下方 导览 */}
124+
<div className='w-full bg-white dark:bg-hexo-black-gray rounded-lg p-2'>
125+
{/* 标签汇总 */}
126+
<GroupCategory
127+
categoryOptions={categoryOptions}
128+
currentCategory={currentCategory}
129+
/>
130+
<hr />
131+
<GroupTag tagOptions={tagOptions} currentTag={currentTag} />
132+
{/* 站点公告信息 */}
133+
<Announcement {...props} className='p-2' />
134+
</div>
110135
<Footer />
111136
</main>
112137
</div>
@@ -130,8 +155,7 @@ const LayoutBase = props => {
130155
* @returns
131156
*/
132157
const LayoutIndex = props => {
133-
const { tagOptions, currentTag, categoryOptions, currentCategory, siteInfo } =
134-
props
158+
const { siteInfo } = props
135159
return (
136160
<>
137161
{/* 首页移动端顶部导航 */}
@@ -142,24 +166,6 @@ const LayoutIndex = props => {
142166
<GameListRecent />
143167
{/* 游戏列表 */}
144168
<LayoutPostList {...props} />
145-
146-
{/* 广告 */}
147-
<div className='w-full'>
148-
<AdSlot type='in-article' />
149-
</div>
150-
151-
{/* 主区域下方 导览 */}
152-
<div className='w-full bg-white dark:bg-hexo-black-gray rounded-lg p-2'>
153-
{/* 标签汇总 */}
154-
<GroupCategory
155-
categoryOptions={categoryOptions}
156-
currentCategory={currentCategory}
157-
/>
158-
<hr />
159-
<GroupTag tagOptions={tagOptions} currentTag={currentTag} />
160-
{/* 站点公告信息 */}
161-
<Announcement {...props} className='p-2' />
162-
</div>
163169
</>
164170
)
165171
}

0 commit comments

Comments
 (0)