Skip to content

Commit

Permalink
Design improvements, fixed select tag
Browse files Browse the repository at this point in the history
  • Loading branch information
pheralb committed Apr 1, 2024
1 parent dbe00d8 commit 4b37355
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
21 changes: 14 additions & 7 deletions src/components/links/create-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
FormMessage,
} from "@/ui/form";
import { Input, Textarea } from "@/ui/input";
import { LoaderIcon, RocketIcon, ShuffleIcon } from "lucide-react";
import { LoaderIcon, RocketIcon, ShuffleIcon, TagsIcon } from "lucide-react";
import { insertTagToLink } from "@/server/actions/tags";
import SelectTagsLink from "./select-tags-link";

Expand Down Expand Up @@ -222,12 +222,19 @@ export function CreateLink(props: CreateLinkProps) {
)}
/>
{isError && <Alert variant="error">{message}</Alert>}
<SelectTagsLink
selectedTags={selectedTags}
onSelectTag={handleAddTags}
onDeleteTag={handleDeleteTag}
tags={props.tags}
/>
{props.tags.length > 0 ? (
<SelectTagsLink
selectedTags={selectedTags}
onSelectTag={handleAddTags}
onDeleteTag={handleDeleteTag}
tags={props.tags}
/>
) : (
<div className="flex items-center justify-center space-x-2 rounded-md border border-neutral-200 py-3 text-sm dark:border-neutral-800">
<TagsIcon size={16} />
<p className="font-medium">You don't have any tag created.</p>
</div>
)}
</div>
<DialogFooter>
<DialogClose asChild>
Expand Down
5 changes: 1 addition & 4 deletions src/components/links/edit-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,7 @@ const EditLink = (props: EditLinkProps) => {
<PopoverTrigger className="absolute bottom-0 right-0 top-0 flex items-center px-3">
<LockIcon size={16} />
</PopoverTrigger>
<PopoverContent
sideOffset={0.2}
className="text-sm"
>
<PopoverContent className="max-w-72 text-sm">
<p className="mb-2">
Editing the custom link will remove access from
the previous link and it will be available to
Expand Down
4 changes: 2 additions & 2 deletions src/components/links/links-limit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
TooltipTrigger,
} from "@/ui/tooltip";
import { cn } from "@/utils";
import { CircleDashedIcon, TriangleAlertIcon } from "lucide-react";
import { PackageIcon, TriangleAlertIcon } from "lucide-react";

interface LinksLimitProps {
userLinks: number;
Expand Down Expand Up @@ -36,7 +36,7 @@ const LinksLimit = ({ userLinks, maxLinks }: LinksLimitProps) => {
{max ? (
<TriangleAlertIcon size={14} />
) : (
<CircleDashedIcon size={14} />
<PackageIcon size={14} />
)}
<span>
{userLinks < 10 ? `0${userLinks}` : userLinks}
Expand Down
2 changes: 1 addition & 1 deletion src/components/tags/search-tags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const SearchTag = (props: SearchTagProps) => {
</Button>
</PopoverTrigger>
<PopoverContent>
<p className="my-2 text-center font-medium">
<p className="my-2 text-center text-sm font-medium">
My Tags ({props.tags.length})
</p>
<div className="mb-2 flex w-full flex-col space-y-1">
Expand Down

0 comments on commit 4b37355

Please sign in to comment.