aboutsummaryrefslogtreecommitdiff
path: root/packages/ui/src/utils.tsx
diff options
context:
space:
mode:
authorWyvest <wyvestbusiness@gmail.com>2024-01-20 11:29:57 -0500
committerGitHub <noreply@github.com>2024-01-20 11:29:57 -0500
commit0afab2cd1b1266034d35cd66f41c3bde90847f9e (patch)
tree54172a78823cf76761ab88e21d6d2c64d5b965c3 /packages/ui/src/utils.tsx
parent55b593c4e6b90137995aee9a55ba2a86423cc7bd (diff)
parent55548a94b61ce7d1ca0ca8da69db7566f937cfeb (diff)
downloadNexus-0afab2cd1b1266034d35cd66f41c3bde90847f9e.tar.gz
Nexus-0afab2cd1b1266034d35cd66f41c3bde90847f9e.tar.bz2
Nexus-0afab2cd1b1266034d35cd66f41c3bde90847f9e.zip
Merge pull request #4 from Polyfrost/website/icon-fix
Diffstat (limited to 'packages/ui/src/utils.tsx')
-rw-r--r--packages/ui/src/utils.tsx14
1 files changed, 7 insertions, 7 deletions
diff --git a/packages/ui/src/utils.tsx b/packages/ui/src/utils.tsx
index 5ccb488..67782bb 100644
--- a/packages/ui/src/utils.tsx
+++ b/packages/ui/src/utils.tsx
@@ -1,16 +1,16 @@
import clsx from 'clsx';
import React from 'react';
-const twFactory =
- (element: any) =>
- ([newClassNames, ..._]: TemplateStringsArray) =>
+function twFactory(element: any) {
+ return ([newClassNames, ..._]: TemplateStringsArray) =>
React.forwardRef(({ className, ...props }: any, ref) =>
React.createElement(element, {
...props,
className: clsx(newClassNames, className),
- ref
- })
+ ref,
+ }),
);
+}
type ClassnameFactory<T> = (s: TemplateStringsArray) => T;
@@ -19,10 +19,10 @@ type TailwindFactory = {
React.ForwardRefExoticComponent<JSX.IntrinsicElements[K]>
>;
} & {
- <T>(c: T): ClassnameFactory<T>;
+ <T>(c: T): ClassnameFactory<T>
};
export const tw = new Proxy((() => {}) as unknown as TailwindFactory, {
get: (_, property: string) => twFactory(property),
- apply: (_, __, [el]: [React.ReactElement]) => twFactory(el)
+ apply: (_, __, [el]: [React.ReactElement]) => twFactory(el),
});