forked from dubinc/dub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
standardized LinkPreview implementation, finalized changes
- Loading branch information
1 parent
41fcb59
commit 4b45041
Showing
14 changed files
with
292 additions
and
321 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,29 @@ | ||
"use client"; | ||
|
||
import { Link2 } from "lucide-react"; | ||
|
||
export default function LinkInspectorForm() { | ||
return ( | ||
<form | ||
onSubmit={(e) => { | ||
e.preventDefault(); | ||
window.open(`${e.currentTarget.url.value}+`, "_blank"); | ||
}} | ||
> | ||
<div className="relative flex items-center"> | ||
<Link2 className="absolute inset-y-0 left-0 my-2 ml-3 w-5 text-gray-400" /> | ||
<input | ||
name="url" | ||
type="url" | ||
placeholder="https://dub.sh/github" | ||
autoComplete="off" | ||
required | ||
className="peer block w-full rounded-md border-gray-300 pl-10 pr-12 text-sm text-gray-900 placeholder-gray-300 focus:border-gray-500 focus:outline-none focus:ring-gray-500" | ||
/> | ||
<button className="absolute inset-y-0 right-0 my-1.5 mr-1.5 flex w-10 items-center justify-center rounded border border-gray-200 font-sans text-sm font-medium text-gray-400 hover:border-gray-700 hover:text-gray-700 peer-focus:text-gray-700"> | ||
↗ | ||
</button> | ||
</div> | ||
</form> | ||
); | ||
} |
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,63 @@ | ||
import Background from "#/ui/home/background"; | ||
import { constructMetadata } from "#/lib/utils"; | ||
import LinkInspectorForm from "./form"; | ||
import { Photo } from "@/components/shared/icons"; | ||
import LinkPreview from "#/ui/home/link-preview"; | ||
import Link from "next/link"; | ||
import BlurImage from "#/ui/blur-image"; | ||
|
||
export const metadata = constructMetadata({ | ||
title: "Link Inspector - Inspect a Short Link on Dub to Make Sure It's Safe", | ||
description: | ||
"Dub's Link Inspector is a simple tool for inspecting short links on Dub to make sure it's safe to click on. If you think this link is malicious, please report it.", | ||
}); | ||
|
||
export default function LinkInspector() { | ||
return ( | ||
<> | ||
<div className="mx-2 my-10 flex max-w-md flex-col space-y-5 px-2.5 text-center sm:mx-auto sm:max-w-lg sm:px-0 lg:mb-16"> | ||
<h1 className="font-display text-5xl font-extrabold leading-[1.15] text-black sm:text-6xl sm:leading-[1.15]"> | ||
Link Inspector | ||
</h1> | ||
<h2 className="text-lg text-gray-600 sm:text-xl"> | ||
Inspect a short link on Dub to make sure it's safe to click on. If you | ||
think this link is malicious, please report it. | ||
</h2> | ||
<LinkInspectorForm /> | ||
<a | ||
href="/changelog/link-inspector" | ||
target="_blank" | ||
className="relative overflow-hidden rounded-md border border-gray-300 bg-gray-50" | ||
> | ||
<BlurImage | ||
src="https://d2vwwcvoksz7ty.cloudfront.net/changelog/link-inspector.png" | ||
alt="Link Inspector OG image" | ||
width={1071} | ||
height={630} | ||
className="h-[250px] w-full border-b border-gray-300 object-cover" | ||
/> | ||
|
||
<div className="grid gap-1 bg-white p-3 text-left"> | ||
<p className="text-sm text-[#536471]">dub.co</p> | ||
<h3 className="truncate text-sm font-medium text-[#0f1419]"> | ||
Link Inspector | ||
</h3> | ||
<p className="line-clamp-2 text-sm text-[#536471]"> | ||
You can now inspect short links on Dub by adding a '+' to the end | ||
of the short link. | ||
</p> | ||
</div> | ||
</a> | ||
<a | ||
href="/changelog/link-inspector" | ||
rel="noreferrer" | ||
target="_blank" | ||
className="mx-auto mt-2 flex items-center justify-center space-x-2 text-sm text-gray-500 transition-all hover:text-black" | ||
> | ||
Read the changelog → | ||
</a> | ||
</div> | ||
<Background /> | ||
</> | ||
); | ||
} |
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
Oops, something went wrong.