Skip to content

Commit

Permalink
Add Toolbar component
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Sep 27, 2024
1 parent d15ea6b commit de85d39
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
10 changes: 10 additions & 0 deletions src/ui/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,13 @@ ol {
width: 100%;
height: 100%;
}

/* Blog Post Flow */
.flow-blog-post-toolbar {
display: flex;
margin-bottom: 1rem;
}

.flow-blog-post-toolbar button {
margin-left: auto;
}
22 changes: 12 additions & 10 deletions src/ui/flows/blog-post/EditBlogPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Post, PostContent, PostDate, PostTitle } from '@/model/Post';
import { SelectContent } from '@/ui/flows/blog-post/SelectContent';
import { Screens } from '@/ui/App';
import { ContentBus } from '@/bus/ContentBus';
import { Toolbar } from '@/ui/flows/blog-post/Toolbar';

export function EditBlogPost() {
const [ post, setPost ] = useState< Post >();
Expand Down Expand Up @@ -40,16 +41,17 @@ export function EditBlogPost() {
'Loading...'
) : (
<>
<div>Select the content of the post</div>
<button
disabled={ ! isValid }
onClick={ async () => {
await ContentBus.disableHighlighting();
console.log( 'TODO: import' );
} }
>
Import
</button>
<Toolbar>
<button
disabled={ ! isValid }
onClick={ async () => {
await ContentBus.disableHighlighting();
console.log( 'TODO: import' );
} }
>
Import
</button>
</Toolbar>
<SelectContent
post={ post }
onDateChanged={ async ( date: PostDate ) => {
Expand Down
5 changes: 5 additions & 0 deletions src/ui/flows/blog-post/Toolbar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { PropsWithChildren } from 'react';

export function Toolbar( props: PropsWithChildren ) {
return <div className="flow-blog-post-toolbar">{ props.children }</div>;
}

0 comments on commit de85d39

Please sign in to comment.