feat: update right widget and add new 3d widget

This commit is contained in:
2026-04-30 22:57:14 +03:00
parent 53b8ce7095
commit 7f8a327329
18 changed files with 217 additions and 80 deletions

View File

@@ -205,7 +205,7 @@ export const CreateInformationTab = observer(
>
<div className="flex gap-10 items-center mb-5 max-w-[80%]">
<BackButton />
<h1 className="text-3xl break-words">{sight[language].name}</h1>
<h1 className="text-3xl break-words">{sight[language].name.replace(/\n/g, " ")}</h1>
</div>
<Box

View File

@@ -94,7 +94,7 @@ export const CreateLeftTab = observer(
>
<div className="flex gap-10 items-center mb-5 max-w-[80%]">
<BackButton />
<h1 className="text-3xl break-words">{sight[language].name}</h1>
<h1 className="text-3xl break-words">{sight[language].name.replace(/\n/g, " ")}</h1>
</div>
<Paper
elevation={2}

View File

@@ -231,7 +231,7 @@ export const CreateRightTab = observer(
>
<div className="flex gap-10 items-center mb-5 max-w-[80%]">
<BackButton />
<h1 className="text-3xl break-words">{sight[language].name}</h1>
<h1 className="text-3xl break-words">{sight[language].name.replace(/\n/g, " ")}</h1>
</div>
<Box sx={{ display: "flex", flexGrow: 1, gap: 2.5 }}>
@@ -508,36 +508,44 @@ export const CreateRightTab = observer(
/>
</Stack>
)}
<Stack direction="row" spacing={1} alignItems="flex-start">
<TextField
label="Полное название (поддерживает перенос ↵)"
multiline
minRows={1}
maxRows={4}
size="small"
value={sight[language].name}
onChange={(e) =>
updateSightInfo({ name: e.target.value }, language)
}
inputRef={shortNameRef}
sx={{ flexGrow: 1 }}
/>
<Button
variant="outlined"
size="small"
onClick={insertNewline}
title="Вставить перенос строки"
sx={{
minWidth: 40,
height: 40,
fontSize: 18,
p: 0,
flexShrink: 0,
}}
>
↵
</Button>
</Stack>
{type === "media" && (
<Stack direction="row" spacing={1} alignItems="flex-start">
<TextField
label="Полное название (поддерживает перенос ↵)"
multiline
minRows={1}
maxRows={4}
size="small"
value={sight[language].name}
onChange={(e) =>
updateSightInfo({ name: e.target.value }, language)
}
onKeyDown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
insertNewline();
}
}}
inputRef={shortNameRef}
sx={{ flexGrow: 1 }}
/>
<Button
variant="outlined"
size="small"
onClick={insertNewline}
title="Вставить перенос строки"
sx={{
minWidth: 40,
height: 40,
fontSize: 18,
p: 0,
flexShrink: 0,
}}
>
↵
</Button>
</Stack>
)}
<SightFramePreview
sightName={sight[language].name}
previewMedia={previewMedia}

View File

@@ -207,7 +207,7 @@ export const InformationTab = observer(
>
<div className="flex gap-10 items-center mb-5 max-w-[80%]">
<BackButton />
<h1 className="text-3xl break-words">{sight[language].name}</h1>
<h1 className="text-3xl break-words">{sight[language].name.replace(/\n/g, " ")}</h1>
</div>
<LanguageSwitcher />

View File

@@ -112,7 +112,7 @@ export const LeftWidgetTab = observer(
>
<div className="flex gap-10 items-center mb-5 max-w-[80%]">
<BackButton />
<h1 className="text-3xl break-words">{sight[language].name}</h1>
<h1 className="text-3xl break-words">{sight[language].name.replace(/\n/g, " ")}</h1>
</div>
<Paper

View File

@@ -213,7 +213,7 @@ export function SightFramePreview({
if (!sightName) return "120%";
const calculatedLineHeight = Math.max(
100,
Math.min(120, 120 - (sightName.length / 10) * 1)
Math.min(120, 120 - (sightName.replace(/\n/g, "").length / 10) * 1)
);
return `${calculatedLineHeight}%`;
}, [sightName]);

View File

@@ -201,7 +201,7 @@ export const RightWidgetTab = observer(
>
<div className="flex gap-10 items-center mb-5 max-w-[80%]">
<BackButton />
<h1 className="text-3xl break-words">{sight[language].name}</h1>
<h1 className="text-3xl break-words">{sight[language].name.replace(/\n/g, " ")}</h1>
</div>
<Box sx={{ display: "flex", flexGrow: 1, gap: 2.5 }}>
@@ -476,28 +476,36 @@ export const RightWidgetTab = observer(
/>
</Stack>
)}
<Stack direction="row" spacing={1} alignItems="flex-start">
<TextField
label="Полное название (поддерживает перенос ↵)"
multiline
minRows={1}
maxRows={4}
size="small"
value={sight[language].name}
onChange={(e) => updateSightInfo(language, { name: e.target.value })}
inputRef={shortNameRef}
sx={{ flexGrow: 1 }}
/>
<Button
variant="outlined"
size="small"
onClick={insertNewline}
title="Вставить перенос строки"
sx={{ minWidth: 40, height: 40, fontSize: 18, p: 0, flexShrink: 0 }}
>
↵
</Button>
</Stack>
{type === "media" && (
<Stack direction="row" spacing={1} alignItems="flex-start">
<TextField
label="Полное название (поддерживает перенос ↵)"
multiline
minRows={1}
maxRows={4}
size="small"
value={sight[language].name}
onChange={(e) => updateSightInfo(language, { name: e.target.value })}
onKeyDown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
insertNewline();
}
}}
inputRef={shortNameRef}
sx={{ flexGrow: 1 }}
/>
<Button
variant="outlined"
size="small"
onClick={insertNewline}
title="Вставить перенос строки"
sx={{ minWidth: 40, height: 40, fontSize: 18, p: 0, flexShrink: 0 }}
>
↵
</Button>
</Stack>
)}
<SightFramePreview
sightName={sight[language].name}
previewMedia={previewMedia}