Skip to content

Commit

Permalink
Webapp: Design improvements
Browse files Browse the repository at this point in the history
* Adds a horizontal gap between modal buttons
* Restores vertical margin between GitHub modal text paragraphs
* Removes the double "Playground sites" header in the sidebar
  • Loading branch information
adamziel committed Nov 22, 2024
1 parent 9f46e51 commit 2c1b687
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ interface ModalButtonsProps {
onCancel?: () => void;
onSubmit?: (e: any) => void;
}
export default function ModalButtons({ submitText = 'Submit', areDisabled = false, areBusy, onCancel, onSubmit }: ModalButtonsProps) {
export default function ModalButtons({
submitText = 'Submit',
areDisabled = false,
areBusy,
onCancel,
onSubmit,
}: ModalButtonsProps) {
return (
<Flex
justify="end"
className={css.modalButtons}
>
<Flex justify="end" className={css.modalButtons} gap={4}>
<Button
isBusy={areBusy}
disabled={areDisabled}
Expand All @@ -32,5 +35,5 @@ export default function ModalButtons({ submitText = 'Submit', areDisabled = fals
{submitText}
</Button>
</Flex>
)
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ export function Sidebar({
aria-orientation={undefined}
>
{/* Padding 3px is because of focus on dropdown button */}
<Flex justify="space-between" direction="row" style={{ padding: '3px'}}>
<Flex
justify="space-between"
direction="row"
style={{ padding: '3px' }}
>
<h1 className="sr-only">WordPress Playground</h1>
<div className={css.sidebarHeader}>
{/* Remove Playground logo because branding isn't finalized. */}
Expand All @@ -111,21 +115,15 @@ export function Sidebar({
<>
<WordPressPRMenuItem
onClose={onClose}
disabled={
offline
}
disabled={offline}
/>
<GutenbergPRMenuItem
onClose={onClose}
disabled={
offline
}
disabled={offline}
/>
<GithubImportMenuItem
onClose={onClose}
disabled={
offline
}
disabled={offline}
/>
<RestoreFromZipMenuItem
text="Import from .zip"
Expand Down Expand Up @@ -214,10 +212,7 @@ export function Sidebar({
>
Saved Playgrounds
</Heading>
<MenuGroup
className={css.sidebarList}
label="Saved Playgrounds"
>
<MenuGroup className={css.sidebarList}>
{storedSites.map((site) => {
/**
* The `wordpress` site is selected when no site slug is provided.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,11 @@ export default function GitHubExportForm({

if (pushResult) {
return (
<form id="export-playground-form" onSubmit={handleSubmit}>
<form
id="export-playground-form"
onSubmit={handleSubmit}
className="typography"
>
<h2>
Pull Request{' '}
{formValues.prAction === 'create' ? 'created' : 'updated'}!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ export default function GitHubImportForm({

return (
<GitHubOAuthGuard>
<form id="import-playground-form" onSubmit={handleSubmit}>
<form
id="import-playground-form"
onSubmit={handleSubmit}
className="typography"
>
<p>
You may import WordPress plugins, themes, and entire
wp-content directories from any public GitHub repository.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function Authenticate({
[css.disabled]: mayLoseProgress && !exported,
});
return (
<div>
<div className="typography">
<p>
Importing plugins, themes, and wp-content directories directly
from your public GitHub repositories.
Expand Down
3 changes: 2 additions & 1 deletion packages/playground/website/src/github/preview-pr/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,13 @@ export default function PreviewPRForm({
disabled={submitting}
label="Pull request number or URL"
value={value}
autoFocus
onChange={(e) => {
setError('');
setValue(e);
}}
/>
{errorMsg && <div>{errorMsg}</div>}
{errorMsg && <div className={css.error}>{errorMsg}</div>}
</div>
<ModalButtons
areDisabled={submitting}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@
margin: 0;
}
}

.error {
color: #f00;
}

0 comments on commit 2c1b687

Please sign in to comment.