-
Notifications
You must be signed in to change notification settings - Fork 54
[WC-3037] RichText: Modal form orientation #1811
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
base: main
Are you sure you want to change the base?
Conversation
packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/Dialog.tsx
Outdated
Show resolved
Hide resolved
packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/Dialog.tsx
Outdated
Show resolved
Hide resolved
packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/DialogContent.tsx
Outdated
Show resolved
Hide resolved
packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/DialogContent.tsx
Outdated
Show resolved
Hide resolved
packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/DialogContent.tsx
Outdated
Show resolved
Hide resolved
packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/DialogContent.tsx
Outdated
Show resolved
Hide resolved
packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/Dialog.scss
Outdated
Show resolved
Hide resolved
packages/pluggableWidgets/rich-text-web/src/components/ModalDialog/DialogContent.tsx
Outdated
Show resolved
Hide resolved
a4f60b5
to
9f49b5d
Compare
@@ -22,38 +24,51 @@ export default function LinkDialog(props: LinkDialogProps): ReactElement { | |||
}; | |||
|
|||
return ( | |||
<DialogContent className="link-dialog"> | |||
<DialogContent className={classNames("link-dialog", { "form-vertical": formOrientation === "vertical" })}> |
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.
Let's move this deriving of form-vertical
class to the DialogContent
container itself. So that we don't have to do this in every instance of the dialog. DialogContent should receive formOrientation
as a prop, similar to FormControl
.
export function DialogBody(props: PropsWithChildrenWithClass): ReactElement { | ||
const { children, className } = props; | ||
export function DialogBody( | ||
props: PropsWithChildrenWithClass & { formOrientation: "horizontal" | "vertical" } |
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.
Make it a interface similar to FormControlProps
.
<div> | ||
<label>Source Code</label> | ||
</div> | ||
<FormControl> | ||
<FormControl label="Title" formOrientation={props.formOrientation} inputId="rich-text-view-code-input"> |
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.
Title
, is it correct?
Pull request type
New feature (non-breaking change which adds functionality)
Description
Added support to configure the form orientation of modals, via the widget properties in Studio Pro.
Now Developers can configure this in the same way as this is done with regular TextBoxes in a DataView
What should be covered while testing?