Skip to content

Commit 0d4fe53

Browse files
authoredApr 1, 2024
Merge pull request #22 from pheralb/next
🎨 Dashboard & Home Page improvements
2 parents 05ba22d + 4b37355 commit 0d4fe53

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed
 

‎src/app/page.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import BetaWarning from "@/components/beta-warning";
99

1010
export default async function Home() {
1111
return (
12-
<>
12+
<main className="relative h-[calc(100vh-4rem)]">
1313
<BetaWarning />
1414
<div className="absolute inset-0 -z-10 h-full w-full bg-white bg-[linear-gradient(to_right,#8080800a_1px,transparent_1px),linear-gradient(to_bottom,#8080800a_1px,transparent_1px)] bg-[size:14px_24px] dark:bg-neutral-900"></div>
1515
<section
@@ -23,7 +23,7 @@ export default async function Home() {
2323
Slug is an open-source platform that allows you to create, manage, and
2424
share short links with ease. It's fast, secure, and easy to use.
2525
</TypographyP>
26-
<div className="mt-8 items-center justify-center gap-x-3 space-y-3 sm:flex sm:space-y-0 animate-in fade-in-30 duration-700">
26+
<div className="mt-8 items-center justify-center gap-x-3 space-y-3 duration-700 animate-in fade-in-30 sm:flex sm:space-y-0">
2727
<Link
2828
href="/dashboard"
2929
className={buttonVariants({
@@ -56,6 +56,6 @@ export default async function Home() {
5656
</div>
5757
</section>
5858
<Footer className="fixed bottom-0 mt-4 py-4" />
59-
</>
59+
</main>
6060
);
6161
}

‎src/components/links/create-link.tsx

+14-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import {
3232
FormMessage,
3333
} from "@/ui/form";
3434
import { Input, Textarea } from "@/ui/input";
35-
import { LoaderIcon, RocketIcon, ShuffleIcon } from "lucide-react";
35+
import { LoaderIcon, RocketIcon, ShuffleIcon, TagsIcon } from "lucide-react";
3636
import { insertTagToLink } from "@/server/actions/tags";
3737
import SelectTagsLink from "./select-tags-link";
3838

@@ -222,12 +222,19 @@ export function CreateLink(props: CreateLinkProps) {
222222
)}
223223
/>
224224
{isError && <Alert variant="error">{message}</Alert>}
225-
<SelectTagsLink
226-
selectedTags={selectedTags}
227-
onSelectTag={handleAddTags}
228-
onDeleteTag={handleDeleteTag}
229-
tags={props.tags}
230-
/>
225+
{props.tags.length > 0 ? (
226+
<SelectTagsLink
227+
selectedTags={selectedTags}
228+
onSelectTag={handleAddTags}
229+
onDeleteTag={handleDeleteTag}
230+
tags={props.tags}
231+
/>
232+
) : (
233+
<div className="flex items-center justify-center space-x-2 rounded-md border border-neutral-200 py-3 text-sm dark:border-neutral-800">
234+
<TagsIcon size={16} />
235+
<p className="font-medium">You don't have any tag created.</p>
236+
</div>
237+
)}
231238
</div>
232239
<DialogFooter>
233240
<DialogClose asChild>

‎src/components/links/edit-link.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,7 @@ const EditLink = (props: EditLinkProps) => {
139139
<PopoverTrigger className="absolute bottom-0 right-0 top-0 flex items-center px-3">
140140
<LockIcon size={16} />
141141
</PopoverTrigger>
142-
<PopoverContent
143-
sideOffset={0.2}
144-
className="text-sm"
145-
>
142+
<PopoverContent className="max-w-72 text-sm">
146143
<p className="mb-2">
147144
Editing the custom link will remove access from
148145
the previous link and it will be available to

‎src/components/links/links-limit.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
TooltipTrigger,
77
} from "@/ui/tooltip";
88
import { cn } from "@/utils";
9-
import { CircleDashedIcon, TriangleAlertIcon } from "lucide-react";
9+
import { PackageIcon, TriangleAlertIcon } from "lucide-react";
1010

1111
interface LinksLimitProps {
1212
userLinks: number;
@@ -36,7 +36,7 @@ const LinksLimit = ({ userLinks, maxLinks }: LinksLimitProps) => {
3636
{max ? (
3737
<TriangleAlertIcon size={14} />
3838
) : (
39-
<CircleDashedIcon size={14} />
39+
<PackageIcon size={14} />
4040
)}
4141
<span>
4242
{userLinks < 10 ? `0${userLinks}` : userLinks}

‎src/components/tags/search-tags.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const SearchTag = (props: SearchTagProps) => {
6464
</Button>
6565
</PopoverTrigger>
6666
<PopoverContent>
67-
<p className="my-2 text-center font-medium">
67+
<p className="my-2 text-center text-sm font-medium">
6868
My Tags ({props.tags.length})
6969
</p>
7070
<div className="mb-2 flex w-full flex-col space-y-1">

0 commit comments

Comments
 (0)