mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-14 17:41:33 +03:00
publish: allow refreshing into a note
This commit is contained in:
parent
897905d638
commit
d953ddc385
@ -1,7 +1,7 @@
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { RouteComponentProps, Link, Route, Switch } from "react-router-dom";
|
import { RouteComponentProps, Link, Route, Switch } from "react-router-dom";
|
||||||
import { Box, Text } from "@tlon/indigo-react";
|
import { Center, LoadingSpinner } from "@tlon/indigo-react";
|
||||||
import GlobalApi from "~/api/global";
|
import GlobalApi from "~/logic/api/global";
|
||||||
import { Notebook as INotebook } from "~/types/publish-update";
|
import { Notebook as INotebook } from "~/types/publish-update";
|
||||||
import { Groups } from "~/types/group-update";
|
import { Groups } from "~/types/group-update";
|
||||||
import { Contacts, Rolodex } from "~/types/contact-update";
|
import { Contacts, Rolodex } from "~/types/contact-update";
|
||||||
@ -12,6 +12,7 @@ import NewPost from "./new-post";
|
|||||||
import { NoteRoutes } from './NoteRoutes';
|
import { NoteRoutes } from './NoteRoutes';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
interface NotebookRoutesProps {
|
interface NotebookRoutesProps {
|
||||||
api: GlobalApi;
|
api: GlobalApi;
|
||||||
ship: string;
|
ship: string;
|
||||||
@ -70,6 +71,9 @@ export function NotebookRoutes(
|
|||||||
const { noteId } = routeProps.match.params;
|
const { noteId } = routeProps.match.params;
|
||||||
const note = notebook?.notes[noteId];
|
const note = notebook?.notes[noteId];
|
||||||
const noteUrl = relativePath(`/note/${noteId}`);
|
const noteUrl = relativePath(`/note/${noteId}`);
|
||||||
|
if(!note) {
|
||||||
|
return <Center height="100%"><LoadingSpinner /></Center>;
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<NoteRoutes
|
<NoteRoutes
|
||||||
rootUrl={baseUrl}
|
rootUrl={baseUrl}
|
||||||
|
Loading…
Reference in New Issue
Block a user