Skip to content

Commit

Permalink
bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
VijeshVS committed May 28, 2024
1 parent 4269aa9 commit f0ba69b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/app/(dashboard)/links/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { LinkShareDialog } from "@/components/DialogComponents/LinkShareDialog";
import { EditLinkDialog } from "@/components/DialogComponents/EditLinkDialog";
import { copyToClipboard } from "@/lib/utils";
import { LinkType } from "@/interfaces/types";
import { useState } from "react";

const months = [
"January", "February", "March", "April", "May", "June",
Expand Down Expand Up @@ -63,6 +64,9 @@ export default function Page(params : any) {
}
};

const [title,setTitle] = useState(link.title);
const [shortCode,setShortcode] = useState(link.shortLink)

return (
<div className="pl-5 md:pl-8 pr-2 pt-12">
<Link href="/app/links">
Expand All @@ -81,7 +85,7 @@ export default function Page(params : any) {
<div className="flex flex-col ml-6 w-full">
<div className="flex justify-between ">
<h1 className="text-xl font-bold">
{link.title}
{title}
</h1>
<div className="hidden md:block">
<Button onClick={()=>{copyToClipboard(link.shortLink)}} variant="outline">
Expand All @@ -94,7 +98,7 @@ export default function Page(params : any) {
Share
</Button>
</LinkShareDialog>
<EditLinkDialog link={{title:link.title,shortLink:link.shortLink}}>
<EditLinkDialog setShortcode={setShortcode} setParentTitle={setTitle} link={{title:link.title,shortLink:link.shortLink}}>
<Button variant="outline" className="ml-2">
<Pencil size={15} className="mr-2" />
Edit
Expand Down Expand Up @@ -133,7 +137,7 @@ export default function Page(params : any) {
<Share2 size={15} />
</Button>
</LinkShareDialog>
<EditLinkDialog link={{title:link.title,shortLink:link.shortLink}}>
<EditLinkDialog setShortcode={setShortcode} setParentTitle={setTitle} link={{title:link.title,shortLink:link.shortLink}}>
<Button className="ml-2 " variant="outline">
<Pencil size={15}/>
</Button>
Expand Down

0 comments on commit f0ba69b

Please sign in to comment.