Merge branch 'release/v2.6.0' of github.com:ONLYOFFICE/DocSpace-client into release/v2.6.0

This commit is contained in:
Alexey Safronov 2024-07-24 15:26:24 +04:00
commit 7fc19d1f86
4 changed files with 19 additions and 5 deletions

View File

@ -29,4 +29,8 @@ import { ModalDialog } from "@docspace/shared/components/modal-dialog";
export const StyledModal = styled(ModalDialog)`
user-select: none;
.modal-body {
padding-top: 20px;
}
`;

View File

@ -279,7 +279,7 @@ class ConsumerModalDialog extends React.Component {
>
<ModalDialog.Header>{selectedConsumer.title}</ModalDialog.Header>
<ModalDialog.Body>
<Box paddingProp="0 0 16px">{consumerInstruction}</Box>
<Box paddingProp="16px 0 16px">{consumerInstruction}</Box>
<React.Fragment>
{selectedConsumer.props.map((prop, i) =>
this.inputsRender(prop, i),

View File

@ -46,9 +46,16 @@ export interface UseThemeProps {
i18n?: i18n;
systemTheme?: ThemeKeys;
colorTheme?: TGetColorTheme;
lang?: string;
}
const useTheme = ({ user, i18n, systemTheme, colorTheme }: UseThemeProps) => {
const useTheme = ({
user,
i18n,
systemTheme,
colorTheme,
lang,
}: UseThemeProps) => {
const [currentColorTheme, setCurrentColorTheme] =
React.useState<TColorScheme>(() => {
if (!colorTheme) return {} as TColorScheme;
@ -60,7 +67,7 @@ const useTheme = ({ user, i18n, systemTheme, colorTheme }: UseThemeProps) => {
});
const [theme, setTheme] = React.useState<TTheme>(() => {
const interfaceDirection = i18n?.dir ? i18n.dir() : "ltr";
const interfaceDirection = i18n?.dir ? i18n.dir(lang) : "ltr";
const newTheme = match<MatchType>([user?.theme, systemTheme])
.returnType<TTheme>()
@ -99,7 +106,7 @@ const useTheme = ({ user, i18n, systemTheme, colorTheme }: UseThemeProps) => {
const SYSTEM_THEME = getSystemTheme();
let theme = user?.theme ?? SYSTEM_THEME;
const interfaceDirection = i18n?.dir ? i18n.dir() : "ltr";
const interfaceDirection = i18n?.dir ? i18n.dir(lang) : "ltr";
if (user?.theme === ThemeKeys.SystemStr) theme = SYSTEM_THEME;
@ -116,7 +123,7 @@ const useTheme = ({ user, i18n, systemTheme, colorTheme }: UseThemeProps) => {
});
setCookie(SYSTEM_THEME_KEY, themeCookie);
}, [user?.theme, i18n, currentColorTheme]);
}, [user?.theme, i18n, currentColorTheme, lang]);
React.useEffect(() => {
getCurrentColorTheme();

View File

@ -56,11 +56,14 @@ const ThemeProvider = ({
}: TThemeProvider) => {
const { i18n } = useI18N({ settings, user });
const lang = user?.cultureName ?? settings?.culture;
const { theme, currentColorTheme } = useTheme({
user,
i18n,
systemTheme,
colorTheme,
lang,
});
return (