manifold/web/components/tweet-button.tsx
Austin Chen 7338bdd47a
Automatically sort Tailwind classes with Prettier (#45)
* Add Prettier Tailwind plugin

* Autoformat Tailwind classes with Prettier
2022-02-11 10:40:22 -08:00

28 lines
631 B
TypeScript

import clsx from 'clsx'
export function TweetButton(props: { className?: string; tweetText?: string }) {
const { tweetText, className } = props
return (
<a
className={clsx(
'btn btn-xs flex flex-row flex-nowrap border-none normal-case',
className
)}
style={{ backgroundColor: '#1da1f2' }}
href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(
tweetText ?? ''
)}`}
target="_blank"
>
<img
className="mr-2"
src={'/twitter-icon-white.svg'}
width={15}
height={15}
/>
<div>Tweet</div>
</a>
)
}