Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
fix: Change how to get links
Browse files Browse the repository at this point in the history
  • Loading branch information
Sansai-snct committed Dec 16, 2022
1 parent 025f051 commit 120c960
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/layout/header/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Button,
Input,
} from "@chakra-ui/react";
import { FC } from "react";
import { FC, useEffect } from "react";
import { useRouter } from "next/router";
import { IconButton } from "../../shared/button/icon-button";

Expand All @@ -24,7 +24,11 @@ type EditHeaderProps = {
export const EditHeader: FC<EditHeaderProps> = ({ name, link }) => {
const router = useRouter();
const { isOpen, onOpen, onClose } = useDisclosure();
const { onCopy, value, hasCopied } = useClipboard(link);
const { onCopy, value, hasCopied, setValue } = useClipboard(link);

useEffect(() => {
setValue(link);
});

const handler = async (path: string): Promise<void> => {
await router.push(path);
Expand Down Expand Up @@ -80,8 +84,8 @@ export const EditHeader: FC<EditHeaderProps> = ({ name, link }) => {
<Input
rounded="md"
bgColor="gray.500"
value={value}
onChange={() => {}}
value={link}
onChange={(e) => setValue(e.target.value)}
/>
</ModalBody>
<ModalFooter justifyContent="space-around">
Expand Down

0 comments on commit 120c960

Please sign in to comment.