@@ -21,11 +21,36 @@ import Provider from "./Provider";
|
|||||||
import env from "env";
|
import env from "env";
|
||||||
import useQuery from "hooks/useQuery";
|
import useQuery from "hooks/useQuery";
|
||||||
import useStores from "hooks/useStores";
|
import useStores from "hooks/useStores";
|
||||||
|
import { isCustomDomain } from "utils/domains";
|
||||||
|
|
||||||
type Props = {|
|
type Props = {|
|
||||||
location: Location,
|
location: Location,
|
||||||
|};
|
|};
|
||||||
|
|
||||||
|
function Header({ config }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const isHosted = env.DEPLOYMENT === "hosted";
|
||||||
|
const isSubdomain = !!config.hostname;
|
||||||
|
|
||||||
|
if (!isHosted || isCustomDomain()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isSubdomain) {
|
||||||
|
return (
|
||||||
|
<Back href={env.URL}>
|
||||||
|
<BackIcon color="currentColor" /> {t("Back to home")}
|
||||||
|
</Back>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Back href="https://www.getoutline.com">
|
||||||
|
<BackIcon color="currentColor" /> {t("Back to website")}
|
||||||
|
</Back>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function Login({ location }: Props) {
|
function Login({ location }: Props) {
|
||||||
const query = useQuery();
|
const query = useQuery();
|
||||||
const { t, i18n } = useTranslation();
|
const { t, i18n } = useTranslation();
|
||||||
@@ -79,22 +104,10 @@ function Login({ location }: Props) {
|
|||||||
(provider) => provider.id === auth.lastSignedIn && !isCreate
|
(provider) => provider.id === auth.lastSignedIn && !isCreate
|
||||||
);
|
);
|
||||||
|
|
||||||
const header =
|
|
||||||
env.DEPLOYMENT === "hosted" &&
|
|
||||||
(config.hostname ? (
|
|
||||||
<Back href={env.URL}>
|
|
||||||
<BackIcon color="currentColor" /> {t("Back to home")}
|
|
||||||
</Back>
|
|
||||||
) : (
|
|
||||||
<Back href="https://www.getoutline.com">
|
|
||||||
<BackIcon color="currentColor" /> {t("Back to website")}
|
|
||||||
</Back>
|
|
||||||
));
|
|
||||||
|
|
||||||
if (emailLinkSentTo) {
|
if (emailLinkSentTo) {
|
||||||
return (
|
return (
|
||||||
<Background>
|
<Background>
|
||||||
{header}
|
<Header config={config} />
|
||||||
<Centered align="center" justify="center" column auto>
|
<Centered align="center" justify="center" column auto>
|
||||||
<PageTitle title="Check your email" />
|
<PageTitle title="Check your email" />
|
||||||
<CheckEmailIcon size={38} color="currentColor" />
|
<CheckEmailIcon size={38} color="currentColor" />
|
||||||
@@ -117,7 +130,7 @@ function Login({ location }: Props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Background>
|
<Background>
|
||||||
{header}
|
<Header config={config} />
|
||||||
<Centered align="center" justify="center" column auto>
|
<Centered align="center" justify="center" column auto>
|
||||||
<PageTitle title="Login" />
|
<PageTitle title="Login" />
|
||||||
<Logo>
|
<Logo>
|
||||||
|
|||||||
Reference in New Issue
Block a user