Open embed card clicks in new tab
This commit is contained in:
parent
8484fcd54e
commit
1a93611aa0
|
@ -46,6 +46,7 @@ export function ContractCard(props: {
|
||||||
hideGroupLink?: boolean
|
hideGroupLink?: boolean
|
||||||
trackingPostfix?: string
|
trackingPostfix?: string
|
||||||
noLinkAvatar?: boolean
|
noLinkAvatar?: boolean
|
||||||
|
newTab?: boolean
|
||||||
}) {
|
}) {
|
||||||
const {
|
const {
|
||||||
showTime,
|
showTime,
|
||||||
|
@ -56,6 +57,7 @@ export function ContractCard(props: {
|
||||||
hideGroupLink,
|
hideGroupLink,
|
||||||
trackingPostfix,
|
trackingPostfix,
|
||||||
noLinkAvatar,
|
noLinkAvatar,
|
||||||
|
newTab,
|
||||||
} = props
|
} = props
|
||||||
const contract = useContractWithPreload(props.contract) ?? props.contract
|
const contract = useContractWithPreload(props.contract) ?? props.contract
|
||||||
const { question, outcomeType } = contract
|
const { question, outcomeType } = contract
|
||||||
|
@ -189,6 +191,7 @@ export function ContractCard(props: {
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
className="absolute top-0 left-0 right-0 bottom-0"
|
className="absolute top-0 left-0 right-0 bottom-0"
|
||||||
|
target={newTab ? '_blank' : '_self'}
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -28,7 +28,6 @@ import {
|
||||||
tradingAllowed,
|
tradingAllowed,
|
||||||
} from 'web/lib/firebase/contracts'
|
} from 'web/lib/firebase/contracts'
|
||||||
import Custom404 from '../../404'
|
import Custom404 from '../../404'
|
||||||
import { useWindowSize } from 'web/hooks/use-window-size'
|
|
||||||
|
|
||||||
export const getStaticProps = fromPropz(getStaticPropz)
|
export const getStaticProps = fromPropz(getStaticPropz)
|
||||||
export async function getStaticPropz(props: {
|
export async function getStaticPropz(props: {
|
||||||
|
@ -83,7 +82,12 @@ export function ContractEmbed(props: EmbedProps) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="contents [@media(min-height:250px)]:hidden">
|
<div className="contents [@media(min-height:250px)]:hidden">
|
||||||
<ContractCard contract={contract} className="h-screen" />
|
<ContractCard
|
||||||
|
contract={contract}
|
||||||
|
className="h-screen"
|
||||||
|
noLinkAvatar
|
||||||
|
newTab
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="hidden [@media(min-height:250px)]:contents">
|
<div className="hidden [@media(min-height:250px)]:contents">
|
||||||
<ContractSmolView {...props} />
|
<ContractSmolView {...props} />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user