Skip to content

Commit

Permalink
fix(mellow-react): make it easy to merge classes
Browse files Browse the repository at this point in the history
  • Loading branch information
DominusKelvin committed Sep 20, 2024
1 parent 871aa94 commit 07248d8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions templates/mellow-react/assets/js/components/InputButton.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
export default function InputButton({ processing, label, ...props }) {
const mergeClasses = (...classes) => {
return classes.filter(Boolean).join(' ')
}
export default function InputButton({
processing,
className,
label,
...props
}) {
return (
<button
type="submit"
className="relative flex items-center justify-center rounded-md border border-brand bg-brand px-4 py-3 text-white disabled:cursor-not-allowed disabled:border-gray-200/40 disabled:bg-gray-200/40 disabled:text-gray"
className={mergeClasses(
'relative flex items-center justify-center rounded-md border border-brand bg-brand px-4 py-3 text-white',
'disabled:cursor-not-allowed disabled:border-gray-200/40 disabled:bg-gray-200/40 disabled:text-gray',
className
)}
{...props}
>
{processing && (
Expand Down

0 comments on commit 07248d8

Please sign in to comment.