Skip to content

Commit

Permalink
feat: add classnames helper
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSuperDev authored and theodorusclarence committed Jun 28, 2021
1 parent 3e42a42 commit 9c3b75e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/CustomLink.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { classNames } from '@/lib/helper';
import UnstyledLink from './UnstyledLink';

export default function CustomLink({ children, className = '', ...rest }) {
return (
<UnstyledLink
{...rest}
className={`inline-flex items-center font-bold hover:text-primary-400 animated-underline ${className}`}
className={classNames(
'inline-flex items-center font-bold hover:text-primary-400 animated-underline',
className
)}
>
{children}
</UnstyledLink>
Expand Down
3 changes: 3 additions & 0 deletions lib/helper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function classNames(...classes) {
return classes.filter(Boolean).join(' ');
}

0 comments on commit 9c3b75e

Please sign in to comment.