Add hashtags, remove mobile padding

This commit is contained in:
Austin Chen 2022-01-21 01:23:08 -06:00
parent 0323afa25d
commit 1f642384b3
2 changed files with 53 additions and 26 deletions

View File

@ -8,34 +8,59 @@ import { NewContract } from '../pages/create'
import { firebaseLogin } from '../lib/firebase/users' import { firebaseLogin } from '../lib/firebase/users'
import { useHotContracts } from '../hooks/use-contracts' import { useHotContracts } from '../hooks/use-contracts'
import { ContractsGrid } from './contracts-list' import { ContractsGrid } from './contracts-list'
import { SiteLink } from './site-link'
export function FeedPromo() { export function FeedPromo() {
// TODO: Encode in statc props // TODO: Encode in statc props
const hotContracts = useHotContracts() const hotContracts = useHotContracts()
return ( return (
<div className="w-full"> <>
<Title text="Bet on the future and win" className="!mb-2 text-black" /> <div className="w-full bg-indigo-50 p-6 sm:border-2 sm:border-indigo-100 sm:rounded-lg">
<div className="text-gray-500 mb-4"> <Title
<button text="What are you an expert in?"
className="bg-gradient-to-r gradient-to-r from-teal-500 to-green-500 text-transparent bg-clip-text hover:underline hover:decoration-gray-300 hover:decoration-2" className="!mt-2 text-gray-800"
onClick={firebaseLogin} />
> <div className="text-gray-500 mb-4">
Sign up for free <button
</button>{' '} className="bg-gradient-to-r gradient-to-r from-teal-500 to-green-500 text-transparent bg-clip-text hover:underline hover:decoration-gray-300 hover:decoration-2"
and trade in any prediction market. Our hottest markets today: onClick={firebaseLogin}
>
Sign up for free
</button>{' '}
to trade in any prediction market. Don't see a market you like? Create
your own in two minutes!
<br />
</div>
<div className="flex flex-wrap mt-2 gap-2">
{['#politics', '#covid', '#gaming', '#sports', '#meta'].map((tag) => (
<Hashtag tag={tag} />
))}
</div>
<Spacer h={4} />
<ContractsGrid
contracts={hotContracts?.slice(0, 2) || []}
showHotVolume
/>
</div> </div>
<ContractsGrid <div className="text-gray-800 text-lg mb-0 mt-6 mx-6">
contracts={hotContracts?.slice(0, 2) || []}
showHotVolume
/>
<Spacer h={4} />
<div className="text-gray-800 text-lg mb-0 mt-2">
Recent community activity Recent community activity
</div> </div>
</div> </>
)
}
function Hashtag(props: { tag: string }) {
const { tag } = props
return (
<SiteLink href={`/tag/${tag.substring(1)}`} className="flex items-center">
<div className="bg-white hover:bg-gray-100 cursor-pointer px-4 py-2 rounded-full shadow-md">
<span className="text-gray-500">{tag}</span>
</div>
</SiteLink>
) )
} }
@ -62,7 +87,7 @@ export default function FeedCreate() {
const placeholder = placeholders[daysSinceEpoch % placeholders.length] const placeholder = placeholders[daysSinceEpoch % placeholders.length]
return ( return (
<div className="w-full bg-indigo-50 rounded-md p-4"> <div className="w-full bg-indigo-50 sm:rounded-md p-4">
<div className="relative flex items-start space-x-3"> <div className="relative flex items-start space-x-3">
<AvatarWithIcon <AvatarWithIcon
username={user.username} username={user.username}

View File

@ -49,13 +49,15 @@ const Home = (props: {
<Page> <Page>
<Col className="items-center"> <Col className="items-center">
<Col className="max-w-3xl"> <Col className="max-w-3xl">
<FeedCreate /> <div className="-mx-2 sm:mx-0">
<Spacer h={4} /> <FeedCreate />
<ActivityFeed <Spacer h={4} />
contracts={activeContracts} <ActivityFeed
contractBets={activeContractBets} contracts={activeContracts}
contractComments={activeContractComments} contractBets={activeContractBets}
/> contractComments={activeContractComments}
/>
</div>
</Col> </Col>
</Col> </Col>
</Page> </Page>