2019-10-23 13:58:54 +01:00
|
|
|
import { createHashHistory } from 'history';
|
2016-07-15 15:05:04 -03:00
|
|
|
|
2020-02-13 02:12:36 +02:00
|
|
|
const history = createHashHistory();
|
2016-07-15 15:05:04 -03:00
|
|
|
|
2020-12-23 14:18:41 +02:00
|
|
|
export const navigateToCollection = (collectionName: string) =>
|
2020-06-18 10:11:37 +03:00
|
|
|
history.push(`/collections/${collectionName}`);
|
2020-12-23 14:18:41 +02:00
|
|
|
export const navigateToNewEntry = (collectionName: string) =>
|
2020-06-18 10:11:37 +03:00
|
|
|
history.replace(`/collections/${collectionName}/new`);
|
2020-12-23 14:18:41 +02:00
|
|
|
export const navigateToEntry = (collectionName: string, slug: string) =>
|
2020-06-18 10:11:37 +03:00
|
|
|
history.replace(`/collections/${collectionName}/entries/${slug}`);
|
|
|
|
|
2016-07-15 15:05:04 -03:00
|
|
|
export default history;
|