Skip to content

Commit

Permalink
0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski committed Feb 24, 2023
1 parent 380805e commit 37901c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sonner",
"version": "0.1",
"version": "0.1.1",
"description": "An opinionated toast component for React.",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
7 changes: 3 additions & 4 deletions website/src/components/Other/Other.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export const Other = ({
[setRichColors],
);

const [activeType, setActiveType] = React.useState(allTypes[0]);
const [activeType, setActiveType] = React.useState({} as (typeof allTypes)[0]);

const richColorsActive = activeType.name.includes('Rich');
const closeButtonActive = activeType.name.includes('Close');
const richColorsActive = activeType?.name?.includes('Rich');
const closeButtonActive = activeType?.name?.includes('Close');

return (
<div>
Expand All @@ -56,7 +56,6 @@ export const Other = ({
{allTypes.map((type) => (
<button
className="button"
data-active={activeType.name === type.name}
onClick={() => {
type.action();
setActiveType(type);
Expand Down

1 comment on commit 37901c7

@vercel
Copy link

@vercel vercel bot commented on 37901c7 Feb 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.