Merge branch 'release/v2.6.0' of github.com:ONLYOFFICE/DocSpace-client into release/v2.6.0
This commit is contained in:
commit
7fc19d1f86
@ -29,4 +29,8 @@ import { ModalDialog } from "@docspace/shared/components/modal-dialog";
|
|||||||
|
|
||||||
export const StyledModal = styled(ModalDialog)`
|
export const StyledModal = styled(ModalDialog)`
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
|
.modal-body {
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
|
@ -279,7 +279,7 @@ class ConsumerModalDialog extends React.Component {
|
|||||||
>
|
>
|
||||||
<ModalDialog.Header>{selectedConsumer.title}</ModalDialog.Header>
|
<ModalDialog.Header>{selectedConsumer.title}</ModalDialog.Header>
|
||||||
<ModalDialog.Body>
|
<ModalDialog.Body>
|
||||||
<Box paddingProp="0 0 16px">{consumerInstruction}</Box>
|
<Box paddingProp="16px 0 16px">{consumerInstruction}</Box>
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{selectedConsumer.props.map((prop, i) =>
|
{selectedConsumer.props.map((prop, i) =>
|
||||||
this.inputsRender(prop, i),
|
this.inputsRender(prop, i),
|
||||||
|
@ -46,9 +46,16 @@ export interface UseThemeProps {
|
|||||||
i18n?: i18n;
|
i18n?: i18n;
|
||||||
systemTheme?: ThemeKeys;
|
systemTheme?: ThemeKeys;
|
||||||
colorTheme?: TGetColorTheme;
|
colorTheme?: TGetColorTheme;
|
||||||
|
lang?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const useTheme = ({ user, i18n, systemTheme, colorTheme }: UseThemeProps) => {
|
const useTheme = ({
|
||||||
|
user,
|
||||||
|
i18n,
|
||||||
|
systemTheme,
|
||||||
|
colorTheme,
|
||||||
|
lang,
|
||||||
|
}: UseThemeProps) => {
|
||||||
const [currentColorTheme, setCurrentColorTheme] =
|
const [currentColorTheme, setCurrentColorTheme] =
|
||||||
React.useState<TColorScheme>(() => {
|
React.useState<TColorScheme>(() => {
|
||||||
if (!colorTheme) return {} as TColorScheme;
|
if (!colorTheme) return {} as TColorScheme;
|
||||||
@ -60,7 +67,7 @@ const useTheme = ({ user, i18n, systemTheme, colorTheme }: UseThemeProps) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const [theme, setTheme] = React.useState<TTheme>(() => {
|
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])
|
const newTheme = match<MatchType>([user?.theme, systemTheme])
|
||||||
.returnType<TTheme>()
|
.returnType<TTheme>()
|
||||||
@ -99,7 +106,7 @@ const useTheme = ({ user, i18n, systemTheme, colorTheme }: UseThemeProps) => {
|
|||||||
const SYSTEM_THEME = getSystemTheme();
|
const SYSTEM_THEME = getSystemTheme();
|
||||||
|
|
||||||
let theme = user?.theme ?? SYSTEM_THEME;
|
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;
|
if (user?.theme === ThemeKeys.SystemStr) theme = SYSTEM_THEME;
|
||||||
|
|
||||||
@ -116,7 +123,7 @@ const useTheme = ({ user, i18n, systemTheme, colorTheme }: UseThemeProps) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
setCookie(SYSTEM_THEME_KEY, themeCookie);
|
setCookie(SYSTEM_THEME_KEY, themeCookie);
|
||||||
}, [user?.theme, i18n, currentColorTheme]);
|
}, [user?.theme, i18n, currentColorTheme, lang]);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
getCurrentColorTheme();
|
getCurrentColorTheme();
|
||||||
|
@ -56,11 +56,14 @@ const ThemeProvider = ({
|
|||||||
}: TThemeProvider) => {
|
}: TThemeProvider) => {
|
||||||
const { i18n } = useI18N({ settings, user });
|
const { i18n } = useI18N({ settings, user });
|
||||||
|
|
||||||
|
const lang = user?.cultureName ?? settings?.culture;
|
||||||
|
|
||||||
const { theme, currentColorTheme } = useTheme({
|
const { theme, currentColorTheme } = useTheme({
|
||||||
user,
|
user,
|
||||||
i18n,
|
i18n,
|
||||||
systemTheme,
|
systemTheme,
|
||||||
colorTheme,
|
colorTheme,
|
||||||
|
lang,
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user