-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from Shelf-nu/custodies
Custodies
- Loading branch information
Showing
40 changed files
with
1,575 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { useLoaderData } from "@remix-run/react"; | ||
import type { loader } from "~/routes/_layout+/assets.$assetId.give-custody"; | ||
import { | ||
Select, | ||
SelectTrigger, | ||
SelectValue, | ||
SelectContent, | ||
SelectItem, | ||
} from "../forms"; | ||
import { UserIcon } from "../icons"; | ||
import { Button } from "../shared"; | ||
|
||
export default function CustodianSelect() { | ||
const { teamMembers } = useLoaderData<typeof loader>(); | ||
return ( | ||
<div className="relative w-full"> | ||
<Select name="custodian"> | ||
<SelectTrigger> | ||
<SelectValue placeholder="Select a team member" /> | ||
</SelectTrigger> | ||
|
||
<div> | ||
<SelectContent className="w-[352px]" position="popper" align="start"> | ||
{teamMembers.length > 0 ? ( | ||
<div className=" max-h-[320px] overflow-auto"> | ||
{teamMembers.map((member) => ( | ||
<SelectItem | ||
key={member.id} | ||
value={JSON.stringify({ id: member.id, name: member.name })} | ||
> | ||
<div className="flex items-center gap-3 py-3.5"> | ||
<i> | ||
<UserIcon /> | ||
</i> | ||
<span className=" flex-1 font-medium text-gray-900"> | ||
{member.name} | ||
</span> | ||
</div> | ||
</SelectItem> | ||
))} | ||
</div> | ||
) : ( | ||
<div> | ||
No team members found.{" "} | ||
<Button to={"/settings/workspace"} variant="link"> | ||
Create team members | ||
</Button> | ||
</div> | ||
)} | ||
</SelectContent> | ||
</div> | ||
</Select> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { VerticalDotsIcon } from "~/components/icons"; | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuTrigger, | ||
} from "~/components/shared/dropdown"; | ||
import type { TeamMemberWithCustodies } from "~/routes/_layout+/settings.workspace"; | ||
import { DeleteMember } from "./delete-member"; | ||
|
||
export function ActionsDropdown({ | ||
teamMember, | ||
}: { | ||
teamMember: TeamMemberWithCustodies; | ||
}) { | ||
return ( | ||
<DropdownMenu modal={false}> | ||
<DropdownMenuTrigger className="outline-none focus-visible:border-0"> | ||
<i className="inline-block px-3 py-0 text-gray-400 "> | ||
<VerticalDotsIcon /> | ||
</i> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent | ||
align="end" | ||
className="order w-[180px] rounded-md bg-white p-0 text-right " | ||
> | ||
<DeleteMember teamMember={teamMember} /> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
); | ||
} |
Oops, something went wrong.