feat: display draft status
This commit is contained in:
parent
7f30558577
commit
396e7a42c1
|
|
@ -7,7 +7,8 @@ export const PublishButton: React.FC<{
|
|||
save: (published: boolean) => void
|
||||
published: boolean
|
||||
isSaving: boolean
|
||||
}> = ({ save, published, isSaving }) => {
|
||||
isDisabled: boolean
|
||||
}> = ({ save, published, isSaving, isDisabled }) => {
|
||||
const [showDropdown, setShowDropdown] = useState(false)
|
||||
const dropdownRef = useRef<HTMLDivElement | null>(null)
|
||||
const triggerRef = useRef<HTMLButtonElement | null>(null)
|
||||
|
|
@ -31,6 +32,7 @@ export const PublishButton: React.FC<{
|
|||
style={{ padding: "0 15px" }}
|
||||
onClick={() => save(true)}
|
||||
isLoading={isSaving}
|
||||
isDisabled={isDisabled}
|
||||
>
|
||||
{published ? "Update" : "Publish"}
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -229,7 +229,11 @@ export default function SubdomainEditor() {
|
|||
)}
|
||||
>
|
||||
{visibility === PageVisibilityEnum.Published
|
||||
? "Published"
|
||||
? `Published${
|
||||
getStorage(draftKey)
|
||||
? " and local modifications exist"
|
||||
: ""
|
||||
}`
|
||||
: visibility === PageVisibilityEnum.Scheduled
|
||||
? "Scheduled"
|
||||
: "Draft"}
|
||||
|
|
@ -238,6 +242,7 @@ export default function SubdomainEditor() {
|
|||
save={savePage}
|
||||
published={published}
|
||||
isSaving={createOrUpdatePage.isLoading}
|
||||
isDisabled={published && !getStorage(draftKey) ? true : false}
|
||||
/>
|
||||
</div>
|
||||
</header>
|
||||
|
|
|
|||
Loading…
Reference in New Issue