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

feat: Clickable docs links #274

Merged
merged 8 commits into from
Feb 17, 2024
Merged

Conversation

Aashish-Upadhyay-101
Copy link
Contributor

fixes #253

@mfts the method used to implement this is very simple, will find a good work around this later ; )

for now, I think it's good.

Ready for Review

Copy link

vercel bot commented Feb 5, 2024

@Aashish-Upadhyay-101 is attempting to deploy a commit to the mftsio Team on Vercel.

A member of the Team first needs to authorize it.

@mfts
Copy link
Owner

mfts commented Feb 6, 2024

@Aashish-Upadhyay-101 wow nice work! I cannot wait to review this one 🎉

Comment on lines 90 to 112
<div className="absolute inset-y-0 right-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-6 sm:pr-0 space-x-4">
{embeddedLinks && embeddedLinks.length > 0 && (
<DropdownMenu>
<DropdownMenuTrigger>
<div className="text-sm font-semibold mr-6">
Embedded Links
</div>
</DropdownMenuTrigger>
<DropdownMenuContent className="space-y-2 pt-2 px-4">
{embeddedLinks.map((link, index) => (
<Link
href={link}
target="_blank"
className="text-sm flex items-start gap-2"
key={index}
>
<span>{index + 1}.</span>
<span className="underline">{link}</span>
</Link>
))}
</DropdownMenuContent>
</DropdownMenu>
)}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div className="absolute inset-y-0 right-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-6 sm:pr-0 space-x-4">
{embeddedLinks && embeddedLinks.length > 0 && (
<DropdownMenu>
<DropdownMenuTrigger>
<div className="text-sm font-semibold mr-6">
Embedded Links
</div>
</DropdownMenuTrigger>
<DropdownMenuContent className="space-y-2 pt-2 px-4">
{embeddedLinks.map((link, index) => (
<Link
href={link}
target="_blank"
className="text-sm flex items-start gap-2"
key={index}
>
<span>{index + 1}.</span>
<span className="underline">{link}</span>
</Link>
))}
</DropdownMenuContent>
</DropdownMenu>
)}
<div className="absolute inset-y-0 right-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-6 sm:pr-0 space-x-4">
{embeddedLinks && embeddedLinks.length > 0 ? (
<DropdownMenu>
<DropdownMenuTrigger>
<div className="text-sm font-semibold mr-6">
Embedded Links
</div>
</DropdownMenuTrigger>
<DropdownMenuContent className="space-y-2 pt-2 px-4">
{embeddedLinks.map((link, index) => (
<Link
href={link}
target="_blank"
className="text-sm flex items-start gap-2"
key={index}
>
<span>{index + 1}.</span>
<span className="underline">{link}</span>
</Link>
))}
</DropdownMenuContent>
</DropdownMenu>
) : null}

<DropdownMenu>
<DropdownMenuTrigger>
<div className="text-sm font-semibold mr-6">
Embedded Links
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Embedded Links
Links on Page

Comment on lines 100 to 108
<Link
href={link}
target="_blank"
className="text-sm flex items-start gap-2"
key={index}
>
<span>{index + 1}.</span>
<span className="underline">{link}</span>
</Link>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just use a <DropdownMenuItem> from shadcn/ui and the links will be styled properly.

Please remove the numbering <span>{index + 1}.</span>, I don't think that's needed

Comment on lines 94 to 96
<div className="text-sm font-semibold mr-6">
Embedded Links
</div>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can wrap this in a <Button> and then it will be styled well.

components/view/nav.tsx Show resolved Hide resolved
DropdownMenuContent,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import DropDown from "../web/alternatives/dropdownproto";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is probably not needed here

@Aashish-Upadhyay-101
Copy link
Contributor Author

@mfts suggested fixes done !

Copy link
Owner

@mfts mfts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Great work 👏

giphy-2

Copy link

vercel bot commented Feb 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
papermark ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 17, 2024 8:58am

@mfts mfts merged commit e048bc7 into mfts:main Feb 17, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make links inside PDFs and documents clickable when viewing with Papermark
2 participants