feat: testing mode banner + snapshot storage fields fix
This commit is contained in:
@@ -33,6 +33,7 @@ interface SightFramePreviewProps {
|
||||
previewMedia: PreviewMediaData | null;
|
||||
articles: Article[];
|
||||
onArticleSelect: (index: number) => void;
|
||||
previewFontSize?: number;
|
||||
}
|
||||
|
||||
// Matches SightFrame.jsx renderCurrentMedia — same structure, same CSS classes
|
||||
@@ -151,6 +152,7 @@ export function SightFramePreview({
|
||||
previewMedia,
|
||||
articles,
|
||||
onArticleSelect,
|
||||
previewFontSize,
|
||||
}: SightFramePreviewProps) {
|
||||
const token = localStorage.getItem("token") ?? "";
|
||||
|
||||
@@ -235,7 +237,12 @@ export function SightFramePreview({
|
||||
{/* title: intro-title (300px, 40px centered) or regular (24px with border) */}
|
||||
<div
|
||||
className={`sfp-sight-frame-title${isIntro ? " sfp-intro-title" : ""}`}
|
||||
style={{ lineHeight: isIntro ? undefined : titleLineHeight }}
|
||||
style={{
|
||||
lineHeight: isIntro ? undefined : titleLineHeight,
|
||||
...(isIntro && previewFontSize != null
|
||||
? { fontSize: `${previewFontSize}px` }
|
||||
: {}),
|
||||
}}
|
||||
>
|
||||
<p
|
||||
style={{
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user