feat: Add login link to /create page, closes OLN-63
This commit is contained in:
parent
58f9e95d2f
commit
710fcc697c
|
@ -3,7 +3,7 @@ import * as React from "react";
|
|||
import styled from "styled-components";
|
||||
import { BackIcon, EmailIcon } from "outline-icons";
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { Redirect } from "react-router-dom";
|
||||
import { Redirect, Link } from "react-router-dom";
|
||||
import { find } from "lodash";
|
||||
import Flex from "components/Flex";
|
||||
import TeamLogo from "components/TeamLogo";
|
||||
|
@ -59,7 +59,7 @@ class Login extends React.Component<Props, State> {
|
|||
const hasMultipleServices = config.services.length > 1;
|
||||
const defaultService = find(
|
||||
config.services,
|
||||
service => service.id === auth.lastSignedIn
|
||||
service => service.id === auth.lastSignedIn && !isCreate
|
||||
);
|
||||
|
||||
const header =
|
||||
|
@ -136,7 +136,7 @@ class Login extends React.Component<Props, State> {
|
|||
)}
|
||||
|
||||
{config.services.map(service => {
|
||||
if (service.id === auth.lastSignedIn) {
|
||||
if (defaultService && service.id === defaultService.id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -149,6 +149,12 @@ class Login extends React.Component<Props, State> {
|
|||
/>
|
||||
);
|
||||
})}
|
||||
|
||||
{isCreate && (
|
||||
<Note>
|
||||
Already have an account? Go to <Link to="/">login</Link>.
|
||||
</Note>
|
||||
)}
|
||||
</Centered>
|
||||
</Background>
|
||||
);
|
||||
|
|
Reference in New Issue