fix bug
This commit is contained in:
@@ -64,7 +64,7 @@ const SiteInformation = () => {
|
||||
<NoMarginHelperText>{t("settings.customFooterHTMLDes")}</NoMarginHelperText>
|
||||
</FormControl>
|
||||
</SettingForm>
|
||||
<SettingForm title={t("settings.announcementEnabled")} lgWidth={5}>
|
||||
<SettingForm title={t("settings.announcementEnabled", "启用公告")} lgWidth={5}>
|
||||
<FormControl fullWidth>
|
||||
<Switch
|
||||
checked={isTrueVal(values.announcement_enabled)}
|
||||
@@ -74,10 +74,12 @@ const SiteInformation = () => {
|
||||
})
|
||||
}
|
||||
/>
|
||||
<NoMarginHelperText>{t("settings.announcementEnabledDes")}</NoMarginHelperText>
|
||||
<NoMarginHelperText>
|
||||
{t("settings.announcementEnabledDes", "启用后,用户登录时会看到公告弹窗")}
|
||||
</NoMarginHelperText>
|
||||
</FormControl>
|
||||
</SettingForm>
|
||||
<SettingForm title={t("settings.announcement")} lgWidth={5}>
|
||||
<SettingForm title={t("settings.announcement", "公告内容")} lgWidth={5}>
|
||||
<FormControl fullWidth>
|
||||
<DenseFilledTextField
|
||||
fullWidth
|
||||
@@ -87,7 +89,7 @@ const SiteInformation = () => {
|
||||
onChange={(e) => setSettings({ announcement: e.target.value })}
|
||||
disabled={false}
|
||||
/>
|
||||
<NoMarginHelperText>{t("settings.announcementDes")}</NoMarginHelperText>
|
||||
<NoMarginHelperText>{t("settings.announcementDes", "设置用户登录后看到的公告内容")}</NoMarginHelperText>
|
||||
</FormControl>
|
||||
</SettingForm>
|
||||
<SettingForm title={t("settings.tosUrl")} lgWidth={5}>
|
||||
|
||||
@@ -15,7 +15,7 @@ import { getAnnouncement } from "../../redux/thunks/site.ts";
|
||||
import SessionManager from "../../session";
|
||||
|
||||
const AnnouncementDialog = () => {
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation("common");
|
||||
const dispatch = useAppDispatch();
|
||||
const announcement = useAppSelector((state) => state.siteConfig.basic.config.announcement || "");
|
||||
const announcementEnabled = useAppSelector((state) => state.siteConfig.basic.config.announcement_enabled || false);
|
||||
@@ -53,7 +53,7 @@ const AnnouncementDialog = () => {
|
||||
return (
|
||||
<Dialog open={open} onClose={handleClose} maxWidth="md" fullWidth>
|
||||
<DialogTitle sx={{ borderBottom: 1, borderColor: "divider", paddingBottom: 1 }}>
|
||||
{t("common:announcement")}
|
||||
{t("announcement", "公告")}
|
||||
</DialogTitle>
|
||||
<DialogContent sx={{ padding: 2, maxHeight: "80vh" }}>
|
||||
<Paper elevation={0} sx={{ p: 2, whiteSpace: "pre-line" }}>
|
||||
@@ -61,12 +61,12 @@ const AnnouncementDialog = () => {
|
||||
</Paper>
|
||||
<FormControlLabel
|
||||
control={<Checkbox checked={dontShowAgain} onChange={(e) => setDontShowAgain(e.target.checked)} />}
|
||||
label={t("common:dontShowAgain")}
|
||||
label={t("dontShowAgain", "不再显示")}
|
||||
sx={{ mt: 2 }}
|
||||
/>
|
||||
</DialogContent>
|
||||
<Button onClick={handleClose} variant="contained" color="primary" sx={{ m: 2 }}>
|
||||
{t("common:ok")}
|
||||
{t("ok", "确定")}
|
||||
</Button>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user