diff --git a/.gitignore b/.gitignore index 67554aa08f162d30056f0091db37e431f3275070..01f85363d7c121935eacaefbd04e85418c6fe257 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ # Ignore node_modules directory node_modules/ +package.json/ diff --git a/react-whenMeet/package.json b/react-whenMeet/package.json index 4173958719d5ee37867ca76e78478100d7137d51..dafb6ea7b18bff19ba9b489f9521e02e3c51cfff 100644 --- a/react-whenMeet/package.json +++ b/react-whenMeet/package.json @@ -19,7 +19,7 @@ "web-vitals": "^2.1.4" }, "scripts": { - "start": "export PORT=80 && react-scripts start", + "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" diff --git a/react-whenMeet/src/components/LinkPageForm.js b/react-whenMeet/src/components/LinkPageForm.js index 8ee09f37168513f062efbdb3ab65d13dc31d6dbd..93fdfb7b9efa3bb5fc8c8b98191f6de4a2ecf80f 100644 --- a/react-whenMeet/src/components/LinkPageForm.js +++ b/react-whenMeet/src/components/LinkPageForm.js @@ -11,14 +11,15 @@ function LinkPageForm() { const {id} = location.state; - const copyToClipboard = async (link) => { - try { - const textToCopy = `localhost:3000/HomeParticipate/${id}`; - await navigator.clipboard.writeText(textToCopy); - alert('클립보드에 복사되었습니다'); - } catch (err) { - alert('클립보드 복사에 실패하였습니다'); - } + const copyToClipboard = () => { + const textToCopy = `localhost:3000/HomeParticipate/${id}`; + const tempInput = document.createElement('input'); + document.body.appendChild(tempInput); + tempInput.value = textToCopy; + tempInput.select(); + document.execCommand('copy'); + document.body.removeChild(tempInput); + alert('클립보드에 복사되었습니다'); }; const handleSubmit = async(event) => { @@ -30,6 +31,7 @@ function LinkPageForm() { return ( <form onSubmit={handleSubmit}> <div> + <p>hey</p> <Input value={`localhost:3000/HomeParticipate/${id}`} /> diff --git a/react-whenMeet/src/components/MeetingInfoForm.js b/react-whenMeet/src/components/MeetingInfoForm.js index e60b43506187e37e86bddd8be40675236ffe915e..1f50093385e725604c6a340690684efe21ad016c 100644 --- a/react-whenMeet/src/components/MeetingInfoForm.js +++ b/react-whenMeet/src/components/MeetingInfoForm.js @@ -31,6 +31,7 @@ function MeetingInfoForm() { setNumber(inputValue); } else { alert("양수만을 입력하세요"); + setNumber(""); } };