Skip to content

Commit

Permalink
replace ephemeralformcontent logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mnholtz committed Apr 29, 2024
1 parent 0c4b204 commit 213f50c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/bricks/transformers/ephemeralForm/EphemeralFormContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import DescriptionField from "@/components/formBuilder/DescriptionField";
import RjsfSelectWidget from "@/components/formBuilder/RjsfSelectWidget";
import TextAreaWidget from "@/components/formBuilder/TextAreaWidget";
import { Stylesheets } from "@/components/Stylesheets";
import { useStylesheetsContextWithFormDefault } from "@/components/StylesheetsContext";

export const fields = {
DescriptionField,
Expand All @@ -55,8 +56,21 @@ const EphemeralFormContent: React.FC<EphemeralFormContentProps> = ({
nonce,
isModal,
}) => {
const { schema, uiSchema, cancelable, submitCaption, stylesheets } =
definition;
const {
schema,
uiSchema,
cancelable,
submitCaption,
stylesheets: newStylesheets,
disableParentStyles,
} = definition;

// Ephemeral form can never be nested, but we use this to pull in
// the (boostrap) base themes
const { stylesheets } = useStylesheetsContextWithFormDefault({
newStylesheets,
disableParentStyles,
});

return (
<Stylesheets href={stylesheets}>
Expand Down

0 comments on commit 213f50c

Please sign in to comment.