Skip to content

Commit

Permalink
1.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisnguyen2804 committed Jan 25, 2024
1 parent 33034e1 commit 8e206da
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/components/image/image-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { AnimatePresence, motion } from "framer-motion";
import { useEffect, useMemo } from "react";
import { createPortal } from "react-dom";
import { twMerge } from "tailwind-merge";
import { useComponentStyle } from "../../main";
import { IImagePreview } from "./image.types";
import { useImagePreview } from "./use-image-preview";
import {
Expand All @@ -13,6 +12,7 @@ import {
SearchZoomIn1,
SearchZoomOut1,
} from "iconsax-react";
import { useComponentStyle } from "../../customization/styles/theme.context";

export const ImagePreview = ({
backdropClassName = "",
Expand Down
2 changes: 1 addition & 1 deletion lib/components/image/image.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useState } from "react";
import { twMerge } from "tailwind-merge";
import { useComponentStyle } from "../../main";
import { ImagePreview } from "./image-preview";
import { ImageComponent } from "./image.component";
import { IImage } from "./image.types";
import { useComponentStyle } from "../../customization/styles/theme.context";

export const Image = ({
isPreviewable = true,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/toast/toast.component.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Variants, motion, useIsPresent } from "framer-motion";
import { memo, useEffect, useMemo, useState } from "react";
import { twMerge } from "tailwind-merge";
import { useComponentStyle } from "../../main";
import { Alert } from "../alert/alert";
import { ToastProviderProps } from "./toast.provider";
import { ToastOptions } from "./toast.types";
import { useTimeout } from "./toast.utils";
import { useComponentStyle } from "../../customization/styles/theme.context";

const toastMotionVariants: Variants = {
initial: (props: ToastOptions) => {
Expand Down
4 changes: 2 additions & 2 deletions lib/components/toast/toast.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { AnimatePresence } from "framer-motion";
import { createContext, useContext, useSyncExternalStore } from "react";
import { createPortal } from "react-dom";
import { twMerge } from "tailwind-merge";
import { useComponentStyle } from "../../main";
import { ToastComponent } from "./toast.component";
import { toastStore } from "./toast.store";
import { CloseAllToastsOptions, ToastId, ToastOptions } from "./toast.types";
import { useComponentStyle } from "../../customization/styles/theme.context";

export interface ToastMethods {
notify: (options?: ToastOptions) => ToastId;
Expand Down Expand Up @@ -48,7 +48,7 @@ export const useToastOptionContext = () => {

export const ToastProvider = (props: ToastProviderProps) => {
const theme = useComponentStyle("Toast");
const { toastSpacing = '6px' } = props;
const { toastSpacing = "6px" } = props;
const state = useSyncExternalStore(
toastStore.subscribe,
toastStore.getState,
Expand Down
13 changes: 9 additions & 4 deletions lib/providers/zeni-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { useEffect } from "react";
import { ToastOptionProvider, ToastProvider, ToastProviderProps, applyTheme } from "../main";
import {
ToastOptionProvider,
ToastProvider,
ToastProviderProps,
} from "../main";
import { ThemeType } from "../customization/theme";

import { applyTheme } from "../customization/theme/utils";

export const ZeniProvider = ({
initialTheme,
Expand All @@ -12,7 +16,6 @@ export const ZeniProvider = ({
children: React.ReactNode;
toastOptions?: ToastProviderProps;
}) => {

useEffect(() => {
const savedTheme = localStorage.getItem("theme");
const defaultTheme =
Expand All @@ -23,7 +26,9 @@ export const ZeniProvider = ({

return (
<>
<ToastOptionProvider value={toastOptions?.defaultOptions}>{children}</ToastOptionProvider>
<ToastOptionProvider value={toastOptions?.defaultOptions}>
{children}
</ToastOptionProvider>
<ToastProvider toastSpacing={toastOptions?.toastSpacing} />
</>
);
Expand Down

0 comments on commit 8e206da

Please sign in to comment.