feat: Command Bar (#2669)

This commit is contained in:
Tom Moor
2021-10-24 12:30:27 -07:00
committed by GitHub
parent dc92e1ead4
commit 33b6fbdee9
55 changed files with 1373 additions and 400 deletions

6
app/utils/history.js Normal file
View File

@@ -0,0 +1,6 @@
// @flow
import { createBrowserHistory } from "history";
const history = createBrowserHistory();
export default history;

View File

@@ -3,12 +3,32 @@ import queryString from "query-string";
import Collection from "models/Collection";
import Document from "models/Document";
export function homeUrl(): string {
export function homePath(): string {
return "/home";
}
export function newCollectionUrl(): string {
return "/collection/new";
export function draftsPath(): string {
return "/drafts";
}
export function templatesPath(): string {
return "/templates";
}
export function settingsPath(): string {
return "/settings";
}
export function archivePath(): string {
return "/archive";
}
export function trashPath(): string {
return "/trash";
}
export function groupSettingsPath(): string {
return "/settings/groups";
}
export function collectionUrl(url: string, section: ?string): string {
@@ -54,7 +74,7 @@ export function updateDocumentUrl(oldUrl: string, document: Document): string {
return oldUrl.replace(new RegExp("/doc/[0-9a-zA-Z-_~]*"), document.url);
}
export function newDocumentUrl(
export function newDocumentPath(
collectionId: string,
params?: {
parentDocumentId?: string,