Fix dropdown filter bug and add save button animation
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useState } from "react"
|
||||
|
||||
import { CheckIcon } from "lucide-react"
|
||||
type Props = {
|
||||
onClick?: () => void
|
||||
disabled?: boolean
|
||||
@@ -23,13 +23,16 @@ export const SaveButton = ({
|
||||
type={btnType}
|
||||
onClick={() => {
|
||||
setClickedSave(true)
|
||||
onClick()
|
||||
if (onClick) {
|
||||
onClick()
|
||||
}
|
||||
setTimeout(() => {
|
||||
setClickedSave(false)
|
||||
}, 1000)
|
||||
}}
|
||||
disabled={disabled}
|
||||
className={`inline-flex mt-4 items-center rounded-md border border-transparent bg-black px-2 py-2 text-sm font-medium leading-4 text-white shadow-sm dark:bg-white dark:text-gray-800 disabled:opacity-50 ${className}`}>
|
||||
{clickedSave ? <CheckIcon className="w-4 h-4 mr-2" /> : null}
|
||||
{clickedSave ? textOnSave : text}
|
||||
</button>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user