Login:OAuth: add translations and default logo for tenant list
This commit is contained in:
parent
dea872e497
commit
572e16a7f2
4
packages/login/public/locales/en/TenantList.json
Normal file
4
packages/login/public/locales/en/TenantList.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"BackToSignIn": "Back to sign in",
|
||||
"MorePortals": "You have more than one accounts. Please choose one of them"
|
||||
}
|
@ -1,16 +1,18 @@
|
||||
"use client";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { Text } from "@docspace/shared/components/text";
|
||||
import { Button } from "@docspace/shared/components/button";
|
||||
|
||||
import Item from "./sub-components/Item";
|
||||
|
||||
import StyledTenantList from "./TenantList.styled";
|
||||
import { TenantListProps } from "./TenantList.types";
|
||||
import { Button } from "@docspace/shared/components/button";
|
||||
import { useRouter } from "next/navigation";
|
||||
|
||||
const TenantList = ({ portals, clientId, baseDomain }: TenantListProps) => {
|
||||
const router = useRouter();
|
||||
const { t } = useTranslation(["TenantList"]);
|
||||
|
||||
const goToLogin = () => {
|
||||
router.push(`/?type=oauth2&client_id=${clientId}`);
|
||||
@ -18,9 +20,7 @@ const TenantList = ({ portals, clientId, baseDomain }: TenantListProps) => {
|
||||
|
||||
return (
|
||||
<StyledTenantList>
|
||||
<Text className="more-accounts">
|
||||
You have more than one accounts. Please choose one of them
|
||||
</Text>
|
||||
<Text className="more-accounts">{t("MorePortals")}</Text>
|
||||
<div className="items-list">
|
||||
{portals.map((item) => (
|
||||
<Item portal={item} key={item.portalName} baseDomain={baseDomain} />
|
||||
@ -28,7 +28,7 @@ const TenantList = ({ portals, clientId, baseDomain }: TenantListProps) => {
|
||||
</div>
|
||||
<Button
|
||||
onClick={goToLogin}
|
||||
label="Back to sign in"
|
||||
label={t("BackToSignIn")}
|
||||
className="back-button"
|
||||
/>
|
||||
</StyledTenantList>
|
||||
|
@ -5,6 +5,7 @@ import { IconButton } from "@docspace/shared/components/icon-button";
|
||||
import { deleteCookie, getCookie } from "@docspace/shared/utils/cookie";
|
||||
|
||||
import ArrowRightSvrUrl from "PUBLIC_DIR/images/arrow.right.react.svg?url";
|
||||
import DefaultLogoUrl from "PUBLIC_DIR/images/logo/leftmenu.svg?url";
|
||||
|
||||
import { ItemProps } from "../TenantList.types";
|
||||
|
||||
@ -26,11 +27,7 @@ const Item = ({ portal, baseDomain }: ItemProps) => {
|
||||
return (
|
||||
<div className="item" onClick={onClick}>
|
||||
<div className="info">
|
||||
<img
|
||||
className="favicon"
|
||||
alt="Portal favicon"
|
||||
src={`${name}/logo.ashx?logotype=3`}
|
||||
/>
|
||||
<img className="favicon" alt="Portal favicon" src={DefaultLogoUrl} />
|
||||
<Text fontWeight={600} fontSize="14px" lineHeight="16px" truncate>
|
||||
{name.replace("http://", "").replace("https://", "")}
|
||||
</Text>
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"date": "2024628_101539",
|
||||
"date": "2024628_131043",
|
||||
"checksums": {
|
||||
"api.js": "0efbae3383bf6c6b6f26d573eee164d2",
|
||||
"api.poly.js": "2a2ac2c0e4a7007b61d2d1ff7b00a22e",
|
||||
|
Loading…
Reference in New Issue
Block a user