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
|
|
|
|
2021-02-08 20:01:21 +02:00
|
|
|
export function navigateToCollection(collectionName: string) {
|
|
|
|
return history.push(`/collections/${collectionName}`);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function navigateToNewEntry(collectionName: string) {
|
|
|
|
return history.replace(`/collections/${collectionName}/new`);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function navigateToEntry(collectionName: string, slug: string) {
|
|
|
|
return history.replace(`/collections/${collectionName}/entries/${slug}`);
|
|
|
|
}
|
2020-06-18 10:11:37 +03:00
|
|
|
|
2021-05-30 18:49:33 +02:00
|
|
|
export { history };
|