-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve UI/UX around deletion of entry revisions (#4260)
- Loading branch information
Showing
2 changed files
with
74 additions
and
6 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...adless-cms/src/admin/views/contentEntries/ContentEntry/RevisionDeletedSnackbarMessage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from "react"; | ||
import { CmsContentEntry, CmsContentEntryRevision } from "@webiny/app-headless-cms-common/types"; | ||
|
||
interface RevisionDeletedSnackbarMessageProps { | ||
deletedRevision: CmsContentEntry; | ||
newLatestRevision?: CmsContentEntryRevision; | ||
} | ||
|
||
export const RevisionDeletedSnackbarMessage = ({ | ||
deletedRevision, | ||
newLatestRevision | ||
}: RevisionDeletedSnackbarMessageProps) => { | ||
if (newLatestRevision) { | ||
return ( | ||
<span> | ||
Successfully deleted revision <strong>#{deletedRevision.meta.version}</strong>. | ||
Redirecting to revision <strong>#{newLatestRevision.meta.version}</strong>... | ||
</span> | ||
); | ||
} | ||
|
||
return ( | ||
<span> | ||
Successfully deleted last revision <strong>#{deletedRevision.meta.version}</strong>. | ||
Redirecting to list of entries... | ||
</span> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters