From 9c3b75e602e6db90965183ab468ba389c7d1e9b0 Mon Sep 17 00:00:00 2001 From: SuperSuperDev Date: Mon, 28 Jun 2021 08:02:17 +0700 Subject: [PATCH] feat: add classnames helper --- components/CustomLink.jsx | 6 +++++- lib/helper.js | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 lib/helper.js diff --git a/components/CustomLink.jsx b/components/CustomLink.jsx index 266551a..947a1a1 100644 --- a/components/CustomLink.jsx +++ b/components/CustomLink.jsx @@ -1,10 +1,14 @@ +import { classNames } from '@/lib/helper'; import UnstyledLink from './UnstyledLink'; export default function CustomLink({ children, className = '', ...rest }) { return ( {children} diff --git a/lib/helper.js b/lib/helper.js new file mode 100644 index 0000000..36ea49b --- /dev/null +++ b/lib/helper.js @@ -0,0 +1,3 @@ +export function classNames(...classes) { + return classes.filter(Boolean).join(' '); +}