Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: preview links #556

Merged
merged 2 commits into from
Aug 6, 2024
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
35 changes: 20 additions & 15 deletions components/documents/document-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { cn, getExtension } from "@/lib/utils";

import PortraitLandscape from "../shared/icons/portrait-landscape";
import LoadingSpinner from "../ui/loading-spinner";
import { ButtonTooltip } from "../ui/tooltip";
import { AddDocumentModal } from "./add-document-modal";
import { AddToDataroomModal } from "./add-document-to-dataroom-modal";

Expand Down Expand Up @@ -331,18 +332,20 @@ export default function DocumentHeader({

<div className="flex items-center gap-x-4 md:gap-x-2 lg:gap-x-4">
{!orientationLoading ? (
<button
className="hidden md:flex"
onClick={changeDocumentOrientation}
title={`Change document orientation to ${primaryVersion.isVertical ? "landscape" : "portrait"}`}
>
<PortraitLandscape
className={cn(
"h-6 w-6",
!primaryVersion.isVertical && "-rotate-90 transform",
)}
/>
</button>
<ButtonTooltip content="Change orientation">
<button
className="hidden md:flex"
onClick={changeDocumentOrientation}
title={`Change document orientation to ${primaryVersion.isVertical ? "landscape" : "portrait"}`}
>
<PortraitLandscape
className={cn(
"h-6 w-6",
!primaryVersion.isVertical && "-rotate-90 transform",
)}
/>
</button>
</ButtonTooltip>
) : (
<div className="hidden md:flex">
<LoadingSpinner className="h-6 w-6" />
Expand All @@ -351,9 +354,11 @@ export default function DocumentHeader({

{primaryVersion.type !== "notion" && (
<AddDocumentModal newVersion>
<button title="Upload a new version" className="hidden md:flex">
<FileUp className="h-6 w-6" />
</button>
<ButtonTooltip content="Add new version">
<button title="Upload a new version" className="hidden md:flex">
<FileUp className="h-6 w-6" />
</button>
</ButtonTooltip>
</AddDocumentModal>
)}

Expand Down
4 changes: 2 additions & 2 deletions components/links/links-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export default function LinksTable({
</span>
) : null}
</TableCell>
<TableCell className="flex max-w-[250px] items-center gap-x-2 sm:min-w-[300px] md:min-w-[400px] lg:min-w-[450px]">
<TableCell className="flex items-center gap-x-2 sm:min-w-[300px] md:min-w-[400px] lg:min-w-[450px]">
<div
className={cn(
`group/cell relative flex w-full items-center gap-x-4 overflow-hidden truncate rounded-sm px-3 py-1.5 text-center text-secondary-foreground transition-all group-hover/row:ring-1 group-hover/row:ring-gray-400 group-hover/row:dark:ring-gray-100 md:py-1`,
Expand All @@ -267,7 +267,7 @@ export default function LinksTable({
/>
) : null}

<div className="flex w-full whitespace-nowrap text-xs group-hover/cell:opacity-0 md:text-sm">
<div className="flex w-full whitespace-nowrap text-sm group-hover/cell:opacity-0">
{link.domainId
? `https://${link.domainSlug}/${link.slug}`
: `${process.env.NEXT_PUBLIC_MARKETING_URL}/view/${link.id}`}
Expand Down