feat: testing mode banner + snapshot storage fields fix

This commit is contained in:
2026-04-17 15:31:14 +03:00
parent d380b2570f
commit a3a4d2eb18
17 changed files with 228 additions and 29 deletions

View File

@@ -5,6 +5,8 @@ import {
Menu,
MenuItem,
TextField,
Slider,
Stack,
} from "@mui/material";
import {
authInstance,
@@ -45,6 +47,7 @@ export const RightWidgetTab = observer(
updateRightArticleInfo,
getRightArticles,
updateSight,
updateSightInfo,
unlinkPreviewMedia,
linkPreviewMedia,
unlinkRightArticle,
@@ -454,7 +457,40 @@ export const RightWidgetTab = observer(
</Box>
</Box>
<Box sx={{ flexShrink: 0, width: "550px" }}>
<Box sx={{ flexShrink: 0, width: "550px", display: "flex", flexDirection: "column", gap: 1 }}>
<Stack direction="row" spacing={2} alignItems="center">
<TextField
type="number"
label="Размер шрифта превью (px)"
size="small"
value={sight.common.preview_font_size ?? ""}
onChange={(e) => {
const raw = e.target.value;
if (raw === "") {
updateSightInfo(language, { preview_font_size: undefined }, true);
return;
}
const val = Math.max(1, Math.min(300, Math.round(Number(raw))));
if (Number.isFinite(val)) {
updateSightInfo(language, { preview_font_size: val }, true);
}
}}
slotProps={{ input: { min: 1, max: 300 } }}
sx={{ width: "200px" }}
/>
<Slider
value={sight.common.preview_font_size ?? 40}
min={1}
max={300}
step={1}
onChange={(_, newValue) => {
if (typeof newValue === "number") {
updateSightInfo(language, { preview_font_size: newValue }, true);
}
}}
sx={{ flexGrow: 1 }}
/>
</Stack>
<SightFramePreview
sightName={sight[language].name}
previewMedia={previewMedia}
@@ -463,6 +499,7 @@ export const RightWidgetTab = observer(
handleSelectArticle(idx);
setType("article");
}}
previewFontSize={sight.common.preview_font_size}
/>
</Box>
</Box>