Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[조혜진] Week11 #356

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35,759 changes: 17,903 additions & 17,856 deletions package-lock.json

Large diffs are not rendered by default.

77 changes: 39 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
{
"name": "1-weekly-mission",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"moment": "^2.30.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.3",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
"name": "1-weekly-mission",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"moment": "^2.30.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.3",
"react-scripts": "5.0.1",
"react-toastify": "^10.0.5",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
1 change: 1 addition & 0 deletions public/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* /index.html 200
Binary file modified public/favicon.ico
Binary file not shown.
45 changes: 15 additions & 30 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:title" content="Linkbrary" />
<meta
property="og:description"
content="세상의 모든 정보를 쉽게 저장하고 관리해 보세요"
/>
<meta
property="og:image"
content="https://www.freeiconspng.com/uploads/links-icon-30.jpg"
/>
<meta property="og:url" content="https://linkbrary-hyejean.netlify.app" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Linkbrary" />
<meta
name="twitter:description"
content="세상의 모든 정보를 쉽게 저장하고 관리해 보세요"
/>
<meta
name="twitter:image"
content="https://www.freeiconspng.com/uploads/links-icon-30.jpg"
/>
<title>Linkbrary</title>
</head>
<body>
<div id="root"></div>
</body>
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:title" content="Linkbrary" />
<meta property="og:description" content="세상의 모든 정보를 쉽게 저장하고 관리해 보세요" />
<meta property="og:image" content="https://ibb.co/cgDjBG1" />
<meta property="og:url" content="https://linkbrary-hyejean.netlify.app" />
<meta property="og:type" content="website" />
<script src="https://developers.kakao.com/sdk/js/kakao.js"></script>
<title>Linkbrary</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
25 changes: 0 additions & 25 deletions public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions public/robots.txt

This file was deleted.

60 changes: 55 additions & 5 deletions src/Components/Article/Article.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,64 @@
// Article.jsx
import link_icon from "../../assets/link.png";
import styles from "./Article.module.css";
import { useState } from 'react';
import link_icon from '../../assets/link.png';
import styles from './Article.module.css';
import Modal from '../Modal/Modal';

function Article() {
const [isModalOpen, setIsModalOpen] = useState(false);
const [linkInput, setLinkInput] = useState('');

const handleOpenModal = () => {
if (!linkInput.trim()) {
alert('링크를 입력해주세요.');
return;
}
setIsModalOpen(true);
};

const handleCloseModal = () => {
setIsModalOpen(false);
};

const handleSubmit = () => {
setLinkInput(''); // 입력값 초기화
handleCloseModal();
};

const handleChange = (e) => {
setLinkInput(e.target.value);
};

if (isModalOpen) {
document.body.style.overflow = 'hidden';
} else {
document.body.style.overflow = 'auto';
}

return (
<div className={styles.folder_info_container}>
<div className={styles.search_div}>
<img src={link_icon} width={30} height={30} />
<input className={styles.search_input} placeholder="링크를 추가해 보세요" />
<button className={styles.btn}>추가하기</button>
<img src={link_icon} width={30} height={30} alt="link icon" />
<input
className={styles.search_input}
placeholder="링크를 추가해 보세요"
value={linkInput}
onChange={handleChange}
/>
<button className={styles.btn} onClick={handleOpenModal}>
추가하기
</button>
{isModalOpen && (
<Modal
title="폴더에 추가"
subtitle={linkInput}
list
btnText="추가하기"
btnColor="submit"
onClose={handleCloseModal}
onSubmit={() => handleSubmit(linkInput)}
/>
)}
</div>
</div>
);
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Article/Article.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "../../global.css";
@import "../../reset.css";
@import '../../global.css';
@import '../../reset.css';

.folder_info_container {
width: 100%;
Expand Down
Loading
Loading