Skip to content

Commit

Permalink
Correctly enable and disable import button
Browse files Browse the repository at this point in the history
  • Loading branch information
psrpinto committed Sep 26, 2024
1 parent de35b17 commit 8e0c64c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/ui/flows/blog-post/SelectContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ export function SelectContent( props: { post: Post; onExit: () => void } ) {
[ waitingForSelection, lastClickedElement ]
);

const isValid = title && date && content;
const isValid =
title.original !== '' &&
date.original !== '' &&
content.original !== '';

return (
<>
<div>Select the content of the post</div>
Expand All @@ -106,8 +110,8 @@ export function SelectContent( props: { post: Post; onExit: () => void } ) {
</button>
<Section
label="Title"
originalValue={ title?.original }
parsedValue={ title?.parsed }
originalValue={ title.original }
parsedValue={ title.parsed }
disabled={ !! waitingForSelection }
waitingForSelection={
!! waitingForSelection &&
Expand All @@ -128,8 +132,8 @@ export function SelectContent( props: { post: Post; onExit: () => void } ) {
/>
<Section
label="Date"
originalValue={ date?.original }
parsedValue={ date?.utcString }
originalValue={ date.original }
parsedValue={ date.utcString }
disabled={ !! waitingForSelection }
waitingForSelection={
!! waitingForSelection &&
Expand All @@ -150,8 +154,8 @@ export function SelectContent( props: { post: Post; onExit: () => void } ) {
/>
<Section
label="Content"
originalValue={ content?.original }
parsedValue={ content?.parsed }
originalValue={ content.original }
parsedValue={ content.parsed }
disabled={ !! waitingForSelection }
waitingForSelection={
!! waitingForSelection &&
Expand Down

0 comments on commit 8e0c64c

Please sign in to comment.