diff --git a/src/Modal/Modal.luau b/src/Modal/Modal.luau index 1b529cea..7dfd7670 100644 --- a/src/Modal/Modal.luau +++ b/src/Modal/Modal.luau @@ -95,7 +95,7 @@ local function Modal(providedProps: Props) Size = UDim2.fromScale(1, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1, - }, props.content), + }, props.children), }), }) end diff --git a/src/Modal/Modal.story.luau b/src/Modal/Modal.story.luau index 7f90e39b..ecf968ad 100644 --- a/src/Modal/Modal.story.luau +++ b/src/Modal/Modal.story.luau @@ -1,7 +1,8 @@ local React = require("@pkg/React") +local ContextProviders = require("@root/Common/ContextProviders") +local MockPlugin = require("@root/Testing/MockPlugin") local Modal = require("./Modal") --- local nextLayoutOrder = require("@root/Common/nextLayoutOrder") local useTheme = require("@root/Common/useTheme") local function ExampleContent() @@ -37,12 +38,18 @@ local function ExampleContent() end return { - story = function(props: Props) - return React.createElement(Modal, { - content = React.createElement(ExampleContent), - onClose = function() - print("close") - end, + story = function() + return React.createElement(ContextProviders, { + plugin = MockPlugin.new(), + }, { + Model = React.createElement(Modal, { + title = "Example Modal", + onClose = function() + print("close") + end, + }, { + Content = React.createElement(ExampleContent), + }), }) end, } diff --git a/src/Modal/ModalPortal.luau b/src/Modal/ModalPortal.luau index d5e2bc83..46a55242 100644 --- a/src/Modal/ModalPortal.luau +++ b/src/Modal/ModalPortal.luau @@ -10,7 +10,11 @@ export type Props = { local function ModalPortal(props: Props) local modalContext = ModalContext.use() - return if modalContext.target then ReactRoblox.createPortal(props.children, modalContext.target) else nil + if modalContext.target then + return ReactRoblox.createPortal(props.children, modalContext.target) + else + return nil + end end return ModalPortal