13 lines
484 B
TypeScript
Raw Normal View History

2019-10-23 13:58:54 +01:00
import { createHashHistory } from 'history';
2016-07-15 15:05:04 -03:00
const history = createHashHistory();
2016-07-15 15:05:04 -03:00
export const navigateToCollection = (collectionName: string) =>
2020-06-18 10:11:37 +03:00
history.push(`/collections/${collectionName}`);
export const navigateToNewEntry = (collectionName: string) =>
2020-06-18 10:11:37 +03:00
history.replace(`/collections/${collectionName}/new`);
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;