2022-06-02 22:55:23 +00:00
|
|
|
import GithubIcon from '../svgs/github-fill.svg'
|
|
|
|
import TwitterIcon from '../svgs/twitter-fill.svg'
|
|
|
|
import LightningIcon from '../svgs/bolt.svg'
|
2023-08-08 00:50:01 +00:00
|
|
|
import NostrIcon from '../svgs/nostr.svg'
|
2023-07-24 18:35:05 +00:00
|
|
|
import Button from 'react-bootstrap/Button'
|
2023-01-18 18:49:20 +00:00
|
|
|
|
2022-06-02 22:55:23 +00:00
|
|
|
export default function LoginButton ({ text, type, className, onClick }) {
|
|
|
|
let Icon, variant
|
|
|
|
switch (type) {
|
|
|
|
case 'twitter':
|
|
|
|
Icon = TwitterIcon
|
|
|
|
variant = 'twitter'
|
|
|
|
break
|
|
|
|
case 'github':
|
|
|
|
Icon = GithubIcon
|
|
|
|
variant = 'dark'
|
|
|
|
break
|
2023-08-08 00:50:01 +00:00
|
|
|
case 'nostr':
|
|
|
|
Icon = NostrIcon
|
|
|
|
variant = 'nostr'
|
|
|
|
break
|
2023-07-23 15:08:43 +00:00
|
|
|
case 'lightning':
|
|
|
|
default:
|
|
|
|
Icon = LightningIcon
|
|
|
|
variant = 'primary'
|
|
|
|
break
|
2022-06-02 22:55:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const name = type.charAt(0).toUpperCase() + type.substr(1).toLowerCase()
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Button className={className} variant={variant} onClick={onClick}>
|
|
|
|
<Icon
|
|
|
|
width={20}
|
2023-07-24 18:35:05 +00:00
|
|
|
height={20} className='me-3'
|
2022-06-02 22:55:23 +00:00
|
|
|
/>
|
|
|
|
{text} {name}
|
|
|
|
</Button>
|
|
|
|
)
|
|
|
|
}
|