Link sidebar directly to entry document
This commit is contained in:
@ -17,7 +17,7 @@ const SidebarCollectionList = observer(({ collections }: Props) => {
|
|||||||
<Flex column>
|
<Flex column>
|
||||||
<Header>Collections</Header>
|
<Header>Collections</Header>
|
||||||
{collections.data.map(collection => (
|
{collections.data.map(collection => (
|
||||||
<SidebarLink key={collection.id} to={collection.url}>
|
<SidebarLink key={collection.id} to={collection.entryUrl}>
|
||||||
{collection.name}
|
{collection.name}
|
||||||
</SidebarLink>
|
</SidebarLink>
|
||||||
))}
|
))}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import { extendObservable, action, runInAction } from 'mobx';
|
import { extendObservable, action, computed, runInAction } from 'mobx';
|
||||||
import invariant from 'invariant';
|
import invariant from 'invariant';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
@ -21,6 +21,12 @@ class Collection {
|
|||||||
client: ApiClient;
|
client: ApiClient;
|
||||||
errors: ErrorsStore;
|
errors: ErrorsStore;
|
||||||
|
|
||||||
|
/* Computed */
|
||||||
|
|
||||||
|
@computed get entryUrl(): string {
|
||||||
|
return this.type === 'atlas' ? this.documents[0].url : this.url;
|
||||||
|
}
|
||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
@action update = async () => {
|
@action update = async () => {
|
||||||
|
Reference in New Issue
Block a user