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

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

@ -56,7 +56,11 @@ export const Select = ({
<MuiSelect
displayEmpty
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"
variant="outlined"
@ -123,7 +127,7 @@ export const Select = ({
padding: "10px",
borderRadius: "5px",
color: colorPlaceholder,
whiteSpace: "normal",
whiteSpace: "pre-wrap",
wordBreak: "break-word",
}}
>

@ -20,7 +20,16 @@ const theme = createTheme({
},
components: {
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: {
styleOverrides: {
@ -28,6 +37,11 @@ const theme = createTheme({
},
},
MuiTypography: {
styleOverrides: {
root: {
whiteSpace: "pre-wrap",
},
},
defaultProps: {
variantMapping: {
p1: "p",