Skip to content

Commit

Permalink
fix: remove useMemo usage for BoxFancy.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
physicsSorcererKing authored May 1, 2024
1 parent 613b117 commit d36c898
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions components/shared/BoxFancy/BoxFancy.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cn } from "@/lib/utils";
import React, { forwardRef, useMemo } from "react";
import React, { forwardRef } from "react";
import type { PolymorphicComponentProp, PolymorphicRef } from "@/lib/types";

export type BoxFancyBorderWidthVariant =
Expand Down Expand Up @@ -79,23 +79,16 @@ const InnerBoxFancy: InnerBoxFancyComponent = (
const borderGradientColorTwClassName =
BorderGradientVariantTwClassName[borderGradientColor];

const allClassName = useMemo(() => {
return cn(
"w-full h-full relative bg-black/40 effect-new-2 text-primary-50",
"flex justify-center",
"before:w-full before:h-full before:absolute before:top-0 before:left-0",
"before:[mask:linear-gradient(#fff_0_0)_exclude_content-box,linear-gradient(#fff_0_0)]",
borderWidthTwClassName,
borderRadiusTwClassName,
borderGradientColorTwClassName,
className
);
}, [
borderGradientColorTwClassName,
borderRadiusTwClassName,
const allClassName = cn(
"w-full h-full relative bg-black/40 effect-new-2 text-primary-50",
"flex justify-center",
"before:w-full before:h-full before:absolute before:top-0 before:left-0",
"before:[mask:linear-gradient(#fff_0_0)_exclude_content-box,linear-gradient(#fff_0_0)]",
borderWidthTwClassName,
className,
]);
borderRadiusTwClassName,
borderGradientColorTwClassName,
className
);

return (
<Component ref={ref} className={allClassName} {...restProps}>
Expand Down

0 comments on commit d36c898

Please sign in to comment.