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

External Media / AI Image Generator: update button style #39985

Merged
merged 4 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/fix-external-media-button
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: compat

External Media: ensure that the image block's external media picker button remains consistent with the other buttons in the image block.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ $grid-size: 8px;
font-weight: 400;
line-height: 1.43;
color: var( --jp-gray-60 );
text-align: left;
margin: 0;
}
.jetpack-external-media-wrapper__jetpack_app_media-wrapper.has-no-image-uploaded {
Expand Down Expand Up @@ -543,33 +542,34 @@ $grid-size: 8px;
}

.jetpack-external-media-button-menu__dropdown {
width: 100%;
display: flex;

.jetpack-external-media-button-menu {
width: 100%;
flex-direction: row;
text-align: left;
padding-left: 12px;
padding-right: 12px;

.jetpack-external-media-button-menu__label {
flex-grow: 2;
}
}
}

// Set the wrapper as a flex container to allow displaying multiple buttons side by side.
.jetpack-external-media-button-wrapper {
display: flex;
@media only screen and ( min-width: 783px ) {
display: flex;
gap: $grid-size * 2;

:where(.is-medium, .is-small) & {
display: block;
gap: 0;
}
}
}

// Reset placeholder button margin.
.components-placeholder__fieldset,
.editor-post-featured-image {
.components-dropdown .jetpack-external-media-button-menu {
width: auto;
margin-bottom: 1em;

> svg {
display: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ function MediaAiButton( props ) {
const { setSelectedSource } = props;
return (
<Button
variant="tertiary"
__next40pxDefaultSize
variant="secondary"
className="jetpack-external-media-button-menu"
aria-haspopup="false"
onClick={ () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import MediaSources from './media-sources';
function MediaButtonMenu( props ) {
const { mediaProps, open, setSelectedSource, isFeatured, isReplace, hasImage } = props;
const originalComponent = mediaProps.render;
let variant = 'tertiary';

if ( isReplace ) {
return (
Expand All @@ -30,7 +29,6 @@ function MediaButtonMenu( props ) {

if ( isFeatured ) {
label = __( 'Replace Image', 'jetpack' );
variant = 'secondary';
}

return (
Expand All @@ -50,7 +48,8 @@ function MediaButtonMenu( props ) {
}
return (
<Button
variant={ variant }
__next40pxDefaultSize
variant="secondary"
className="jetpack-external-media-button-menu"
aria-haspopup="true"
aria-expanded={ isOpen }
Expand Down
Loading