отображение переносов строк

This commit is contained in:
Nastya 2025-10-05 18:08:36 +03:00
parent 4c300528fa
commit 4fbb2ddc5d
3 changed files with 24 additions and 9 deletions

@ -29,8 +29,9 @@ type InputsProps = {
}; };
}; };
const iscrutch = "/cc006b40-ccbd-4600-a1d3-f902f85aa0a0";
const pathOnly = window.location.pathname; const pathOnly = window.location.pathname;
const iscrutch =
pathOnly === "/cc006b40-ccbd-4600-a1d3-f902f85aa0a0" || pathOnly === "/28525cd7-9ddf-4c4a-a55b-e3d2f7d47583";
export const Inputs = ({ export const Inputs = ({
name, name,
@ -58,11 +59,7 @@ export const Inputs = ({
<CustomInput <CustomInput
onChange={({ target }) => setName(target.value)} onChange={({ target }) => setName(target.value)}
id={name} id={name}
title={ title={iscrutch ? "Введите имя и фамилию" : FC["name"].innerText || `${t("Enter")} ${t("Name").toLowerCase()}`}
pathOnly === iscrutch
? "Введите имя и фамилию"
: FC["name"].innerText || `${t("Enter")} ${t("Name").toLowerCase()}`
}
desc={FC["name"].text || t("Name")} desc={FC["name"].text || t("Name")}
Icon={NameIcon} Icon={NameIcon}
/> />

@ -56,7 +56,11 @@ export const Select = ({
<MuiSelect <MuiSelect
displayEmpty displayEmpty
renderValue={(value) => renderValue={(value) =>
value ? items[Number(value)] : <Typography sx={{ color: colorPlaceholder }}>{placeholder}</Typography> value ? (
<Typography sx={{ whiteSpace: "pre-wrap", wordBreak: "break-word" }}>{items[Number(value)]}</Typography>
) : (
<Typography sx={{ color: colorPlaceholder }}>{placeholder}</Typography>
)
} }
id="display-select" id="display-select"
variant="outlined" variant="outlined"
@ -123,7 +127,7 @@ export const Select = ({
padding: "10px", padding: "10px",
borderRadius: "5px", borderRadius: "5px",
color: colorPlaceholder, color: colorPlaceholder,
whiteSpace: "normal", whiteSpace: "pre-wrap",
wordBreak: "break-word", wordBreak: "break-word",
}} }}
> >

@ -20,7 +20,16 @@ const theme = createTheme({
}, },
components: { components: {
MuiCssBaseline: { MuiCssBaseline: {
styleOverrides: fontFaces, styleOverrides: {
// Если fontFaces это CSSObject
...(typeof fontFaces === "string" ? {} : fontFaces),
// Добавляем стиль для Typography
".MuiTypography-root": {
whiteSpace: "pre-wrap !important",
},
// Если fontFaces это строка, добавляем её как @font-face
...(typeof fontFaces === "string" ? { "@font-face": fontFaces } : {}),
},
}, },
MuiScopedCssBaseline: { MuiScopedCssBaseline: {
styleOverrides: { styleOverrides: {
@ -28,6 +37,11 @@ const theme = createTheme({
}, },
}, },
MuiTypography: { MuiTypography: {
styleOverrides: {
root: {
whiteSpace: "pre-wrap",
},
},
defaultProps: { defaultProps: {
variantMapping: { variantMapping: {
p1: "p", p1: "p",