Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useEffect, useState } from "react";
import { TeamContextType, initialState, useTeam } from "@/context/team-context";
import Cookies from "js-cookie";
import {
CogIcon,
FolderIcon as FolderLucideIcon,
FolderOpenIcon,
PaletteIcon,
Expand All @@ -13,7 +14,6 @@ import {
import { useSession } from "next-auth/react";

import MenuIcon from "@/components/shared/icons/menu";
import SettingsIcon from "@/components/shared/icons/settings";
import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet";

import { usePlan } from "@/lib/swr/use-billing";
Expand All @@ -24,6 +24,7 @@ import ProBanner from "./billing/pro-banner";
import { UpgradePlanModal } from "./billing/upgrade-plan-modal";
import ProfileMenu from "./profile-menu";
import SiderbarFolders from "./sidebar-folders";
import { AddTeamModal } from "./teams/add-team-modal";
import SelectTeam from "./teams/select-team";
import { ScrollArea } from "./ui/scroll-area";

Expand Down Expand Up @@ -128,7 +129,7 @@ export const SidebarComponent = ({ className }: { className?: string }) => {
{
name: "Settings",
href: "/settings/general",
icon: SettingsIcon,
icon: CogIcon,
current:
router.pathname.includes("settings") &&
!router.pathname.includes("branding") &&
Expand Down
20 changes: 2 additions & 18 deletions components/datarooms/settings/duplicate-dataroom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export default function DuplicateDataroom({
};

return (
<div className="rounded-lg bg-background">
<Card>
<div className="rounded-lg">
<Card className="bg-transparent">
<CardHeader>
<CardTitle>Duplicate Dataroom</CardTitle>
<CardDescription>
Expand All @@ -84,21 +84,5 @@ export default function DuplicateDataroom({
</CardFooter>
</Card>
</div>
// <div className="rounded-lg border border-gray-200 bg-white">
// <div className="flex flex-col space-y-3 p-5 sm:p-10">
// <h2 className="text-xl font-medium">Duplicate Dataroom</h2>
// <p className="text-sm text-gray-500">
// Create a new data room with the same content (folders and files) as
// this data room.
// </p>
// </div>
// <div className="border-b border-gray-200" />

// <div className="flex items-center justify-end px-5 py-4 sm:px-10">
// <Button onClick={(e) => handleDuplicateDataroom(e)} loading={loading}>
// Duplicate Dataroom
// </Button>
// </div>
// </div>
);
}
6 changes: 4 additions & 2 deletions components/links/link-sheet/allow-list-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { useEffect, useState } from "react";

import { motion } from "framer-motion";

import { Textarea } from "@/components/ui/textarea";

import { FADE_IN_ANIMATION_SETTINGS } from "@/lib/constants";
import { sanitizeAllowDenyList } from "@/lib/utils";

Expand Down Expand Up @@ -92,8 +94,8 @@ export default function AllowListSection({
className="mt-1 block w-full"
{...FADE_IN_ANIMATION_SETTINGS}
>
<textarea
className="form-textarea w-full rounded-md border-0 bg-background py-1.5 text-sm leading-6 text-foreground shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400"
<Textarea
className="focus:ring-inset"
rows={5}
placeholder="Enter allowed emails/domains, one per line, e.g. [email protected] @example.org"
value={allowListInput}
Expand Down
6 changes: 4 additions & 2 deletions components/links/link-sheet/deny-list-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { useEffect, useState } from "react";

import { motion } from "framer-motion";

import { Textarea } from "@/components/ui/textarea";

import { FADE_IN_ANIMATION_SETTINGS } from "@/lib/constants";
import { sanitizeAllowDenyList } from "@/lib/utils";

Expand Down Expand Up @@ -91,8 +93,8 @@ export default function DenyListSection({
className="mt-1 block w-full"
{...FADE_IN_ANIMATION_SETTINGS}
>
<textarea
className="form-textarea w-full rounded-md border-0 bg-background py-1.5 text-sm leading-6 text-foreground shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400"
<Textarea
className="focus:ring-inset"
rows={5}
placeholder="Enter blocked emails/domains, one per line, e.g. [email protected] @example.org"
value={denyListInput}
Expand Down
116 changes: 70 additions & 46 deletions components/links/link-sheet/domain-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ import { Domain } from "@prisma/client";
import { mutate } from "swr";

import { AddDomainModal } from "@/components/domains/add-domain-modal";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";

import { BLOCKED_PATHNAMES } from "@/lib/constants";
import { BasePlan } from "@/lib/swr/use-billing";
Expand All @@ -33,12 +41,13 @@ export default function DomainSection({
const teamInfo = useTeam();
const { limits } = useLimits();

const handleDomainChange = (event: React.ChangeEvent<HTMLSelectElement>) => {
const value = event.target.value;
const handleDomainChange = (value: string) => {
// const value = event.target.value;

if (value === "add_domain" || value === "add_dataroom_domain") {
// Redirect to the add domain page
setModalOpen(true);
setData({ ...data, domain: "papermark.io" });
return;
}

Expand All @@ -57,54 +66,69 @@ export default function DomainSection({
<>
<Label htmlFor="link-domain">Domain</Label>
<div className="flex">
<select
value={data.domain || "papermark.io"}
onChange={handleDomainChange}
onFocus={handleSelectFocus}
className={cn(
"w-full rounded-l-md border border-r-0 border-border bg-secondary px-5 text-sm text-secondary-foreground focus:border-border focus:outline-none focus:ring-0",
data.domain && data.domain !== "papermark.io"
? ""
: "border-r-1 rounded-r-md",
)}
<Select
defaultValue={data.domain || "papermark.io"}
onValueChange={handleDomainChange}
onOpenChange={handleSelectFocus}
>
<option key="papermark.io" value="papermark.io">
papermark.io
</option>
{linkType === "DOCUMENT_LINK" &&
(plan === "business" || (limits && limits.customDomainOnPro)) && (
<>
{domains?.map(({ slug }) => (
<option key={slug} value={slug}>
{slug}
</option>
))}
</>
)}
{linkType === "DATAROOM_LINK" &&
(plan === "datarooms" ||
(limits && limits.customDomainInDataroom)) && (
<>
{domains?.map(({ slug }) => (
<option key={slug} value={slug}>
{slug}
</option>
))}
</>
<SelectTrigger
className={cn(
"flex w-full rounded-none rounded-l-md border border-input bg-white text-foreground placeholder-muted-foreground focus:border-muted-foreground focus:outline-none focus:ring-inset focus:ring-muted-foreground dark:border-gray-500 dark:bg-gray-800 focus:dark:bg-transparent sm:text-sm",
data.domain && data.domain !== "papermark.io"
? ""
: "border-r-1 rounded-r-md",
)}
<option
value={
linkType === "DOCUMENT_LINK"
? "add_domain"
: "add_dataroom_domain"
}
>
Add a custom domain ✨
</option>
</select>
<SelectValue placeholder="Select a domain" />
</SelectTrigger>
<SelectContent className="flex w-full rounded-md border border-input bg-white text-foreground placeholder-muted-foreground focus:border-muted-foreground focus:outline-none focus:ring-inset focus:ring-muted-foreground dark:border-gray-500 dark:bg-gray-800 focus:dark:bg-transparent sm:text-sm">
<SelectItem value="papermark.io" className="hover:bg-muted">
papermark.io
</SelectItem>
{linkType === "DOCUMENT_LINK" &&
(plan === "business" || (limits && limits.customDomainOnPro)) && (
<>
{domains?.map(({ slug }) => (
<SelectItem
key={slug}
value={slug}
className="hover:bg-muted hover:dark:bg-gray-700"
>
{slug}
</SelectItem>
))}
</>
)}
{linkType === "DATAROOM_LINK" &&
(plan === "datarooms" ||
(limits && limits.customDomainInDataroom)) && (
<>
{domains?.map(({ slug }) => (
<SelectItem
key={slug}
value={slug}
className="hover:bg-muted hover:dark:bg-gray-700"
>
{slug}
</SelectItem>
))}
</>
)}
<SelectItem
className="hover:bg-muted hover:dark:bg-gray-700"
value={
linkType === "DOCUMENT_LINK"
? "add_domain"
: "add_dataroom_domain"
}
>
Add a custom domain ✨
</SelectItem>
</SelectContent>
</Select>

{data.domain && data.domain !== "papermark.io" ? (
<input
<Input
type="text"
name="key"
required
Expand All @@ -126,7 +150,7 @@ export default function DomainSection({
}}
autoComplete="off"
className={cn(
"hidden w-full rounded-r-md border-0 bg-background py-1.5 text-foreground shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6",
"hidden rounded-l-none focus:ring-inset",
data.domain && data.domain !== "papermark.io" ? "flex" : "",
)}
placeholder="deck"
Expand Down
6 changes: 4 additions & 2 deletions components/links/link-sheet/expiration-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { useEffect, useState } from "react";

import { motion } from "framer-motion";

import { Input } from "@/components/ui/input";

import { FADE_IN_ANIMATION_SETTINGS } from "@/lib/constants";
import { getDateTimeLocal } from "@/lib/utils";

Expand Down Expand Up @@ -40,7 +42,7 @@ export default function ExpirationSection({

{enabled && (
<motion.div className="mt-3" {...FADE_IN_ANIMATION_SETTINGS}>
<input
<Input
type="datetime-local"
id="expiresAt"
name="expiresAt"
Expand All @@ -50,7 +52,7 @@ export default function ExpirationSection({
onChange={(e) => {
setData({ ...data, expiresAt: new Date(e.target.value) });
}}
className="flex w-full rounded-md border-0 bg-background py-1.5 text-foreground shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6"
className="focus:ring-inset"
/>
</motion.div>
)}
Expand Down
9 changes: 5 additions & 4 deletions components/links/link-sheet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { toast } from "sonner";
import { mutate } from "swr";

import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { ScrollArea } from "@/components/ui/scroll-area";
import { Separator } from "@/components/ui/separator";
Expand Down Expand Up @@ -200,7 +201,7 @@ export default function LinkSheet({

return (
<Sheet open={isOpen} onOpenChange={(open: boolean) => setIsOpen(open)}>
<SheetContent className="flex w-[90%] flex-col justify-between bg-background px-4 text-foreground sm:w-[600px] sm:max-w-2xl md:px-5">
<SheetContent className="flex w-[90%] flex-col justify-between border-l border-gray-200 bg-background px-4 text-foreground dark:border-gray-800 dark:bg-gray-900 sm:w-[600px] sm:max-w-2xl md:px-5">
<SheetHeader className="text-start">
<SheetTitle>
{currentLink ? "Edit link" : "Create a new link"}
Expand All @@ -216,13 +217,13 @@ export default function LinkSheet({
<div className="space-y-2">
<Label htmlFor="link-name">Link Name</Label>
<div className="mt-2">
<input
<Input
type="text"
name="link-name"
id="link-name"
placeholder="Recipient's Organization"
value={data.name || ""}
className="flex w-full rounded-md border-0 bg-background py-1.5 text-foreground shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6"
className="focus:ring-inset"
onChange={(e) =>
setData({ ...data, name: e.target.value })
}
Expand All @@ -241,7 +242,7 @@ export default function LinkSheet({
<div className="relative flex items-center">
<Separator className="absolute bg-muted-foreground" />
<div className="relative mx-auto">
<span className="bg-background px-2 text-sm text-muted-foreground">
<span className="bg-background px-2 text-sm text-muted-foreground dark:bg-gray-900">
Link Options
</span>
</div>
Expand Down
27 changes: 14 additions & 13 deletions components/links/link-sheet/og-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import LoadingSpinner from "@/components/ui/loading-spinner";
import { Textarea } from "@/components/ui/textarea";

import { FADE_IN_ANIMATION_SETTINGS } from "@/lib/constants";
import { cn } from "@/lib/utils";

import { DEFAULT_LINK_TYPE } from ".";
import LinkItem from "./link-item";
Expand Down Expand Up @@ -100,7 +101,7 @@ export default function OGSection({
</div>
<label
htmlFor="image"
className="group relative mt-1 flex h-[14rem] cursor-pointer flex-col items-center justify-center rounded-md border border-gray-300 bg-white shadow-sm transition-all hover:bg-gray-50"
className="group relative mt-1 flex h-[14rem] cursor-pointer flex-col items-center justify-center rounded-md border border-input bg-white shadow-sm transition-all hover:border-muted-foreground hover:bg-gray-50 hover:ring-muted-foreground dark:bg-gray-800 hover:dark:bg-transparent"
>
{false && (
<div className="absolute z-[5] flex h-full w-full items-center justify-center rounded-md bg-white">
Expand Down Expand Up @@ -154,20 +155,20 @@ export default function OGSection({
}}
/>
<div
className={`${
dragActive
? "cursor-copy border-2 border-black bg-gray-50 opacity-100"
: ""
} absolute z-[3] flex h-full w-full flex-col items-center justify-center rounded-md bg-white transition-all ${
className={cn(
"absolute z-[3] flex h-full w-full flex-col items-center justify-center rounded-md transition-all",
dragActive &&
"cursor-copy border-2 border-black bg-gray-50 opacity-100 dark:bg-transparent",
metaImage
? "opacity-0 group-hover:opacity-100"
: "group-hover:bg-gray-50"
}`}
: "group-hover:bg-gray-50 group-hover:dark:bg-transparent",
)}
>
<ArrowUpTrayIcon
className={`${
dragActive ? "scale-110" : "scale-100"
} h-7 w-7 text-gray-500 transition-all duration-75 group-hover:scale-110 group-active:scale-95`}
className={cn(
"h-7 w-7 text-gray-500 transition-all duration-75 group-hover:scale-110 group-active:scale-95",
dragActive ? "scale-110" : "scale-100",
)}
/>
<p className="mt-2 text-center text-sm text-gray-500">
Drag and drop or click to upload.
Expand Down Expand Up @@ -214,7 +215,7 @@ export default function OGSection({
name="title"
id="title"
maxLength={120}
className="flex w-full rounded-md border-0 bg-background py-1.5 text-foreground shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6"
className="focus:ring-inset"
placeholder={`Papermark - open-source document sharing infrastructure.`}
value={metaTitle || ""}
onChange={(e) => {
Expand Down Expand Up @@ -245,7 +246,7 @@ export default function OGSection({
id="description"
rows={3}
maxLength={240}
className="flex w-full rounded-md border-0 bg-background py-1.5 text-foreground shadow-sm ring-1 ring-inset ring-input placeholder:text-muted-foreground focus:ring-2 focus:ring-inset focus:ring-gray-400 sm:text-sm sm:leading-6"
className="focus:ring-inset"
placeholder={`Papermark is an open-source document sharing infrastructure for modern teams.`}
value={metaDescription || ""}
onChange={(e) => {
Expand Down
Loading