Skip to content

Commit

Permalink
Merge pull request #621 from mfts/feat/group
Browse files Browse the repository at this point in the history
feat: updates to groups
  • Loading branch information
mfts authored Sep 29, 2024
2 parents 7ef97ec + 976a616 commit 05ada08
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 13 deletions.
8 changes: 4 additions & 4 deletions components/datarooms/groups/group-card.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from "react";

import { ViewerGroup } from "@prisma/client";
import { Layers2Icon, PenIcon, UsersIcon } from "lucide-react";
import { BoxesIcon, Layers2Icon, PenIcon } from "lucide-react";

import BarChart from "@/components/shared/icons/bar-chart";
import MoreVertical from "@/components/shared/icons/more-vertical";
Expand All @@ -25,7 +25,7 @@ export default function GroupCard({

return (
<>
<div className="hover:drop-shadow-card-hover group rounded-xl border border-gray-200 bg-white p-4 transition-[filter] sm:p-5">
<div className="hover:drop-shadow-card-hover group rounded-xl border border-gray-200 bg-white p-4 transition-[filter] dark:bg-gray-800 sm:p-5">
<div className="flex items-center justify-between gap-3 sm:gap-4">
<div className="flex min-w-0 items-center gap-4">
<div className="hidden rounded-full border border-gray-200 sm:block">
Expand All @@ -34,12 +34,12 @@ export default function GroupCard({
"rounded-full border border-white bg-gradient-to-t from-gray-100 p-1 md:p-3",
)}
>
<UsersIcon className="size-5" />
<BoxesIcon className="size-5" />
</div>
</div>
<div className="overflow-hidden">
<div className="flex flex-col gap-1">
<p className="truncate text-sm font-medium" title="Group Name">
<p className="truncate text-sm font-medium text-foreground">
{group.name}
</p>
<span className="text-xs text-muted-foreground">
Expand Down
21 changes: 14 additions & 7 deletions components/links/links-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useState } from "react";

import { useTeam } from "@/context/team-context";
import { DocumentVersion } from "@prisma/client";
import { EyeIcon, LinkIcon, Settings2Icon } from "lucide-react";
import { BoxesIcon, EyeIcon, LinkIcon, Settings2Icon } from "lucide-react";
import { toast } from "sonner";
import { mutate } from "swr";

Expand Down Expand Up @@ -245,13 +245,20 @@ export default function LinksTable({
<>
<TableRow key={link.id} className="group/row">
<TableCell className="w-[250px] truncate font-medium">
{link.name || `Link #${link.id.slice(-5)}`}
<div className="flex items-center gap-x-2">
{link.groupId ? (
<ButtonTooltip content="Group Link">
<BoxesIcon className="size-4" />
</ButtonTooltip>
) : null}
{link.name || `Link #${link.id.slice(-5)}`}

{link.domainId && hasFreePlan ? (
<span className="ml-2 rounded-full bg-destructive px-2.5 py-0.5 text-xs text-foreground ring-1 ring-destructive">
Inactive
</span>
) : null}
{link.domainId && hasFreePlan ? (
<span className="ml-2 rounded-full bg-destructive px-2.5 py-0.5 text-xs text-foreground ring-1 ring-destructive">
Inactive
</span>
) : null}
</div>
</TableCell>
<TableCell className="flex items-center gap-x-2 sm:min-w-[300px] md:min-w-[400px] lg:min-w-[450px]">
<div
Expand Down
1 change: 1 addition & 0 deletions components/view/DataroomViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export default function DataroomViewer({
delete currentQuery.email;
delete currentQuery.domain;
delete currentQuery.slug;
delete currentQuery.linkId;

const currentPath = router.asPath.split("?")[0];

Expand Down
2 changes: 1 addition & 1 deletion components/view/PagesViewerNew.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export default function PagesViewer({
};

if (!dataroomId && router.query.token) {
removeQueryParams(["token", "email", "domain", "slug"]);
removeQueryParams(["token", "email", "domain", "slug", "linkId"]);
}
}, []); // Run once on mount

Expand Down
1 change: 1 addition & 0 deletions components/view/dataroom/dataroom-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export default function DataroomView({
delete currentQuery.email;
delete currentQuery.domain;
delete currentQuery.slug;
delete currentQuery.linkId;

const currentPath = router.asPath.split("?")[0];

Expand Down
1 change: 1 addition & 0 deletions components/view/document-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export default function DocumentView({
delete currentQuery.email;
delete currentQuery.domain;
delete currentQuery.slug;
delete currentQuery.linkId;

const currentPath = router.asPath.split("?")[0];

Expand Down
2 changes: 1 addition & 1 deletion components/view/viewer/image-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export default function ImageViewer({
};

if (!dataroomId && router.query.token) {
removeQueryParams(["token", "email", "domain", "slug"]);
removeQueryParams(["token", "email", "domain", "slug", "linkId"]);
}
}, []); // Run once on mount

Expand Down

0 comments on commit 05ada08

Please sign in to comment.