2022-01-04 22:47:56 +00:00
|
|
|
import clsx from 'clsx'
|
|
|
|
|
|
|
|
export function TweetButton(props: { className?: string; tweetText?: string }) {
|
|
|
|
const { tweetText, className } = props
|
2022-01-04 20:57:48 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<a
|
2022-01-11 16:29:54 +00:00
|
|
|
className={clsx(
|
2022-02-11 18:40:22 +00:00
|
|
|
'btn btn-xs flex flex-row flex-nowrap border-none normal-case',
|
2022-01-11 16:29:54 +00:00
|
|
|
className
|
|
|
|
)}
|
|
|
|
style={{ backgroundColor: '#1da1f2' }}
|
2022-01-04 22:09:03 +00:00
|
|
|
href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(
|
2022-01-04 20:57:48 +00:00
|
|
|
tweetText ?? ''
|
|
|
|
)}`}
|
2022-01-04 22:34:07 +00:00
|
|
|
target="_blank"
|
2022-01-04 20:57:48 +00:00
|
|
|
>
|
2022-01-04 22:34:07 +00:00
|
|
|
<img
|
|
|
|
className="mr-2"
|
|
|
|
src={'/twitter-icon-white.svg'}
|
2022-01-04 22:47:56 +00:00
|
|
|
width={15}
|
|
|
|
height={15}
|
2022-01-04 22:34:07 +00:00
|
|
|
/>
|
2022-01-11 16:29:54 +00:00
|
|
|
<div>Tweet</div>
|
2022-01-04 20:57:48 +00:00
|
|
|
</a>
|
|
|
|
)
|
|
|
|
}
|