-
Notifications
You must be signed in to change notification settings - Fork 257
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
Move WordPress & Gutenberg PR Preview to Playground website #1938
base: trunk
Are you sure you want to change the base?
Changes from all commits
50878bf
a62d862
b2a9515
ab78d44
2bceaf1
ccdb830
192b7f8
60ffe8a
92ab9f1
e22cc20
239809d
b784d98
310e483
747ba06
0fd6775
b6a140d
71cc2e3
b5f3355
419deb7
02932bb
3a94478
20e3a5b
c143d8d
23d9327
3bbd338
f4acb75
c3ee188
a33d69d
cece255
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ import { | |
setSiteManagerOpen, | ||
} from '../../lib/state/redux/slice-ui'; | ||
import { ImportFormModal } from '../import-form/modal'; | ||
import { PreviewPRModal } from '../../github/preview-pr/modal'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The way the modal modules are laid out is a bit different than usual module layout. Here, we are importing Can we reorganize these modal modules and imports so that For
The current organization works, but it's a bit backwards in the way it uses |
||
|
||
acquireOAuthTokenIfNeeded(); | ||
|
||
|
@@ -42,7 +43,9 @@ export const modalSlugs = { | |
START_ERROR: 'start-error', | ||
IMPORT_FORM: 'import-form', | ||
GITHUB_IMPORT: 'github-import', | ||
GITHUB_EXPORT: 'github-export' | ||
GITHUB_EXPORT: 'github-export', | ||
PREVIEW_PR_WP: 'preview-pr-wordpress', | ||
PREVIEW_PR_GUTENBERG: 'preview-pr-gutenberg', | ||
} | ||
|
||
const displayMode = getDisplayModeFromQuery(); | ||
|
@@ -178,6 +181,10 @@ function Modals(blueprint: Blueprint) { | |
return <StartErrorModal />; | ||
} else if (currentModal === modalSlugs.IMPORT_FORM) { | ||
return <ImportFormModal />; | ||
} else if (currentModal === modalSlugs.PREVIEW_PR_WP) { | ||
return <PreviewPRModal target={'wordpress'} />; | ||
} else if (currentModal === modalSlugs.PREVIEW_PR_GUTENBERG) { | ||
return <PreviewPRModal target={'gutenberg'} />; | ||
} else if (currentModal === modalSlugs.GITHUB_IMPORT) { | ||
return <GithubImportModal | ||
onImported={({ | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Button, Flex } from '@wordpress/components'; | ||
import React from 'react'; | ||
|
||
interface ModalButtonsProps { | ||
submitText?: string; | ||
areDisabled?: boolean; | ||
areBusy?: boolean; | ||
onCancel?: () => void; | ||
onSubmit?: (e: any) => void; | ||
} | ||
export default function ModalButtons({ submitText = 'Submit', areDisabled = false, areBusy, onCancel, onSubmit }: ModalButtonsProps) { | ||
return ( | ||
<Flex | ||
justify={'end'} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not a big deal, but if we're using a string, we can say just |
||
> | ||
<Button | ||
isBusy={areBusy} | ||
disabled={areDisabled} | ||
variant="link" | ||
onClick={onCancel} | ||
> | ||
Cancel | ||
</Button> | ||
<Button | ||
isBusy={areBusy} | ||
disabled={areDisabled} | ||
variant="primary" | ||
onClick={onSubmit} | ||
> | ||
{submitText} | ||
</Button> | ||
</Flex> | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to keep more vertical spacing between the bottom buttons and the content. The alignment change seems fine and aligns with other modals in the Playground web app redesign Figma.
Before this PR:
After this PR: