Skip to content

Commit

Permalink
[desk-tool] Centering editor spinners (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristoffer J. Sivertsen committed Mar 14, 2018
1 parent ed99ec2 commit c10d3cf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/@sanity/desk-tool/src/pane/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,13 @@ export default withRouterHOC(
isSelected // last pane is always selected for now
>
<div className={styles.root}>
{isCreatingDraft && <Spinner fullscreen message="Making changes…" />}
{isPublishing && <Spinner fullscreen message="Publishing…" />}
{isUnpublishing && <Spinner fullscreen message="Unpublishing…" />}
{(isCreatingDraft || isPublishing || isUnpublishing) && (
<div className={styles.spinnerContainer}>
{isCreatingDraft && <Spinner center message="Making changes…" />}
{isPublishing && <Spinner center message="Publishing…" />}
{isUnpublishing && <Spinner center message="Unpublishing…" />}
</div>
)}
<div className={styles.top}>
<div className={styles.editedDate}>
{value && (
Expand Down
15 changes: 15 additions & 0 deletions packages/@sanity/desk-tool/src/pane/styles/Editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
.root {
display: block;
background-color: var(--body-bg);
position: relative; /* Needed to keep the spinners in place */

@media (--screen-medium) {
background-color: transparent;
Expand Down Expand Up @@ -129,6 +130,20 @@
}
}

.spinnerContainer {
composes: frosted from "part:@sanity/base/theme/layout/backgrounds-style";
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 3;
height: 100vh;

@media (--screen-medium) {
height: calc(100vh - 6rem); /* 6rem is aprox the height of the header stuff */
}
}

.validationButton {
border: 5px solid red;
}

0 comments on commit c10d3cf

Please sign in to comment.