Open embed card clicks in new tab

This commit is contained in:
Sinclair Chen 2022-10-02 11:03:06 -07:00
parent 8484fcd54e
commit 1a93611aa0
2 changed files with 9 additions and 2 deletions

View File

@ -46,6 +46,7 @@ export function ContractCard(props: {
hideGroupLink?: boolean
trackingPostfix?: string
noLinkAvatar?: boolean
newTab?: boolean
}) {
const {
showTime,
@ -56,6 +57,7 @@ export function ContractCard(props: {
hideGroupLink,
trackingPostfix,
noLinkAvatar,
newTab,
} = props
const contract = useContractWithPreload(props.contract) ?? props.contract
const { question, outcomeType } = contract
@ -189,6 +191,7 @@ export function ContractCard(props: {
}
)}
className="absolute top-0 left-0 right-0 bottom-0"
target={newTab ? '_blank' : '_self'}
/>
</Link>
)}

View File

@ -28,7 +28,6 @@ import {
tradingAllowed,
} from 'web/lib/firebase/contracts'
import Custom404 from '../../404'
import { useWindowSize } from 'web/hooks/use-window-size'
export const getStaticProps = fromPropz(getStaticPropz)
export async function getStaticPropz(props: {
@ -83,7 +82,12 @@ export function ContractEmbed(props: EmbedProps) {
return (
<>
<div className="contents [@media(min-height:250px)]:hidden">
<ContractCard contract={contract} className="h-screen" />
<ContractCard
contract={contract}
className="h-screen"
noLinkAvatar
newTab
/>
</div>
<div className="hidden [@media(min-height:250px)]:contents">
<ContractSmolView {...props} />