Use media query instead of conditional render
This commit is contained in:
parent
cae35bc05e
commit
8484fcd54e
|
@ -79,12 +79,16 @@ export function ContractEmbed(props: EmbedProps) {
|
||||||
creatorId: contract.creatorId,
|
creatorId: contract.creatorId,
|
||||||
})
|
})
|
||||||
|
|
||||||
const { height = 0 } = useWindowSize()
|
// return (height < 250px) ? Card : SmolView
|
||||||
|
return (
|
||||||
return height < 250 ? (
|
<>
|
||||||
<ContractCard contract={contract} className="h-screen" />
|
<div className="contents [@media(min-height:250px)]:hidden">
|
||||||
) : (
|
<ContractCard contract={contract} className="h-screen" />
|
||||||
<ContractSmolView {...props} />
|
</div>
|
||||||
|
<div className="hidden [@media(min-height:250px)]:contents">
|
||||||
|
<ContractSmolView {...props} />
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user