公告增加每次显示模式
This commit is contained in:
@@ -5,12 +5,14 @@ import { createContext, ReactNode, useContext } from 'react';
|
||||
const SiteContext = createContext<{
|
||||
siteName: string;
|
||||
announcement?: string;
|
||||
announcementDisplayMode?: 'once' | 'every';
|
||||
tmdbApiKey?: string;
|
||||
}>({
|
||||
// 默认值
|
||||
siteName: 'MoonTVPlus',
|
||||
announcement:
|
||||
'本网站仅提供影视信息搜索服务,所有内容均来自第三方网站。本站不存储任何视频资源,不对任何内容的准确性、合法性、完整性负责。',
|
||||
announcementDisplayMode: 'once',
|
||||
tmdbApiKey: '',
|
||||
});
|
||||
|
||||
@@ -20,15 +22,19 @@ export function SiteProvider({
|
||||
children,
|
||||
siteName,
|
||||
announcement,
|
||||
announcementDisplayMode,
|
||||
tmdbApiKey,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
siteName: string;
|
||||
announcement?: string;
|
||||
announcementDisplayMode?: 'once' | 'every';
|
||||
tmdbApiKey?: string;
|
||||
}) {
|
||||
return (
|
||||
<SiteContext.Provider value={{ siteName, announcement, tmdbApiKey }}>
|
||||
<SiteContext.Provider
|
||||
value={{ siteName, announcement, announcementDisplayMode, tmdbApiKey }}
|
||||
>
|
||||
{children}
|
||||
</SiteContext.Provider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user