Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Media Weight UI Output #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,14 @@ const HMMediaWeightSidebar = () => {
}

const warningMsg = total >= mediaThreshold ? (
<p className="description">
<p className="description" style={
{
backgroundColor: '#1db231',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a CSS var we could use for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not, but that should probably be added to the next round of improvements.

borderRadius: '2px',
color: '#fff',
padding: '3px 6px'
}
}>
{ sprintf(
/* translators: %f: Maximum allowed size (in megabytes) for all media on page. */
__( 'Warning! The media in this page exceeds the recommended threshold of %fmb', 'hm-media-weight' ),
Expand Down Expand Up @@ -221,7 +228,7 @@ const HMMediaWeightSidebar = () => {
</p>
<p>
Attachment ID: { attachment.id }<br />
<small><a href={ attachment.link }>Go to the attachment post &rsaquo;</a></small>
<small><a href={ `upload.php?item=${ attachment.id }` }>Go to the attachment post &rsaquo;</a></small>
</p>
<details style={ { display: 'none', margin: '0.5rem 0 1rem' } }>
<summary>{ __( 'View entity record JSON', 'hm-media-weight' ) }</summary>
Expand Down