Skip to content

Commit

Permalink
Add button to create Zettels to editor page too
Browse files Browse the repository at this point in the history
We've noticed having to go back to the homepage to add a Zettel is a little
annoying during use, and it seems to not break anything to create one from
the editor page, so do that.
  • Loading branch information
IsaacWoods committed Jul 27, 2024
1 parent ca82421 commit fa50217
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/scenes/zettel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Button from '../components/button';
import CenteredContent from '../components/centered';
import Flex from '../components/flex';
import TextareaAutosize from 'react-textarea-autosize';
import NewZettelButton from '../components/new_zettel_button';
import { fetch_zettel, update_zettel, ZettelContext } from '../zettel';
import { debounce } from 'lodash';

Expand Down Expand Up @@ -127,7 +128,9 @@ function ZettelEditor(props: { id: number }) {

return (
<>
<Header title={zettel ? zettel.title : "Loading Zettel..."} />
<Header title={zettel ? zettel.title : "Loading Zettel..."} actions={
<Action><NewZettelButton /></Action>
}/>
<CenteredContent>
{ zettel ?
<Flex auto column>
Expand Down

0 comments on commit fa50217

Please sign in to comment.