mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Implement SignIn/SignOut
This commit is contained in:
parent
bce35d73ca
commit
adeb3fd3bf
16 changed files with 987 additions and 77 deletions
26
src/components/Button.tsx
Normal file
26
src/components/Button.tsx
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import type { PropsWithChildren } from 'react'
|
||||
import clsx from 'clsx'
|
||||
import { BarsRotateFade } from 'react-svg-spinners'
|
||||
|
||||
export default function Button(props: PropsWithChildren<{ className?: string; loading?: boolean }>) {
|
||||
const { children, className, loading = false, ...restProps } = props
|
||||
return (
|
||||
<button
|
||||
className={clsx(
|
||||
loading ? 'bg-blue-400 cursor-progress' : 'bg-blue-600 hover:bg-blue-700',
|
||||
'py-2 px-3.5 rounded-lg',
|
||||
className
|
||||
)}
|
||||
{...restProps}
|
||||
>
|
||||
<div className='relative flex'>
|
||||
<span className={clsx({ invisible: loading })}>{children}</span>
|
||||
{loading ? (
|
||||
<div className='absolute top-0 left-0 w-full flex justify-center'>
|
||||
<BarsRotateFade color='white' />
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
</button>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue