Skip to content

Commit

Permalink
Fix modal actions (#1878)
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu authored Sep 29, 2023
1 parent 6dbe604 commit 3664192
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sparkle/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sparkle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dust-tt/sparkle",
"version": "0.1.91",
"version": "0.1.92",
"scripts": {
"build": "rm -rf dist && rollup -c",
"build:with-tw-base": "rollup -c --environment INCLUDE_TW_BASE:true",
Expand Down
4 changes: 3 additions & 1 deletion sparkle/src/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { Fragment } from "react";
import { classNames } from "@sparkle/lib/utils";

import { BarHeader, BarHeaderButtonBarProps } from "./BarHeader";
import { ButtonProps } from "./Button";
import { Button, ButtonProps } from "./Button";

interface ModalProps {
isOpen: boolean;
Expand All @@ -20,6 +20,7 @@ interface ModalProps {
export function Modal({
isOpen,
onClose,
action,
children,
hasChanged,
onSave,
Expand Down Expand Up @@ -78,6 +79,7 @@ export function Modal({
>
<BarHeader
title={title || ""}
leftActions={action ? <Button {...action} /> : undefined}
rightActions={<BarHeader.ButtonBar {...buttonBarProps} />}
/>
<div
Expand Down
6 changes: 6 additions & 0 deletions sparkle/src/stories/Modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ export const ModalExample = () => {
<Modal
isOpen={isOpenWithActionAndChange}
onClose={() => setIsOpenWithActionAndChange(false)}
action={{
labelVisible: true,
label: "An action",
variant: "tertiary",
size: "xs",
}}
hasChanged={true}
>
<div className="s-mt-4 s-h-72 s-text-left">I'm the modal content</div>
Expand Down

0 comments on commit 3664192

Please sign in to comment.