mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 15:30:40 +00:00
Show on login
This commit is contained in:
parent
f40c277aa8
commit
9e3a3d852e
@ -160,7 +160,7 @@ const TappableContainer: React.FC<React.PropsWithChildren> = ({ children }) => {
|
|||||||
const [showDevSettings, setShowDevSettings] = useState(false);
|
const [showDevSettings, setShowDevSettings] = useState(false);
|
||||||
|
|
||||||
const handleClick: React.MouseEventHandler = (event) => {
|
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;
|
if (!shouldAllowChangingAPIOrigin()) return;
|
||||||
|
|
||||||
// Ignore clicks on buttons when counting up towards 7.
|
// Ignore clicks on buttons when counting up towards 7.
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import log from "@/next/log";
|
import log from "@/next/log";
|
||||||
|
import { customAPIOrigin } from "@/next/origins";
|
||||||
import type { AppName } from "@/next/types/app";
|
import type { AppName } from "@/next/types/app";
|
||||||
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
|
import FormPaperFooter from "@ente/shared/components/Form/FormPaper/Footer";
|
||||||
import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";
|
import FormPaperTitle from "@ente/shared/components/Form/FormPaper/Title";
|
||||||
@ -7,7 +8,7 @@ import SingleInputForm, {
|
|||||||
type SingleInputFormProps,
|
type SingleInputFormProps,
|
||||||
} from "@ente/shared/components/SingleInputForm";
|
} from "@ente/shared/components/SingleInputForm";
|
||||||
import { LS_KEYS, setData } from "@ente/shared/storage/localStorage";
|
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 { t } from "i18next";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { getSRPAttributes } from "../api/srp";
|
import { getSRPAttributes } from "../api/srp";
|
||||||
@ -22,6 +23,9 @@ interface LoginProps {
|
|||||||
export function Login({ appName, signUp }: LoginProps) {
|
export function Login({ appName, signUp }: LoginProps) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
const origin = customAPIOrigin();
|
||||||
|
const host = origin ? new URL(origin).host : undefined;
|
||||||
|
|
||||||
const loginUser: SingleInputFormProps["callback"] = async (
|
const loginUser: SingleInputFormProps["callback"] = async (
|
||||||
email,
|
email,
|
||||||
setFieldError,
|
setFieldError,
|
||||||
@ -63,7 +67,14 @@ export function Login({ appName, signUp }: LoginProps) {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<FormPaperFooter>
|
<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>
|
</FormPaperFooter>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user