Files
commerce/pages/test.tsx
lytrankieio123 c0e703e1ae ♻️ enhan: disable btn when loading
:%s
2021-09-28 18:08:17 +07:00

22 lines
566 B
TypeScript

import { useEffect, useState } from 'react'
import {
ButtonCommon, Layout
} from 'src/components/common'
export default function Test() {
const [isLoading, setisLoading] = useState(false)
useEffect(() => {
setTimeout(() => {
setisLoading(true)
}, 3000)
}, [])
return (
<>
<ButtonCommon loading={isLoading}>Back to home</ButtonCommon>
<ButtonCommon type='light' loading={isLoading}>Back to home</ButtonCommon>
<ButtonCommon type='ghost' loading={isLoading}>Back to home</ButtonCommon>
</>
)
}
Test.Layout = Layout