disable clicking on group in embed

This commit is contained in:
mantikoros 2022-08-04 22:47:59 -07:00
parent 4d153755c1
commit 16f4fb9490

View File

@ -145,6 +145,15 @@ export function ContractDetails(props: {
const user = useUser() const user = useUser()
const [open, setOpen] = useState(false) const [open, setOpen] = useState(false)
const groupInfo = (
<Row>
<UserGroupIcon className="mx-1 inline h-5 w-5 shrink-0" />
<span className={'line-clamp-1'}>
{groupToDisplay ? groupToDisplay.name : 'No group'}
</span>
</Row>
)
return ( return (
<Row className="flex-1 flex-wrap items-center gap-x-4 gap-y-2 text-sm text-gray-500"> <Row className="flex-1 flex-wrap items-center gap-x-4 gap-y-2 text-sm text-gray-500">
<Row className="items-center gap-2"> <Row className="items-center gap-2">
@ -166,19 +175,18 @@ export function ContractDetails(props: {
{!disabled && <UserFollowButton userId={creatorId} small />} {!disabled && <UserFollowButton userId={creatorId} small />}
</Row> </Row>
<Row> <Row>
{disabled ? (
groupInfo
) : (
<Button <Button
size={'xs'} size={'xs'}
className={'max-w-[200px]'} className={'max-w-[200px]'}
color={'gray-white'} color={'gray-white'}
onClick={() => setOpen(!open)} onClick={() => setOpen(!open)}
> >
<Row> {groupInfo}
<UserGroupIcon className="mx-1 inline h-5 w-5 shrink-0" />
<span className={'line-clamp-1'}>
{groupToDisplay ? groupToDisplay.name : 'No group'}
</span>
</Row>
</Button> </Button>
)}
</Row> </Row>
<Modal open={open} setOpen={setOpen} size={'md'}> <Modal open={open} setOpen={setOpen} size={'md'}>
<Col <Col