Skip to content

Commit

Permalink
Fixes to #906 and #907
Browse files Browse the repository at this point in the history
  • Loading branch information
Oksamies committed Nov 16, 2023
1 parent d5b9ea5 commit 408033c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { StoryFn, Meta } from "@storybook/react";
import { Button, Dialog } from "@thunderstore/cyberstorm";
import { DialogProps } from "@thunderstore/cyberstorm/src/components/Dialog/Dialog";
import React from "react";

const meta = {
Expand All @@ -17,7 +16,7 @@ const defaultArgs = {
),
};

const Template: StoryFn<typeof Dialog.Root> = (args: DialogProps) => (
const Template: StoryFn<typeof Dialog.Root> = (args) => (
<Dialog.Root {...args}>
<div
style={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const meta = {
component: Toast,
} as Meta<typeof Toast>;

const defaultArgs: ToastProps = {
const defaultArgs = {
id: uuid(),
message: "-",
variant: "info",
variant: "info" as const,
};

const Template: StoryFn<typeof Toast> = (args) => (
Expand Down
9 changes: 4 additions & 5 deletions packages/cyberstorm/src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ import { faXmarkLarge } from "@fortawesome/pro-solid-svg-icons";
import { Tooltip } from "../..";
import { classnames } from "../../utils/utils";

export interface DialogProps extends PropsWithChildren {
interface DialogProps extends PropsWithChildren {
defaultOpen?: boolean;
trigger?: ReactNode;
title?: string;
noPadding?: boolean;
disableDialogContentStyles?: boolean;
showHeaderBorder?: boolean;
preStyledFooter?: boolean;
}

/**
Expand All @@ -26,7 +25,7 @@ export function Dialog(props: DialogProps) {
defaultOpen = false,
trigger,
title = undefined,
noPadding = false,
disableDialogContentStyles = false,
showHeaderBorder = false,
} = props;

Expand Down Expand Up @@ -76,7 +75,7 @@ export function Dialog(props: DialogProps) {
<div
className={classnames(
styles.body,
noPadding ? null : styles.bodyPadding
disableDialogContentStyles ? null : styles.bodyPadding
)}
>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function PackageDependencyList(props: PackageDependencyListProps) {
headerIcon={<FontAwesomeIcon icon={faBoxOpen} />}
headerRightContent={
<Dialog.Root
noPadding
disableDialogContentStyles
showHeaderBorder
title="Required mods"
trigger={
Expand Down
4 changes: 1 addition & 3 deletions packages/cyberstorm/src/components/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ interface CyberstormProvidersProps {
export function CyberstormProviders(props: CyberstormProvidersProps) {
return (
<Toast.Provider toastDuration={props.toastDuration ?? 10000}>
<RadixTooltip.Provider
delayDuration={props.toastDuration ? props.toastDuration : 80}
>
<RadixTooltip.Provider delayDuration={props.toastDuration ?? 80}>
{props.children}
</RadixTooltip.Provider>
</Toast.Provider>
Expand Down
2 changes: 1 addition & 1 deletion packages/cyberstorm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export {
export { Title, type TitleProps } from "./components/Title/Title";
export { Tooltip, type TooltipProps } from "./components/Tooltip/Tooltip";
export { Alert, type AlertProps } from "./components/Alert/Alert";
export { Toast, type ToastProps } from "./components/Toast/Toast";
export { Toast } from "./components/Toast/Toast";
export { CommunityListLayout } from "./components/Layout/CommunityListLayout/CommunityListLayout";
export { ErrorLayout } from "./components/Layout/ErrorLayout/ErrorLayout";
export { HomeLayout } from "./components/Layout/HomeLayout/HomeLayout";
Expand Down

0 comments on commit 408033c

Please sign in to comment.