-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[default-layout] Show 'Up to date' instead of specific version number
- Loading branch information
Showing
4 changed files
with
93 additions
and
30 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
packages/@sanity/default-layout/src/components/CurrentVersionsDialog.js
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,48 @@ | ||
import React from 'react' | ||
import PropTypes from 'prop-types' | ||
import Button from 'part:@sanity/components/buttons/default' | ||
import Dialog from 'part:@sanity/components/dialogs/default' | ||
import versions from 'sanity:versions' | ||
import styles from './styles/UpdateNotifierDialog.css' | ||
|
||
function CurrentVersionsDialog(props) { | ||
const {onClose} = props | ||
return ( | ||
<Dialog isOpen onClose={onClose}> | ||
<div className={styles.content}> | ||
<div> | ||
<h2>Studio is up to date</h2> | ||
|
||
<table className={styles.versionsTable}> | ||
<thead> | ||
<tr> | ||
<th>Module</th> | ||
<th>Installed</th> | ||
<th>Latest</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{Object.keys(versions).map(pkgName => ( | ||
<tr key={pkgName}> | ||
<td>{pkgName}</td> | ||
<td>{versions[pkgName]}</td> | ||
<td>{versions[pkgName]}</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
|
||
<Button color="primary" onClick={onClose}> | ||
Close | ||
</Button> | ||
</div> | ||
</div> | ||
</Dialog> | ||
) | ||
} | ||
|
||
CurrentVersionsDialog.propTypes = { | ||
onClose: PropTypes.func.isRequired | ||
} | ||
|
||
export default CurrentVersionsDialog |
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
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
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 |
---|---|---|
|
@@ -63,3 +63,7 @@ | |
composes: button; | ||
color: var(--state-info-color); | ||
} | ||
|
||
.upToDateText { | ||
color: color(var(--white) a(40%)); | ||
} |