Skip to content

Commit

Permalink
[desk-tool] Tweak document pane layout
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard authored and rexxars committed Oct 6, 2020
1 parent 55a7c67 commit 9155e22
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
padding: var(--small-padding);
}

.changesSinceSelectContainer {
flex: 1;
min-width: 0;

@nest & > div {
display: inline-block;
}
}

.versionSelectContainer {
padding: var(--extra-small-padding) var(--small-padding);
padding-right: calc(var(--medium-padding) - var(--extra-small-padding) + 1px);
Expand All @@ -41,11 +50,6 @@
}
}

.changesSinceSelectContainer {
flex: 1;
min-width: 0;
}

.changeAuthorsContainer {
margin-left: auto;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,27 @@ export function ChangesPanel({
</div>

<div className={styles.versionSelectContainer}>
<div className={styles.changesSinceSelectContainer} ref={changesSinceSelectRef}>
<Button
kind="simple"
onMouseUp={ignoreClickOutside}
onClick={onTimelineOpen}
padding="small"
selected={isTimelineOpen && timelineMode === 'since'}
size="small"
>
{/* eslint-disable-next-line no-nested-ternary */}
{menuOpen ? (
<>Review changes since</>
) : since ? (
<SinceText since={since} />
) : (
<>Since unknown version</>
)}{' '}
&darr;
</Button>
<div className={styles.changesSinceSelectContainer}>
<div ref={changesSinceSelectRef}>
<Button
kind="simple"
onMouseUp={ignoreClickOutside}
onClick={onTimelineOpen}
padding="small"
selected={isTimelineOpen && timelineMode === 'since'}
size="small"
>
{/* eslint-disable-next-line no-nested-ternary */}
{menuOpen ? (
<>Review changes since</>
) : since ? (
<SinceText since={since} />
) : (
<>Since unknown version</>
)}{' '}
&darr;
</Button>
</div>
</div>

{changeAnnotations.length > 0 && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@

.documentContainer {
flex: 3;
min-width: 0;
min-width: 334px;
position: relative;
}

.changesContainer {
flex: 2;
min-width: 0;
border-left: 1px solid var(--hairline-color);
min-width: 334px;
max-width: 480px;
border-left: 1px dashed var(--hairline-color);
}
4 changes: 2 additions & 2 deletions packages/@sanity/desk-tool/src/tool/DeskToolPanes.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import styles from './DeskToolPanes.css'
const COLLAPSED_WIDTH = 49

function getPaneMinSize(pane) {
return pane.type === 'document' ? 500 : 320
return pane.type === 'document' ? 668 : 320
}

function getPaneDefaultSize(pane) {
return pane.type === 'document' ? 672 : 350
return pane.type === 'document' ? 668 : 350
}

function getWaitMessages(path) {
Expand Down

0 comments on commit 9155e22

Please sign in to comment.