Skip to content

Commit

Permalink
fix(toast): ToastToggle must have className (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
rluders authored Dec 6, 2022
1 parent cd26e24 commit 5618b21
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/components/Toast/ToastToggle.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import classNames from 'classnames';
import type { ComponentProps, FC } from 'react';
import { HiX } from 'react-icons/hi';
import { useTheme } from '../Flowbite/ThemeContext';
Expand All @@ -7,7 +8,7 @@ type ToastToggleProps = ComponentProps<'button'> & {
xIcon?: FC<ComponentProps<'svg'>>;
};

export const ToastToggle: FC<ToastToggleProps> = ({ xIcon: XIcon = HiX }) => {
export const ToastToggle: FC<ToastToggleProps> = ({ className, xIcon: XIcon = HiX }) => {
const { duration, isClosed, isRemoved, setIsClosed, setIsRemoved } = useToastContext();
const theme = useTheme().theme.toast.toggle;

Expand All @@ -17,7 +18,7 @@ export const ToastToggle: FC<ToastToggleProps> = ({ xIcon: XIcon = HiX }) => {
};

return (
<button aria-label="Close" onClick={handleClick} type="button" className={theme.base}>
<button aria-label="Close" onClick={handleClick} type="button" className={classNames(theme.base, className)}>
<XIcon className={theme.icon} />
</button>
);
Expand Down

0 comments on commit 5618b21

Please sign in to comment.