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

chore: Updated zone and section to extend HTML attributes #36623

Merged
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
13 changes: 11 additions & 2 deletions app/client/src/pages/Editor/ActionForm/Section/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
import React from "react";
import clsx from "clsx";
import styles from "./styles.module.css";

interface SectionProps {
interface SectionProps extends React.HTMLAttributes<HTMLDivElement> {
children: React.ReactNode;
isStandalone?: boolean;
}

const Section: React.FC<SectionProps> = ({
children,
className,
isStandalone = false,
...props
}) => {
const classNames = clsx(styles.section, className);

return (
<div className={styles.section} data-standalone={isStandalone.toString()}>
<div
className={classNames}
data-standalone={isStandalone.toString()}
{...props}
>
{children}
</div>
);
Expand Down
14 changes: 11 additions & 3 deletions app/client/src/pages/Editor/ActionForm/Zone/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import React from "react";
import clsx from "clsx";
import styles from "./styles.module.css";

interface ZoneProps {
interface ZoneProps extends React.HTMLAttributes<HTMLDivElement> {
children: React.ReactNode;
layout?: "single_column" | "double_column";
}

const Zone: React.FC<ZoneProps> = ({ children, layout = "single_column" }) => {
const Zone: React.FC<ZoneProps> = ({
children,
className,
layout = "single_column",
...props
}) => {
const classNames = clsx(styles.zone, className);

return (
<div className={styles.zone} data-layout={layout}>
<div className={classNames} data-layout={layout} {...props}>
{children}
</div>
);
Expand Down
Loading