Skip to content

Commit

Permalink
refactor: (playground) rename ToastCustomOptions to ``ToastHeadle…
Browse files Browse the repository at this point in the history
…ss`` and update toast messages for ``ToastAnimation``
  • Loading branch information
pheralb committed Jan 28, 2025
1 parent 7e5e62d commit 6b046ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
6 changes: 3 additions & 3 deletions website/src/components/playground/toastAnimation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const ToastAnimation = () => {

const handleChangeAnimation = (animation: ToastAnimations) => {
setToastAnimation(animation);
toast.default({
text: `A default toast 🚀`,
description: `✨ @pheralb/toast`,
toast.info({
text: `Close me 👀`,
description: `✨ ${animation} animation`,
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Codeblock from "@/components/codeblock/client";

import { Button } from "@/ui/button";

const ToastCustomOptions = () => {
const ToastHeadless = () => {
const { applyCustomTheme, setApplyCustomTheme } = useDocsStore();

const toastStyles: ToastOptions = {
Expand All @@ -30,9 +30,7 @@ const ToastCustomOptions = () => {
"relative flex items-center",
),
container: cn("flex items-center py-4 space-x-2 px-4 w-full"),
content: cn(
"flex flex-col space-y-0.5 mr-2 [p:nth-child(1)]:text-red-500 dark:[p:nth-child(1)]:text-red-400",
),
content: cn("flex flex-col space-y-0.5 mr-2"),
actions: {
container: cn("flex flex-col px-3"),
actionBtn: cn(
Expand Down Expand Up @@ -66,8 +64,8 @@ const ToastCustomOptions = () => {

const handleTryToast = () => {
toast.success({
text: "Custom styles",
description: "Built with Tailwind CSS",
text: "Headless Toast",
description: "with Tailwind CSS",
delayDuration: 14000,
action: {
onClick: () => {
Expand Down Expand Up @@ -153,4 +151,4 @@ const ToastCustomOptions = () => {
);
};

export default ToastCustomOptions;
export default ToastHeadless;
4 changes: 2 additions & 2 deletions website/src/mdx/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import InstallLibrary from "@/components/installLibrary";
import FrameworkGuidesComponent from "@/components/frameworkGuides";

// Playground Components:
import ToastCustomOptions from "@/components/playground/toastCustomOptions";
import {
ToastVariantExamples,
ToastActionsExamples,
ToastLoadingExample,
} from "@/components/playground/toast";
import { Positions, ThemeExamples } from "@/components/playground/toaster";
import ToastAnimation from "@/components/playground/toastAnimation";
import ToastHeadless from "@/components/playground/toastHeadless";

// Local Components:
import CodeblockMDX from "@/components/codeblock/mdx";
Expand All @@ -34,7 +34,7 @@ export function MDX(props: MDXComponentsProps) {
Hero,
Positions,
ThemeExamples,
ToastCustomOptions,
ToastHeadless,
ToastVariantExamples,
ToastActionsExamples,
ToastLoadingExample,
Expand Down

0 comments on commit 6b046ed

Please sign in to comment.