MemberCard for owner disabled (#66)

* AddMemberDialog remove footer styling from old component

* MemberCard for owner disabled (#64)
This commit is contained in:
Vivian Phung 2024-05-15 17:18:32 -04:00 committed by GitHub
parent e12c94e087
commit 583c0b9d26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,7 @@ import { Button } from 'components/shared/Button';
import { Permission, User } from 'gql-client'; import { Permission, User } from 'gql-client';
import { formatAddress } from 'utils/format'; import { formatAddress } from 'utils/format';
import { Tag } from 'components/shared/Tag'; import { Tag } from 'components/shared/Tag';
import { Input } from 'components/shared/Input';
const PERMISSION_OPTIONS: SelectOption[] = [ const PERMISSION_OPTIONS: SelectOption[] = [
{ {
@ -79,9 +80,8 @@ const MemberCard = ({
return ( return (
<div <div
className={`flex p-1 ${!isFirstCard && 'mt-1 border-t border-gray-300'}`} className={`flex p-1 items-center ${!isFirstCard && 'mt-1 border-t border-gray-300'}`}
> >
<div>^</div>
<div className="basis-1/2"> <div className="basis-1/2">
{member.name && ( {member.name && (
<Tooltip content={member.name}> <Tooltip content={member.name}>
@ -96,14 +96,19 @@ const MemberCard = ({
</div> </div>
<div className="basis-1/2"> <div className="basis-1/2">
{!isPending ? ( {!isPending ? (
isOwner ? (
<Input size="md" value="Owner" disabled />
) : (
<Select <Select
options={DROPDOWN_OPTIONS} options={DROPDOWN_OPTIONS}
size="md" size="md"
label={isOwner ? 'Owner' : ''} placeholder="Select permission"
disabled={isOwner}
value={selectedPermission} value={selectedPermission}
onChange={(value) => handlePermissionChange(value as SelectOption)} onChange={(value) =>
handlePermissionChange(value as SelectOption)
}
/> />
)
) : ( ) : (
<div className="flex justify-end gap-2"> <div className="flex justify-end gap-2">
<div> <div>
@ -113,7 +118,7 @@ const MemberCard = ({
</div> </div>
<div> <div>
<Button <Button
size="sm" size="md"
iconOnly iconOnly
onClick={() => { onClick={() => {
setRemoveMemberDialogOpen((prevVal) => !prevVal); setRemoveMemberDialogOpen((prevVal) => !prevVal);