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

PostLockedModal: Update action buttons markup #37837

Merged
merged 1 commit into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
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
30 changes: 20 additions & 10 deletions packages/editor/src/components/post-locked-modal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { get } from 'lodash';
* WordPress dependencies
*/
import { __, sprintf } from '@wordpress/i18n';
import { Modal, Button } from '@wordpress/components';
import { Modal, Button, Flex, FlexItem } from '@wordpress/components';
import { useSelect, useDispatch } from '@wordpress/data';
import { addQueryArgs } from '@wordpress/url';
import { useEffect } from '@wordpress/element';
Expand Down Expand Up @@ -218,15 +218,25 @@ export default function PostLockedModal() {
) }
</p>

<div className="editor-post-locked-modal__buttons">
<PostPreviewButton />
<Button variant="tertiary" href={ unlockUrl }>
{ __( 'Take over' ) }
</Button>
<Button variant="primary" href={ allPostsUrl }>
{ allPostsLabel }
</Button>
</div>
<Flex
className="editor-post-locked-modal__buttons"
justify="flex-end"
expanded={ false }
>
<FlexItem>
<PostPreviewButton />
</FlexItem>
<FlexItem>
<Button variant="tertiary" href={ unlockUrl }>
{ __( 'Take over' ) }
</Button>
</FlexItem>
<FlexItem>
<Button variant="primary" href={ allPostsUrl }>
{ allPostsLabel }
</Button>
</FlexItem>
</Flex>
</div>
) }
</Modal>
Expand Down
3 changes: 0 additions & 3 deletions packages/editor/src/components/post-locked-modal/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

.editor-post-locked-modal__buttons {
margin-top: $grid-unit-30;
Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to note that this should be a $grid-unit-15, and I think we're only using $grid-unit-30 because of margin collapse.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good thought. I'd love to actually see the more stack-based approach for contents inside here, so we don't have to specify this margin at all, something like this perhaps.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, or we should switch to top margins for paragraphs.

display: flex;
justify-content: flex-end;
gap: $grid-unit-10;
}

.editor-post-locked-modal__avatar {
Expand Down