Merge pull request #583 from ONLYOFFICE/feature/logohandler-culture-param
Shared:Utils:Common: pass culture to handler logo url
This commit is contained in:
commit
3462ea7708
@ -35,6 +35,7 @@ import SimpleNav from "@/components/SimpleNav";
|
||||
import { LoginContent, LoginFormWrapper } from "@/components/Login";
|
||||
import GreetingContainer from "@/components/GreetingContainer";
|
||||
import { getColorTheme, getSettings } from "@/utils/actions";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
const LanguageComboboxWrapper = dynamic(
|
||||
() => import("@/components/LanguageCombobox"),
|
||||
@ -59,9 +60,12 @@ export default async function Layout({
|
||||
|
||||
const isRegisterContainerVisible = objectSettings?.enabledJoin;
|
||||
|
||||
const culture =
|
||||
cookies().get("asc_language")?.value ?? objectSettings?.culture;
|
||||
|
||||
return (
|
||||
<div style={{ width: "100%", height: "100%" }}>
|
||||
<SimpleNav />
|
||||
<SimpleNav culture={culture} />
|
||||
<LoginFormWrapper id="login-page" bgPattern={bgPattern}>
|
||||
<div className="bg-cover" />
|
||||
<Scrollbar id="customScrollBar">
|
||||
@ -73,6 +77,7 @@ export default async function Layout({
|
||||
>
|
||||
<GreetingContainer
|
||||
greetingSettings={objectSettings?.greetingSettings}
|
||||
culture={culture}
|
||||
/>
|
||||
<FormWrapper id="login-form">{children}</FormWrapper>
|
||||
</ColorTheme>
|
||||
|
@ -40,11 +40,19 @@ import { GreetingContainersProps } from "@/types";
|
||||
import { DEFAULT_PORTAL_TEXT, DEFAULT_ROOM_TEXT } from "@/utils/constants";
|
||||
import { getInvitationLinkData } from "@/utils";
|
||||
|
||||
const GreetingContainer = ({ greetingSettings }: GreetingContainersProps) => {
|
||||
const GreetingContainer = ({
|
||||
greetingSettings,
|
||||
culture,
|
||||
}: GreetingContainersProps) => {
|
||||
const { t } = useTranslation(["Login"]);
|
||||
const theme = useTheme();
|
||||
|
||||
const logoUrl = getLogoUrl(WhiteLabelLogoType.LoginPage, !theme.isBase);
|
||||
const logoUrl = getLogoUrl(
|
||||
WhiteLabelLogoType.LoginPage,
|
||||
!theme.isBase,
|
||||
false,
|
||||
culture,
|
||||
);
|
||||
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
|
@ -61,14 +61,21 @@ const StyledSimpleNav = styled.div`
|
||||
|
||||
StyledSimpleNav.defaultProps = { theme: Base };
|
||||
|
||||
interface SimpleNavProps {}
|
||||
interface SimpleNavProps {
|
||||
culture?: string;
|
||||
}
|
||||
|
||||
const SimpleNav = ({}: SimpleNavProps) => {
|
||||
const SimpleNav = ({ culture }: SimpleNavProps) => {
|
||||
const theme = useTheme();
|
||||
|
||||
const isDark = !theme.isBase;
|
||||
|
||||
const logoUrl = getLogoUrl(WhiteLabelLogoType.LightSmall, isDark);
|
||||
const logoUrl = getLogoUrl(
|
||||
WhiteLabelLogoType.LightSmall,
|
||||
isDark,
|
||||
false,
|
||||
culture,
|
||||
);
|
||||
|
||||
return (
|
||||
<StyledSimpleNav id="login-header">
|
||||
|
@ -43,6 +43,7 @@ export type TDataContext = {
|
||||
|
||||
export type GreetingContainersProps = {
|
||||
greetingSettings?: string;
|
||||
culture?: string;
|
||||
};
|
||||
|
||||
export type LoginProps = {
|
||||
|
@ -1103,8 +1103,9 @@ export function getLogoUrl(
|
||||
logoType: WhiteLabelLogoType,
|
||||
dark: boolean = false,
|
||||
def: boolean = false,
|
||||
culture?: string,
|
||||
) {
|
||||
return `/logo.ashx?logotype=${logoType}&dark=${dark}&default=${def}`;
|
||||
return `/logo.ashx?logotype=${logoType}&dark=${dark}&default=${def}${culture ? `&culture=${culture}` : ""}`;
|
||||
}
|
||||
|
||||
export const getUserTypeName = (
|
||||
|
Loading…
Reference in New Issue
Block a user