fix maximum update
This commit is contained in:
@@ -12,7 +12,7 @@ type Props = {
|
|||||||
XOR<{ children: ReactNode }, { label: string }>;
|
XOR<{ children: ReactNode }, { label: string }>;
|
||||||
|
|
||||||
const Button: FC<Props> = memo((props) => {
|
const Button: FC<Props> = memo((props) => {
|
||||||
const { variant = 'primary', size = 'md', className, ...restProps } = props;
|
const { variant = 'primary', size = 'md', className, isLoading, ...restProps } = props;
|
||||||
|
|
||||||
const buttonClass = clx(
|
const buttonClass = clx(
|
||||||
'flex rounded-xl items-center justify-center text-center font-medium transition-colors',
|
'flex rounded-xl items-center justify-center text-center font-medium transition-colors',
|
||||||
@@ -33,12 +33,12 @@ const Button: FC<Props> = memo((props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
disabled={restProps.isLoading}
|
disabled={isLoading}
|
||||||
{...restProps}
|
{...restProps}
|
||||||
className={clx(buttonClass, className)}
|
className={clx(buttonClass, className)}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
restProps.isLoading ?
|
isLoading ?
|
||||||
<MoonLoader color={variant === 'primary' || variant === 'danger' ? "white" : "#6B7280"} size={16} />
|
<MoonLoader color={variant === 'primary' || variant === 'danger' ? "white" : "#6B7280"} size={16} />
|
||||||
:
|
:
|
||||||
restProps.label || restProps.children
|
restProps.label || restProps.children
|
||||||
|
|||||||
@@ -81,7 +81,8 @@ const UpdateBlog: FC = () => {
|
|||||||
imageUrl: blogDetail.imageUrl,
|
imageUrl: blogDetail.imageUrl,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [blogDetail, formik])
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [blogDetail])
|
||||||
|
|
||||||
const categoryOptions = categoriesData?.results?.categories?.map((category) => ({
|
const categoryOptions = categoriesData?.results?.categories?.map((category) => ({
|
||||||
value: category._id,
|
value: category._id,
|
||||||
|
|||||||
Reference in New Issue
Block a user