Make tweet button smaller

This commit is contained in:
jahooma 2022-01-04 16:47:56 -06:00
parent 6d97b82aee
commit 67007c5897
3 changed files with 14 additions and 10 deletions

View File

@ -114,7 +114,9 @@ export function ContractDetails(props: {
<div className="whitespace-nowrap">{formatMoney(truePool)} pool</div> <div className="whitespace-nowrap">{formatMoney(truePool)} pool</div>
</Row> </Row>
{inlineTags && <div className="hidden sm:block"></div>} {inlineTags && tags.length > 0 && (
<div className="hidden sm:block"></div>
)}
<Row className="gap-2 flex-wrap"> <Row className="gap-2 flex-wrap">
{tags.map((tag) => ( {tags.map((tag) => (

View File

@ -68,6 +68,7 @@ export const ContractOverview = (props: {
/> />
<ContractDetails contract={contract} inlineTags /> <ContractDetails contract={contract} inlineTags />
<TweetButton tweetText={tweetText} />
</Col> </Col>
<ResolutionOrChance <ResolutionOrChance
@ -80,10 +81,6 @@ export const ContractOverview = (props: {
<Spacer h={4} /> <Spacer h={4} />
<TweetButton tweetText={tweetText} />
<Spacer h={4} />
<ContractProbGraph contract={contract} /> <ContractProbGraph contract={contract} />
<Spacer h={12} /> <Spacer h={12} />

View File

@ -1,9 +1,14 @@
export function TweetButton(props: { tweetText?: string }) { import clsx from 'clsx'
const { tweetText } = props
export function TweetButton(props: { className?: string; tweetText?: string }) {
const { tweetText, className } = props
return ( return (
<a <a
className="btn btn-sm normal-case self-start border-none" className={clsx(
'btn btn-xs normal-case self-start border-none',
className
)}
style={{ backgroundColor: '#1da1f2' }} style={{ backgroundColor: '#1da1f2' }}
href={`https://twitter.com/intent/tweet?text=${encodeURIComponent( href={`https://twitter.com/intent/tweet?text=${encodeURIComponent(
tweetText ?? '' tweetText ?? ''
@ -13,8 +18,8 @@ export function TweetButton(props: { tweetText?: string }) {
<img <img
className="mr-2" className="mr-2"
src={'/twitter-icon-white.svg'} src={'/twitter-icon-white.svg'}
width={18} width={15}
height={18} height={15}
/> />
Tweet Tweet
</a> </a>