dashboard -> home (#1194)

This commit is contained in:
Tom Moor
2020-02-26 21:10:20 -08:00
committed by GitHub
parent d06ec5ce0c
commit dac2d43f55
12 changed files with 21 additions and 20 deletions

View File

@@ -81,7 +81,7 @@ class MainSidebar extends React.Component<Props> {
<Scrollable shadow>
<Section>
<SidebarLink
to="/dashboard"
to="/home"
icon={<HomeIcon />}
exact={false}
label="Home"

View File

@@ -52,7 +52,7 @@ describe('Abstract', () => {
expect('https://goabstract.com'.match(match)).toBe(null);
expect('https://app.goabstract.com'.match(match)).toBe(null);
expect('https://abstract.com/features'.match(match)).toBe(null);
expect('https://app.abstract.com/dashboard'.match(match)).toBe(null);
expect('https://app.abstract.com/home'.match(match)).toBe(null);
expect('https://abstract.com/pricing'.match(match)).toBe(null);
expect('https://goabstract.com/pricing'.match(match)).toBe(null);
expect('https://www.goabstract.com/pricing'.match(match)).toBe(null);

View File

@@ -43,8 +43,9 @@ export default function Routes() {
<SocketProvider>
<Layout>
<Switch>
<Route path="/dashboard/:tab" component={Dashboard} />
<Route path="/dashboard" component={Dashboard} />
<Redirect from="/dashboard" to="/home" />
<Route path="/home/:tab" component={Dashboard} />
<Route path="/home" component={Dashboard} />
<Route exact path="/starred" component={Starred} />
<Route exact path="/starred/:sort" component={Starred} />
<Route exact path="/drafts" component={Drafts} />

View File

@@ -31,16 +31,16 @@ class Dashboard extends React.Component<Props> {
<PageTitle title="Home" />
<h1>Home</h1>
<Tabs>
<Tab to="/dashboard" exact>
<Tab to="/home" exact>
Recently updated
</Tab>
<Tab to="/dashboard/recent" exact>
<Tab to="/home/recent" exact>
Recently viewed
</Tab>
<Tab to="/dashboard/created">Created by me</Tab>
<Tab to="/home/created">Created by me</Tab>
</Tabs>
<Switch>
<Route path="/dashboard/recent">
<Route path="/home/recent">
<PaginatedDocumentList
key="recent"
documents={documents.recentlyViewed}
@@ -48,7 +48,7 @@ class Dashboard extends React.Component<Props> {
showCollection
/>
</Route>
<Route path="/dashboard/created">
<Route path="/home/created">
<PaginatedDocumentList
key="created"
documents={documents.createdByUser(user)}
@@ -57,7 +57,7 @@ class Dashboard extends React.Component<Props> {
showCollection
/>
</Route>
<Route path="/dashboard">
<Route path="/home">
<PaginatedDocumentList
documents={documents.recentlyUpdated}
fetch={documents.fetchRecentlyUpdated}

View File

@@ -9,7 +9,7 @@ type Props = {
};
const Home = observer(({ auth }: Props) => {
if (auth.authenticated) return <Redirect to="/dashboard" />;
if (auth.authenticated) return <Redirect to="/home" />;
auth.logout(true);
return null;
});

View File

@@ -2,7 +2,7 @@
import Document from 'models/Document';
export function homeUrl(): string {
return '/dashboard';
return '/home';
}
export function starredUrl(): string {