Show on login

This commit is contained in:
Manav Rathi 2024-06-24 11:21:00 +05:30
parent f40c277aa8
commit 9e3a3d852e
No known key found for this signature in database
2 changed files with 14 additions and 3 deletions

View File

@ -160,7 +160,7 @@ const TappableContainer: React.FC<React.PropsWithChildren> = ({ children }) => {
const [showDevSettings, setShowDevSettings] = useState(false);
const handleClick: React.MouseEventHandler = (event) => {
// Don't allow this when runinng on (e.g.) web.ente.io.
// Don't allow this when running on (e.g.) web.ente.io.
if (!shouldAllowChangingAPIOrigin()) return;
// Ignore clicks on buttons when counting up towards 7.

View File

@ -1,4 +1,5 @@
import log from "@/next/log";
import { customAPIOrigin } from "@/next/origins";
import type { AppName } from "@/next/types/app";
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";
@ -7,7 +8,7 @@ import SingleInputForm, {
type SingleInputFormProps,
} from "@ente/shared/components/SingleInputForm";
import { LS_KEYS, setData } from "@ente/shared/storage/localStorage";
import { Input } from "@mui/material";
import { Input, Typography, Stack } from "@mui/material";
import { t } from "i18next";
import { useRouter } from "next/router";
import { getSRPAttributes } from "../api/srp";
@ -22,6 +23,9 @@ interface LoginProps {
export function Login({ appName, signUp }: LoginProps) {
const router = useRouter();
const origin = customAPIOrigin();
const host = origin ? new URL(origin).host : undefined;
const loginUser: SingleInputFormProps["callback"] = async (
email,
setFieldError,
@ -63,7 +67,14 @@ export function Login({ appName, signUp }: LoginProps) {
/>
<FormPaperFooter>
<LinkButton onClick={signUp}>{t("NO_ACCOUNT")}</LinkButton>
<Stack gap={4}>
<LinkButton onClick={signUp}>{t("NO_ACCOUNT")}</LinkButton>
{host && (
<Typography variant="mini" color="text.faint">
{host}
</Typography>
)}
</Stack>
</FormPaperFooter>
</>
);