diff --git a/frontend/sweet-red-beans/.prettierrc b/frontend/sweet-red-beans/.prettierrc new file mode 100644 index 0000000..d2387cf --- /dev/null +++ b/frontend/sweet-red-beans/.prettierrc @@ -0,0 +1,7 @@ +{ + "trailingComma": "es5", + "tabWidth": 4, + "semi": true, + "singleQuote": true, + "bracketSameLine": true +} \ No newline at end of file diff --git a/frontend/sweet-red-beans/src/components/Comment/Comment.js b/frontend/sweet-red-beans/src/components/Comment/Comment.js index 7731e81..dcb2307 100644 --- a/frontend/sweet-red-beans/src/components/Comment/Comment.js +++ b/frontend/sweet-red-beans/src/components/Comment/Comment.js @@ -1,86 +1,89 @@ -import React, { useEffect, useState } from "react"; -import axios from "axios"; -import { useNavigate } from "react-router"; -import { useSelector } from "react-redux"; -import style from "../../css/Comment/Comment.module.css"; -import { parseDate } from "../../parseDate/parseDate"; +import React, { useEffect, useState } from 'react'; +import axios from 'axios'; +import { useNavigate } from 'react-router'; +import { useSelector } from 'react-redux'; +import style from '../../css/Comment/Comment.module.css'; +import { parseDate } from '../../parseDate/parseDate'; -const Comment = ({comment}) => { - console.log("댓글 렌더"); +const Comment = ({ comment }) => { + console.log('댓글 렌더'); const navigation = useNavigate(); //const userid = useSelector(state => state.user.user_id); const useConfirm = (message = null, onConfirm, onCancel) => { - if (!onConfirm || typeof onConfirm !== "function") { + if (!onConfirm || typeof onConfirm !== 'function') { return; } - if (onCancel && typeof onCancel !== "function") { + if (onCancel && typeof onCancel !== 'function') { return; } - + const confirmAction = () => { if (window.confirm(message)) { - onConfirm(); + onConfirm(); } else { - onCancel(); + onCancel(); } }; - + return confirmAction; }; //삭제버튼 눌렀을 때 const deleteConfirm = () => { - axios.delete('http://localhost:8080/information-share/comment',{ - withCredentials: true, - data: { - user_id : "1", + axios + .delete('http://localhost:8080/information-share/comment', { + withCredentials: true, + data: { + user_id: '1', comment_id: comment.comment_id, + }, + }) + .then((response) => { + if (response.data.result) { + alert('삭제되었습니다.'); + //현재 페이지 리렌더 + navigation(0); + } else { + alert('삭제에 실패했습니다.'); } - }) - .then(response => { - if(response.data.result){ - alert("삭제되었습니다.") - //현재 페이지 리렌더 - navigation(0) - } - else { - alert("삭제에 실패했습니다.") - } - }) - .catch(error => console.log(error)); - } + }) + .catch((error) => console.log(error)); + }; - const cancelConfirm = () => console.log("삭제 취소") + const cancelConfirm = () => console.log('삭제 취소'); const deleteClick = useConfirm( - "삭제하시겠습니까?", + '삭제하시겠습니까?', deleteConfirm, cancelConfirm ); return ( <> -
-
- -
{comment.user_status === "정지" || comment.user_status === "탈퇴" ? "(알수없음)" : comment.comment_nickname}
-
{parseDate(comment.comment_written_date)}
-
- -
-
{comment.comment_content}
-
- {comment.is_mine ? : null} +
+
+
+ {comment.user_status === '정지' || + comment.user_status === '탈퇴' + ? '(알수없음)' + : comment.comment_nickname} +
+
{parseDate(comment.comment_written_date)}
+
+ +
+
{comment.comment_content}
+
+ {comment.is_mine ? ( + + ) : null} +
- -
- - ); -} +}; -export default Comment; \ No newline at end of file +export default Comment; diff --git a/frontend/sweet-red-beans/src/components/DMPage/DMDetail.js b/frontend/sweet-red-beans/src/components/DMPage/DMDetail.js index 71b4f8a..d0540fd 100644 --- a/frontend/sweet-red-beans/src/components/DMPage/DMDetail.js +++ b/frontend/sweet-red-beans/src/components/DMPage/DMDetail.js @@ -1,28 +1,34 @@ -import React, {useState, useCallback, useEffect, useMemo, useRef} from "react"; +import React, { + useState, + useCallback, + useEffect, + useMemo, + useRef, +} from 'react'; import * as StompJs from '@stomp/stompjs'; -import SockJS from "sockjs-client"; +import SockJS from 'sockjs-client'; import SockJsClient from 'react-stomp'; -import Stomp from "stompjs"; -import axios from "axios"; -import Modal from "../../components/Modals/TransactionModal"; -import style from "../../css/DMPage/DMDetail.module.css"; -import { useDispatch, useSelector } from "react-redux"; -import { SELECTED_DM } from "../../actions/types"; -import { parseDate } from "../../parseDate/parseDate"; -import { Cookies } from "react-cookie"; -import { useNavigate } from "react-router"; -import user from "../../img/user.png"; +import Stomp from 'stompjs'; +import axios from 'axios'; +import Modal from '../../components/Modals/TransactionModal'; +import style from '../../css/DMPage/DMDetail.module.css'; +import { useDispatch, useSelector } from 'react-redux'; +import { SELECTED_DM } from '../../actions/types'; +import { parseDate } from '../../parseDate/parseDate'; +import { Cookies } from 'react-cookie'; +import { useNavigate } from 'react-router'; +import user from '../../img/user.png'; let stompClient = null; //props를 selectedRoom으로 바꾸고 roomId는 selectedRoom.chat_room_id으로 바꾸기 //transaction_id 값 바꾸기 -const DMDetail = ({selectedRoom}) => { +const DMDetail = ({ selectedRoom }) => { const navigation = useNavigate(); const [modalOpen, setModalOpen] = useState(false); - const [reportContent, setReportContent] = useState(""); + const [reportContent, setReportContent] = useState(''); //거래완료되면 true //초기값 selectedRoom.is_complete로 설정하기 const [complete, setComplete] = useState(selectedRoom.is_complete); @@ -30,8 +36,7 @@ const DMDetail = ({selectedRoom}) => { const [imgFile, setImgFile] = useState(null); const [imgBase64, setImgBase64] = useState(null); - const [myNickname, setMyNickname] = useState(""); - + const [myNickname, setMyNickname] = useState(''); const openModal = () => { setModalOpen(true); @@ -40,307 +45,393 @@ const DMDetail = ({selectedRoom}) => { setModalOpen(false); }; - //대화 내용, 상대방 것 포함 const [contents, setContents] = useState([]); - const [username, setUsername] = useState(""); + const [username, setUsername] = useState(''); //내가 보낸 메시지 내용 - const [message, setMessage] = useState(""); + const [message, setMessage] = useState(''); let socket = new SockJS('http://localhost:8080/ws-stomp'); let stompClient = Stomp.over(socket); - + useEffect(() => { - axios.get('http://localhost:8080/mypage',{ - withCredentials: true , - }) - .then(response => { - setMyNickname(response.data.user.nickname); - }) - .catch(e => console.log(e)) - }, []) + axios + .get('http://localhost:8080/mypage', { + withCredentials: true, + }) + .then((response) => { + setMyNickname(response.data.user.nickname); + }) + .catch((e) => console.log(e)); + }, []); useEffect(() => { console.log(myNickname); - }, [myNickname]) + }, [myNickname]); //전송 버튼 눌렀을 때 const sendClick = () => { - // if(!cookies.get("login")) { // alert("로그인을 먼저 해주세요"); // navigation('/') // } sendMessage(message); //서버에서 받아올 때처럼 비슷한 형식으로 넣어주기 위해 - setMessage(""); - } + setMessage(''); + }; const sendMessage = (message) => { const fd = new FormData(); - if(imgFile === null){ - if(message !== ""){ - stompClient.send("/pub/chat/message", {}, JSON.stringify({ - content : message, - chat_room_id: selectedRoom.chat_room_id, - })); + if (imgFile === null) { + if (message !== '') { + stompClient.send( + '/pub/chat/message', + {}, + JSON.stringify({ + content: message, + chat_room_id: selectedRoom.chat_room_id, + }) + ); } - } else { - stompClient.send("/pub/chat/message", {}, JSON.stringify({ - content : message, - chat_room_id: selectedRoom.chat_room_id, - image_url:imgBase64, - })); + stompClient.send( + '/pub/chat/message', + {}, + JSON.stringify({ + content: message, + chat_room_id: selectedRoom.chat_room_id, + image_url: imgBase64, + }) + ); setImgBase64(null); setImgFile(null); } - - } + }; useEffect(() => { console.log(imgBase64); - }, [imgBase64]) + }, [imgBase64]); useEffect(() => { console.log(contents); - }, [contents]) + }, [contents]); - const addMessage = (message) =>{ + const addMessage = (message) => { //상대에게 받아온 메시지를 추가함 - setContents(prev=>[...prev, message]); + setContents((prev) => [...prev, message]); }; - const onChange = useCallback( - (e) => { - setMessage(e.target.value); - }, [] - ) + const onChange = useCallback((e) => { + setMessage(e.target.value); + }, []); //이제까지 메시지 내역 조회 useEffect(() => { console.log(selectedRoom); setContents([]); - setMessage(""); - if(selectedRoom !== undefined){ - axios.get("http://localhost:8080/direct-message/detail", { - withCredentials: true, - params:{ - room_id: selectedRoom.chat_room_id, - } - }) - .then(response => { - //setMList(response.data.message.map(item => item.message_content)); - setContents(response.data.message); - }) - .catch(error => console.log(error)) + setMessage(''); + if (selectedRoom !== undefined) { + axios + .get('http://localhost:8080/direct-message/detail', { + withCredentials: true, + params: { + room_id: selectedRoom.chat_room_id, + }, + }) + .then((response) => { + //setMList(response.data.message.map(item => item.message_content)); + setContents(response.data.message); + }) + .catch((error) => console.log(error)); } stompClient.connect({}, () => { - stompClient.subscribe('/sub/chat/room/' + selectedRoom.chat_room_id, (data) => { - console.log(JSON.parse(data.body)); - const newMessage = JSON.parse(data.body); - addMessage(newMessage); - }) + stompClient.subscribe( + '/sub/chat/room/' + selectedRoom.chat_room_id, + (data) => { + console.log(JSON.parse(data.body)); + const newMessage = JSON.parse(data.body); + addMessage(newMessage); + } + ); }); - setComplete(selectedRoom.is_complete) - + setComplete(selectedRoom.is_complete); + return () => { - if(stompClient != null) { + if (stompClient != null) { stompClient.disconnect(); } - } - }, [selectedRoom]) + }; + }, [selectedRoom]); //신뢰도 +1 주는 버튼 const reliabilityPlusClick = () => { //신뢰도 1 주기 - if(complete === false) { - alert("거래완료를 해야 신뢰도를 줄 수 있습니다"); - } - - else { + if (complete === false) { + alert('거래완료를 해야 신뢰도를 줄 수 있습니다'); + } else { const body = { - user_id: selectedRoom.not_mine_id - } - axios.post('http://localhost:8080/direct-message/reliability', body, { withCredentials: true }) - .then(response => { - if(response.data.result){ - alert("상대방의 신뢰도가 올랐습니다.") - } - else { - alert("신뢰도를 올리는 데 실패했습니다.") - } - }) - .catch(error => console.log(error)); + user_id: selectedRoom.not_mine_id, + }; + axios + .post( + 'http://localhost:8080/direct-message/reliability', + body, + { withCredentials: true } + ) + .then((response) => { + if (response.data.result) { + alert('상대방의 신뢰도가 올랐습니다.'); + } else { + alert('신뢰도를 올리는 데 실패했습니다.'); + } + }) + .catch((error) => console.log(error)); } - - } + }; //신고 내용 const reportContentChange = (e) => { setReportContent(e.target.value); - } + }; //신고 확인 버튼 눌렀을 때 const reportConfirm = () => { const body = { - user_id : "1", - transaction_id : selectedRoom.transaction_id, - report_content : reportContent, - } - axios.post('http://localhost:8080/direct-message/report', body, { withCredentials: true }) - .then(response => { - if(response.data.result){ - alert("신고되었습니다.") - setReportContent(""); - setModalOpen(false); - } - else { - alert("신고에 실패했습니다.") - } - }) - .catch(error => console.log(error)); - } + user_id: '1', + transaction_id: selectedRoom.transaction_id, + report_content: reportContent, + }; + axios + .post('http://localhost:8080/direct-message/report', body, { + withCredentials: true, + }) + .then((response) => { + if (response.data.result) { + alert('신고되었습니다.'); + setReportContent(''); + setModalOpen(false); + } else { + alert('신고에 실패했습니다.'); + } + }) + .catch((error) => console.log(error)); + }; //삭제 취소 버튼 눌렀을 때 const cancelConfirm = (e) => { - console.log("신고 취소"); - } + console.log('신고 취소'); + }; //모달창에서 신고하기 버튼 눌렀을 때 const reportClick = (e) => { e.preventDefault(); - if(reportContent === ""){ - alert("신고 내용을 입력해주세요"); - } - else { - if (window.confirm("정말 신고하시겠습니까?")) { + if (reportContent === '') { + alert('신고 내용을 입력해주세요'); + } else { + if (window.confirm('정말 신고하시겠습니까?')) { reportConfirm(); } else { cancelConfirm(); } } - } + }; //거래완료 버튼 눌렀을 때 const completeClick = () => { const body = { transaction_id: selectedRoom.transaction_id, - } - axios.post('http://localhost:8080/direct-message/transaction-complete', body, { withCredentials: true }) - .then(response => { - if(response.data.result){ - setComplete(true); - } - else { - alert("거래완료에 실패했습니다.") - } - }) - .catch(error => console.log(error)); - - } + }; + axios + .post( + 'http://localhost:8080/direct-message/transaction-complete', + body, + { withCredentials: true } + ) + .then((response) => { + if (response.data.result) { + setComplete(true); + } else { + alert('거래완료에 실패했습니다.'); + } + }) + .catch((error) => console.log(error)); + }; useEffect(() => { - let messagebox = document.querySelector("#messagebox"); + let messagebox = document.querySelector('#messagebox'); messagebox.scrollTop = messagebox.scrollHeight; - }, [contents, imgBase64]) + }, [contents, imgBase64]); const handleChangeFile = (e) => { setImgFile(e.target.files); - } + }; const previewCancelClick = () => { setImgFile(null); setImgBase64(null); - } + }; useEffect(() => { - if(!imgFile) return false; + if (!imgFile) return false; const reader = new FileReader(); reader.onloadend = () => { setImgBase64(reader.result); - } + }; reader.readAsDataURL(imgFile[0]); - - }, [imgFile]) + }, [imgFile]); return ( <> - -
-
신고사유를 적어주세요
-
- -
- -
-
- -
-
-
- -
{selectedRoom.user_status === "정지" || selectedRoom.user_status === "탈퇴" ? "(알수없음)" : selectedRoom.not_mine_nickname}
-
{selectedRoom.not_mine_reliability}
-
- - - -
-
- {useMemo(() => - -
- {contents.map((message, index) => ( -
- {message.image_url===null || message.image_url==="" - ? - <> -
{message.nickname===myNickname ? parseDate(message.written_date) : null}
-
{message.content}
-
{!(message.nickname===myNickname) ? parseDate(message.written_date) : null}
- - : - <> -
{message.nickname===myNickname ? parseDate(message.written_date) : null}
-
-
{message.content}
-
-
-
{!(message.nickname===myNickname) ? parseDate(message.written_date) : null}
- + +
+
신고사유를 적어주세요
+
+ +
+ +
+
+ +
+
+
+ +
+ {selectedRoom.user_status === '정지' || + selectedRoom.user_status === '탈퇴' + ? '(알수없음)' + : selectedRoom.not_mine_nickname} +
+
{selectedRoom.not_mine_reliability}
+
+ + +
- - ))} -
- {imgBase64 !== null ? -
- -
- : null} + {useMemo( + () => ( +
+ {contents.map((message, index) => ( +
+ {message.image_url === null || + message.image_url === '' ? ( + <> +
+ {message.nickname === myNickname + ? parseDate( + message.written_date + ) + : null} +
+
{message.content}
+
+ {!( + message.nickname === + myNickname + ) + ? parseDate( + message.written_date + ) + : null} +
+ + ) : ( + <> +
+ {message.nickname === myNickname + ? parseDate( + message.written_date + ) + : null} +
+
+
{message.content}
+
+ +
+
+
+ {!( + message.nickname === + myNickname + ) + ? parseDate( + message.written_date + ) + : null} +
+ + )} +
+ ))} +
+ {imgBase64 !== null ? ( +
+ + +
+ ) : null} +
+
+ ), + [contents, imgBase64, myNickname] + )} + + {complete ? ( +
거래가 완료되었습니다.
+ ) : null} + +
+ + + +
- -
- , [contents, imgBase64, myNickname])} - - - {complete ?
거래가 완료되었습니다.
: null} - -
- - - -
-
- ); -} +}; -export default DMDetail; \ No newline at end of file +export default DMDetail; diff --git a/frontend/sweet-red-beans/src/components/DMPage/DMList.js b/frontend/sweet-red-beans/src/components/DMPage/DMList.js index 428f5ab..ace2449 100644 --- a/frontend/sweet-red-beans/src/components/DMPage/DMList.js +++ b/frontend/sweet-red-beans/src/components/DMPage/DMList.js @@ -1,21 +1,25 @@ -import React, { useCallback, useState, useEffect } from "react"; -import axios from "axios"; -import DMListThumbnail from "./DMListThumbnail"; -import DMDetail from "./DMDetail"; -import { useDispatch, useSelector } from "react-redux"; -import { SELECTED_DM } from "../../actions/types"; -import { useNavigate } from "react-router"; -import style from "../../css/DMPage/DMList.module.css"; +import React, { useCallback, useState, useEffect } from 'react'; +import axios from 'axios'; +import DMListThumbnail from './DMListThumbnail'; +import DMDetail from './DMDetail'; +import { useDispatch, useSelector } from 'react-redux'; +import { SELECTED_DM } from '../../actions/types'; +import { useNavigate } from 'react-router'; +import style from '../../css/DMPage/DMList.module.css'; -const DMList = ({DMlist, DMListClick}) => { +const DMList = ({ DMlist, DMListClick }) => { console.log(DMlist); return ( <> -
- {DMlist.map((item, index) =>
DMListClick(item, e)}>
)} -
+
+ {DMlist.map((item, index) => ( +
DMListClick(item, e)}> + +
+ ))} +
); -} +}; -export default DMList; \ No newline at end of file +export default DMList; diff --git a/frontend/sweet-red-beans/src/components/DMPage/DMListThumbnail.js b/frontend/sweet-red-beans/src/components/DMPage/DMListThumbnail.js index 4a0397a..fff1b9b 100644 --- a/frontend/sweet-red-beans/src/components/DMPage/DMListThumbnail.js +++ b/frontend/sweet-red-beans/src/components/DMPage/DMListThumbnail.js @@ -1,55 +1,67 @@ -import React, { useEffect, useState } from "react"; -import { useSelector, useDispatch } from "react-redux"; -import { useNavigate } from "react-router"; -import style from "../../css/DMPage/DMListThumbnail.module.css"; -import { parseDate } from "../../parseDate/parseDate"; -import user from "../../img/user.png"; +import React, { useEffect, useState } from 'react'; +import { useSelector, useDispatch } from 'react-redux'; +import { useNavigate } from 'react-router'; +import style from '../../css/DMPage/DMListThumbnail.module.css'; +import { parseDate } from '../../parseDate/parseDate'; +import user from '../../img/user.png'; -const DMListThumbnail = ({dm}) => { +const DMListThumbnail = ({ dm }) => { //const cookies = Cookies(); const dispatch = useDispatch(); const navigation = useNavigate(); const [currentRoom, setCurrentRoom] = useState(false); - const selectedRoomId = useSelector(s => { + const selectedRoomId = useSelector((s) => { if (s === undefined) { return null; - } - else { + } else { return s.selectedRoomId; } - }) + }); useEffect(() => { console.log(dm); - if(selectedRoomId !== null) { + if (selectedRoomId !== null) { if (dm.chat_room_id === selectedRoomId) { - console.log("a의 번호: ", selectedRoomId); - console.log("같음 : ", dm.chat_room_id); + console.log('a의 번호: ', selectedRoomId); + console.log('같음 : ', dm.chat_room_id); setCurrentRoom(true); - } - else { + } else { setCurrentRoom(false); } } - }, [selectedRoomId]) - + }, [selectedRoomId]); + return ( <> -
+
+ - - -
-
{dm.user_status === "정지" || dm.user_status === "탈퇴" ? "(알수없음)" : dm.not_mine_nickname}
-
{dm.recent_message}
-
-
- {dm.recent_message_date === null ? "" : parseDate(dm.recent_message_date)} +
+
+ {dm.user_status === '정지' || dm.user_status === '탈퇴' + ? '(알수없음)' + : dm.not_mine_nickname} +
+
{dm.recent_message}
+
+
+ {dm.recent_message_date === null + ? '' + : parseDate(dm.recent_message_date)} +
-
- - ) -} + ); +}; -export default DMListThumbnail \ No newline at end of file +export default DMListThumbnail; diff --git a/frontend/sweet-red-beans/src/components/DMPage/DMPage.js b/frontend/sweet-red-beans/src/components/DMPage/DMPage.js index 22cb5c5..1f95d52 100644 --- a/frontend/sweet-red-beans/src/components/DMPage/DMPage.js +++ b/frontend/sweet-red-beans/src/components/DMPage/DMPage.js @@ -1,16 +1,16 @@ -import React, {useRef, useState, useEffect, useMemo} from "react"; -import { useDispatch, useSelector } from "react-redux"; -import DMList from "./DMList"; -import DMDetail from "./DMDetail"; +import React, { useRef, useState, useEffect, useMemo } from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import DMList from './DMList'; +import DMDetail from './DMDetail'; import * as StompJs from '@stomp/stompjs'; -import SockJS from "sockjs-client"; +import SockJS from 'sockjs-client'; import SockJsClient from 'react-stomp'; -import Stomp from "stompjs"; -import axios from "axios"; -import store from "../../store"; -import { useNavigate } from "react-router"; -import style from "../../css/DMPage/DMPage.module.css"; -import { SELECTED_DM } from "../../actions/types"; +import Stomp from 'stompjs'; +import axios from 'axios'; +import store from '../../store'; +import { useNavigate } from 'react-router'; +import style from '../../css/DMPage/DMPage.module.css'; +import { SELECTED_DM } from '../../actions/types'; const DMPage = () => { const dispatch = useDispatch(); @@ -22,56 +22,54 @@ const DMPage = () => { useEffect(() => { //DM 목록 조회 - axios.get('http://localhost:8080/direct-message',{ - withCredentials: true, - }) - .then(response => { - setDMList(response.data.room_id) - setRenderError(false); - }) - .catch(error => { - setRenderError(true); - alert("로그인을 먼저 해주세요"); - navigation('/'); - }); + axios + .get('http://localhost:8080/direct-message', { + withCredentials: true, + }) + .then((response) => { + setDMList(response.data.room_id); + setRenderError(false); + }) + .catch((error) => { + setRenderError(true); + alert('로그인을 먼저 해주세요'); + navigation('/'); + }); return () => { dispatch({ type: SELECTED_DM, payload: null, - }) - } - }, []) + }); + }; + }, []); const DMListClick = (selectedRoom, e) => { dispatch({ type: SELECTED_DM, payload: selectedRoom.chat_room_id, - }) + }); setSelectedRoomId(selectedRoom); - } + }; - return( - <> - {!renderError ? + return ( <> -
-
- -
-
- { - selectedRoomId !== null ? : null - } -
- -
- - : null} + {!renderError ? ( + <> +
+
+ +
+
+ {selectedRoomId !== null ? ( + + ) : null} +
+
+ + ) : null} - - ); -} +}; -export default DMPage; \ No newline at end of file +export default DMPage; diff --git a/frontend/sweet-red-beans/src/components/EventPage/EventDetailPage.js b/frontend/sweet-red-beans/src/components/EventPage/EventDetailPage.js index 8c1829e..8fbb652 100644 --- a/frontend/sweet-red-beans/src/components/EventPage/EventDetailPage.js +++ b/frontend/sweet-red-beans/src/components/EventPage/EventDetailPage.js @@ -1,114 +1,132 @@ -import React, {useState, useEffect} from "react"; -import { useParams } from "react-router"; -import { useDispatch, useSelector } from "react-redux"; -import events from "../../actions/event_action"; -import axios from "axios"; -import style from "../../css/EventPage/EventDetailPage.module.css"; +import React, { useState, useEffect } from 'react'; +import { useParams } from 'react-router'; +import { useDispatch, useSelector } from 'react-redux'; +import events from '../../actions/event_action'; +import axios from 'axios'; +import style from '../../css/EventPage/EventDetailPage.module.css'; const EventDetailPage = () => { - const {id} = useParams(); + const { id } = useParams(); const [thisEvent, setThisEvent] = useState(null); const [thisEventIsHere, setThisEventIsHere] = useState(false); - const [title, setTitle] = useState(""); - const [cinemaName, setCinemaName] = useState(""); + const [title, setTitle] = useState(''); + const [cinemaName, setCinemaName] = useState(''); const [imageUrl, setImageUrl] = useState([]); - const [linkUrl, setLinkUrl] = useState(""); - const [startDate, setStartDate] = useState(""); - const [endDate, setEndDate] = useState(""); + const [linkUrl, setLinkUrl] = useState(''); + const [startDate, setStartDate] = useState(''); + const [endDate, setEndDate] = useState(''); const [likeCount, setLikeCount] = useState(0); //좋아요 상태 변경용 const [status, setStatus] = useState(false); - - - useEffect(()=>{ - axios.get('http://localhost:8080/events/detail', { - withCredentials: true, - params: { - event_id: id, - } - }) - .then(response => { - setThisEvent(response.data); - setStatus(response.data.is_like); - setTitle(response.data.title); - setCinemaName(response.data.cinema_name); - setImageUrl(response.data.detail_image_url); - setLinkUrl(response.data.link_url); - setStartDate(response.data.start_date); - setEndDate(response.data.end_date); - setLikeCount(response.data.like_count); - console.log(response.data); - }) - .catch(error => console.log(error)); - - }, []) + useEffect(() => { + axios + .get('http://localhost:8080/events/detail', { + withCredentials: true, + params: { + event_id: id, + }, + }) + .then((response) => { + setThisEvent(response.data); + setStatus(response.data.is_like); + setTitle(response.data.title); + setCinemaName(response.data.cinema_name); + setImageUrl(response.data.detail_image_url); + setLinkUrl(response.data.link_url); + setStartDate(response.data.start_date); + setEndDate(response.data.end_date); + setLikeCount(response.data.like_count); + console.log(response.data); + }) + .catch((error) => console.log(error)); + }, []); const likeClick = () => { const body = { event_id: thisEvent.event_id, - } - axios.post('http://localhost:8080/events/like', body, { withCredentials: true }) - .then(response => { - console.log(response.data); - if(response.data.result){ - if(status){ - setStatus(false); - setLikeCount(likeCount-1); + }; + axios + .post('http://localhost:8080/events/like', body, { + withCredentials: true, + }) + .then((response) => { + console.log(response.data); + if (response.data.result) { + if (status) { + setStatus(false); + setLikeCount(likeCount - 1); + } else { + setStatus(true); + setLikeCount(likeCount + 1); + } + } else { + alert('좋아요에 실패했습니다.'); } - else { - setStatus(true); - setLikeCount(likeCount+1); + }) + .catch((error) => { + if (error.response.status === 401) { + alert('로그인을 먼저 해주세요'); } - } - else { - alert("좋아요에 실패했습니다.") - } - }) - .catch(error => { - if(error.response.status === 401){ - alert("로그인을 먼저 해주세요"); - } - }); - } + }); + }; - useEffect(()=>{ - console.log(thisEvent) + useEffect(() => { + console.log(thisEvent); setThisEventIsHere(true); - }, [thisEvent]) + }, [thisEvent]); return ( <> - {thisEventIsHere ? -
-
-
{title}
-
{startDate} ~ {endDate}
-
-
-
{cinemaName}
-
-
{status? : }
-
{likeCount}
+ {thisEventIsHere ? ( +
+
+
{title}
+
+ {startDate} ~ {endDate} +
+
+
+
{cinemaName}
+
+
+ {status ? ( + + ) : ( + + )} +
+
{likeCount}
+
+
+ +
+ {imageUrl.map((item, index) => ( + + ))} +
+
+ +
-
- -
- { - imageUrl.map((item, index) => ) - } -
-
- -
-
- : null} - + ) : null} ); -} +}; -export default EventDetailPage; \ No newline at end of file +export default EventDetailPage; diff --git a/frontend/sweet-red-beans/src/components/EventPage/EventMovieThumbnail.js b/frontend/sweet-red-beans/src/components/EventPage/EventMovieThumbnail.js index 34aff24..b2c8e1c 100644 --- a/frontend/sweet-red-beans/src/components/EventPage/EventMovieThumbnail.js +++ b/frontend/sweet-red-beans/src/components/EventPage/EventMovieThumbnail.js @@ -1,58 +1,74 @@ -import React, {useState, useEffect} from "react"; -import {Link} from "react-router-dom"; -import axios from "axios"; -import style from "../../css/EventPage/EventMovieThumbnail.module.css"; +import React, { useState, useEffect } from 'react'; +import { Link } from 'react-router-dom'; +import axios from 'axios'; +import style from '../../css/EventPage/EventMovieThumbnail.module.css'; -const EventMovieThumbnail = ({event}) => { +const EventMovieThumbnail = ({ event }) => { //좋아요 상태 변경용 const [status, setStatus] = useState(event.is_like); const likeClick = () => { const body = { event_id: event.event_id, - } - axios.post('http://localhost:8080/events/like', body, { withCredentials: true }) - .then(response => { - console.log(response.data); - if(response.data.result){ - if(status){ - setStatus(false); + }; + axios + .post('http://localhost:8080/events/like', body, { + withCredentials: true, + }) + .then((response) => { + console.log(response.data); + if (response.data.result) { + if (status) { + setStatus(false); + } else { + setStatus(true); + } + } else { + alert('좋아요에 실패했습니다.'); } - else { - setStatus(true); + }) + .catch((error) => { + if (error.response.status === 401) { + alert('로그인을 먼저 해주세요'); } - } - else { - alert("좋아요에 실패했습니다."); - } - }) - .catch(error => { - if(error.response.status === 401){ - alert("로그인을 먼저 해주세요"); - } - }); - } + }); + }; useEffect(() => { - if(status === undefined) { + if (status === undefined) { setStatus(true); } - }, [status]) + }, [status]); - return( + return ( <> -
- - -
{event.title}
-
{event.start_date} ~ {event.end_date}
- +
+ + +
{event.title}
+
+ {event.start_date} ~ {event.end_date} +
+ - {status? : } -
- + {status ? ( + + ) : ( + + )} +
); -} +}; -export default EventMovieThumbnail; \ No newline at end of file +export default EventMovieThumbnail; diff --git a/frontend/sweet-red-beans/src/components/EventPage/EventPage.js b/frontend/sweet-red-beans/src/components/EventPage/EventPage.js index a8055af..28a0595 100644 --- a/frontend/sweet-red-beans/src/components/EventPage/EventPage.js +++ b/frontend/sweet-red-beans/src/components/EventPage/EventPage.js @@ -1,153 +1,189 @@ -import React, {useCallback, useEffect, useState, useMemo} from "react"; -import { Routes, Route } from "react-router"; -import { Link } from "react-router-dom"; -import EventDetailPage from "./EventDetailPage"; -import { useNavigate } from "react-router"; -import Events from "./Events"; -import { useDispatch, useSelector, shallowEqual } from "react-redux"; -import events from "../../actions/event_action"; -import { EVENT_ISEND, EVENT_SORT, EVENTS } from "../../actions/types"; -import axios from "axios"; -import style from "../../css/EventPage/EventPage.module.css"; +import React, { useCallback, useEffect, useState, useMemo } from 'react'; +import { Routes, Route } from 'react-router'; +import { Link } from 'react-router-dom'; +import EventDetailPage from './EventDetailPage'; +import { useNavigate } from 'react-router'; +import Events from './Events'; +import { useDispatch, useSelector, shallowEqual } from 'react-redux'; +import events from '../../actions/event_action'; +import { EVENT_ISEND, EVENT_SORT, EVENTS } from '../../actions/types'; +import axios from 'axios'; +import style from '../../css/EventPage/EventPage.module.css'; const EventPage = () => { - let navigation = useNavigate(); const dispatch = useDispatch(); - const [events, setEvents] = useState([]); + const [events, setEvents] = useState([]); const [eventIsHere, setEventIsHere] = useState(false); //검색 단어, 처음에 없음 - const [search, setSearch] = useState(""); + const [search, setSearch] = useState(''); //검색했던 단어들 저장 const [searchWords, setSearchWords] = useState([]); //진행중이면 false const [isEnd, setIsEnd] = useState(false); - const selectList = ["전체", "CGV", "롯데시네마", "메가박스", "씨네큐"]; + const selectList = ['전체', 'CGV', '롯데시네마', '메가박스', '씨네큐']; //선택된 시네마 이름, 처음엔 영화관 - const [selected, setSelected] = useState("전체"); + const [selected, setSelected] = useState('전체'); //선택했던 시네마 이름들 저장 const [selecteds, setSelecteds] = useState([]); //최신순(recent) or 관심도순(interest) - const [sort, setSort] = useState("최신순"); + const [sort, setSort] = useState('최신순'); //검색 const searchChange = (e) => { setSearch(e.target.value); - } - + }; + //검색 버튼 눌렀을 때 다시 서버 요청 const searchClick = () => { setSearchWords([...searchWords, search]); setSelecteds([...selecteds, selected]); - } + }; //진행 중 클릭했을 때 다시 서버 요청 const ongoingClick = () => { setIsEnd(false); dispatch({ - type:EVENT_ISEND, + type: EVENT_ISEND, payload: false, - }) - } + }); + }; //진행 완료 클릭했을 때 다시 서버 요청 const doneClick = () => { setIsEnd(true); dispatch({ - type:EVENT_ISEND, + type: EVENT_ISEND, payload: true, - }) - } + }); + }; //최신순 클릭했을 때 다시 서버 요청 const recentClick = () => { - setSort("최신순"); + setSort('최신순'); dispatch({ - type:EVENT_SORT, - payload:"최신순", - }) - } + type: EVENT_SORT, + payload: '최신순', + }); + }; //관심도순 클릭했을 때 다시 서버 요청 - const interestClick = () =>{ - setSort("관심도순"); + const interestClick = () => { + setSort('관심도순'); dispatch({ - type:EVENT_SORT, - payload:"관심도순", - }) - } + type: EVENT_SORT, + payload: '관심도순', + }); + }; //영화관 필터 바뀌었을 때 const selectChange = (e) => { setSelected(e.target.value); - } - + }; - useEffect(()=>{ + useEffect(() => { // //처음에 기본으로 진행 중인 이벤트로 보여줌 // dispatch({ // type:EVENT_ISEND, // payload:false, // }) - // //처음에 기본으로 최신순으로 보여줌 // dispatch({ // type:EVENT_SORT, // payload:sort, // }) + }, []); - - }, []) - - useEffect(()=> { + useEffect(() => { // dispatch({ // type:EVENTS, // events:events, // }); - setEventIsHere(true) - },[events]) + setEventIsHere(true); + }, [events]); - return( + return ( <> -
-
-
- - -
-
- - +
+
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+ +
-
- - -
- -
- -
- -
+ { + + }
- - - - { - - } - -
- - ); -} +}; -export default EventPage; \ No newline at end of file +export default EventPage; diff --git a/frontend/sweet-red-beans/src/components/EventPage/Events.js b/frontend/sweet-red-beans/src/components/EventPage/Events.js index 665b85d..de735b6 100644 --- a/frontend/sweet-red-beans/src/components/EventPage/Events.js +++ b/frontend/sweet-red-beans/src/components/EventPage/Events.js @@ -1,87 +1,89 @@ -import React, {useState, useEffect} from "react"; -import { Routes, Route } from "react-router"; -import { Link } from "react-router-dom"; -import EventDetailPage from "./EventDetailPage"; -import { useNavigate } from "react-router"; -import EventPage from "./EventPage"; -import EventMovieThumbnail from "./EventMovieThumbnail"; -import { useSelector } from "react-redux"; -import axios from "axios"; -import style from "../../css/EventPage/Events.module.css"; -import Pagination from "../Pagination/Pagination"; +import React, { useState, useEffect } from 'react'; +import { Routes, Route } from 'react-router'; +import { Link } from 'react-router-dom'; +import EventDetailPage from './EventDetailPage'; +import { useNavigate } from 'react-router'; +import EventPage from './EventPage'; +import EventMovieThumbnail from './EventMovieThumbnail'; +import { useSelector } from 'react-redux'; +import axios from 'axios'; +import style from '../../css/EventPage/Events.module.css'; +import Pagination from '../Pagination/Pagination'; -const Events = ({sort, isEnd, search_word, cinema_name}) => { +const Events = ({ sort, isEnd, search_word, cinema_name }) => { const [limit, setLimit] = useState(12); const [page, setPage] = useState(1); const offset = (page - 1) * limit; - const [events, setEvents] = useState([]); - useEffect(()=> { - const body = - { + const [events, setEvents] = useState([]); + useEffect(() => { + const body = { withCredentials: true, - params:{ + params: { sort_criteria: sort, is_end: isEnd, - } - } - - //처음에 진행 중, 최신순으로 요청 - axios.get('http://localhost:8080/events/search',body) - .then(response => setEvents(response.data)) - .catch(error => console.log(error)); - + }, + }; - },[]) + //처음에 진행 중, 최신순으로 요청 + axios + .get('http://localhost:8080/events/search', body) + .then((response) => setEvents(response.data)) + .catch((error) => console.log(error)); + }, []); - useEffect(()=> { - console.log("!!!!!!!!!!!!!!!!!!"); - let body = {} - if(cinema_name[cinema_name.length-1] === "전체"){ + useEffect(() => { + console.log('!!!!!!!!!!!!!!!!!!'); + let body = {}; + if (cinema_name[cinema_name.length - 1] === '전체') { body = { withCredentials: true, params: { sort_criteria: sort, is_end: isEnd, - search_word: search_word[search_word.length-1], - } - } + search_word: search_word[search_word.length - 1], + }, + }; } else { body = { withCredentials: true, params: { - cinema_name: cinema_name[cinema_name.length-1], + cinema_name: cinema_name[cinema_name.length - 1], sort_criteria: sort, is_end: isEnd, - search_word: search_word[search_word.length-1], - } - } + search_word: search_word[search_word.length - 1], + }, + }; } - axios.get('http://localhost:8080/events/search',body) - .then(response => { - setEvents(response.data) - console.log(response.data); - }) - .catch(error => console.log(error)); - - },[sort, isEnd, search_word, cinema_name]) - + axios + .get('http://localhost:8080/events/search', body) + .then((response) => { + setEvents(response.data); + console.log(response.data); + }) + .catch((error) => console.log(error)); + }, [sort, isEnd, search_word, cinema_name]); - return( + return ( <> -
- {events.slice(offset, offset+limit).map((item) =>
)} -
+
+ {events.slice(offset, offset + limit).map((item) => ( +
+ +
+ ))} +
-
- -
- +
+ +
); -} +}; -export default Events; \ No newline at end of file +export default Events; diff --git a/frontend/sweet-red-beans/src/components/Footer/Footer.js b/frontend/sweet-red-beans/src/components/Footer/Footer.js index 26000a7..fc5c3dd 100644 --- a/frontend/sweet-red-beans/src/components/Footer/Footer.js +++ b/frontend/sweet-red-beans/src/components/Footer/Footer.js @@ -1,57 +1,54 @@ -import React, { useCallback, useEffect, useRef, useState } from "react"; -import style from "../../css/Footer/Footer.module.css"; -import { ReactComponent as Github } from "../../img/github.svg"; -import { ReactComponent as Mail} from "../../img/maildotru.svg"; -import { SWEET_RED_BEANS_GITHUB, MEMBER_GITHUB, EMAIL } from "../../url/url"; +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import style from '../../css/Footer/Footer.module.css'; +import { ReactComponent as Github } from '../../img/github.svg'; +import { ReactComponent as Mail } from '../../img/maildotru.svg'; +import { SWEET_RED_BEANS_GITHUB, MEMBER_GITHUB, EMAIL } from '../../url/url'; const Footer = () => { - const members = ["김민지", "이다은", "이지영", "조현정"]; + const members = ['김민지', '이다은', '이지영', '조현정']; const [copy, setCopy] = useState(false); const [notCopy, setNotCopy] = useState(false); - const githubClick = useCallback(() => { window.open(SWEET_RED_BEANS_GITHUB); - } - ) + }); useEffect(() => { console.log(copy); - }, [copy]) + }, [copy]); const mailClick = useCallback(() => { - //email.classList.toggle("active") // setTimeout(() => {addClass()} ,200) setCopy(true); setTimeout(() => { setCopy(false); - }, 2000) - + }, 2000); + if (navigator.clipboard) { // (IE는 사용 못하고, 크롬은 66버전 이상일때 사용 가능합니다.) navigator.clipboard - .writeText(EMAIL) - .then(() => { - console.log("클립보드에 복사되었습니다."); - }) - .catch(() => { - setNotCopy(true); - }); - } else { + .writeText(EMAIL) + .then(() => { + console.log('클립보드에 복사되었습니다.'); + }) + .catch(() => { + setNotCopy(true); + }); + } else { // 흐름 2. - if (!document.queryCommandSupported("copy")) { - setNotCopy(true) + if (!document.queryCommandSupported('copy')) { + setNotCopy(true); } - + // 흐름 3. - const textarea = document.createElement("textarea"); + const textarea = document.createElement('textarea'); textarea.value = EMAIL; textarea.style.top = 0; textarea.style.left = 0; - textarea.style.position = "fixed"; - + textarea.style.position = 'fixed'; + // 흐름 4. document.body.appendChild(textarea); // focus() -> 사파리 브라우저 서포팅 @@ -59,44 +56,55 @@ const Footer = () => { // select() -> 사용자가 입력한 내용을 영역을 설정할 때 필요 textarea.select(); // 흐름 5. - document.execCommand("copy"); + document.execCommand('copy'); // 흐름 6. document.body.removeChild(textarea); - console.log("클립보드에 복사되었습니다.2"); - } - }) + console.log('클립보드에 복사되었습니다.2'); + } + }); const memberClick = (index) => { window.open(MEMBER_GITHUB[index]); - } + }; return ( <> -
+
+
+ +
-
- -
-
- {EMAIL} -
- {notCopy ? "복사 실패!" : "복사!"} +
+
+ {EMAIL} +
{notCopy ? '복사 실패!' : '복사!'}
+
+
+
- -
-
-
-
-
스윗레드빈즈
+
스윗레드빈즈
-
- {members.map((member, index) => )} -
-
+
+ {members.map((member, index) => ( + + ))} +
+
); -} +}; -export default Footer \ No newline at end of file +export default Footer; diff --git a/frontend/sweet-red-beans/src/components/InformationShares/InformationShareDetailPage.js b/frontend/sweet-red-beans/src/components/InformationShares/InformationShareDetailPage.js index 4c2c8ae..b89b419 100644 --- a/frontend/sweet-red-beans/src/components/InformationShares/InformationShareDetailPage.js +++ b/frontend/sweet-red-beans/src/components/InformationShares/InformationShareDetailPage.js @@ -1,174 +1,197 @@ -import React, {useEffect, useMemo, useState}from "react"; -import { Link, unstable_HistoryRouter } from "react-router-dom"; -import Comment from "../Comment/Comment"; -import { useParams } from "react-router"; -import { useSelector } from "react-redux"; -import axios from "axios"; -import { useNavigate } from "react-router"; -import style from "../../css/InformationSharePage/InformationShareDetailPage.module.css"; -import { parseDate } from "../../parseDate/parseDate"; +import React, { useEffect, useMemo, useState } from 'react'; +import { Link, unstable_HistoryRouter } from 'react-router-dom'; +import Comment from '../Comment/Comment'; +import { useParams } from 'react-router'; +import { useSelector } from 'react-redux'; +import axios from 'axios'; +import { useNavigate } from 'react-router'; +import style from '../../css/InformationSharePage/InformationShareDetailPage.module.css'; +import { parseDate } from '../../parseDate/parseDate'; const InformationShareDetailPage = () => { - let navigation = useNavigate(); - const {postid} = useParams(); + const { postid } = useParams(); //const userid = useSelector(state => state.user.user_id); const [detailInfo, setDetailInfo] = useState({}); const [comments, setComments] = useState([]); const [commentsIsHere, setCommentsIsHere] = useState(false); - const[commentContent, setCommentContent] = useState(""); + const [commentContent, setCommentContent] = useState(''); //처음 조회 - useEffect(()=>{ + useEffect(() => { document.documentElement.scrollTop = 0; - axios.get('http://localhost:8080/information-share/detail',{ - withCredentials: true, - params: { - post_id : postid, - user_id : "1", - } - }) - .then(response => { - setDetailInfo(response.data); - setComments(response.data.comment) - }) - .catch(error => console.log(error)); - - },[]) + axios + .get('http://localhost:8080/information-share/detail', { + withCredentials: true, + params: { + post_id: postid, + user_id: '1', + }, + }) + .then((response) => { + setDetailInfo(response.data); + setComments(response.data.comment); + }) + .catch((error) => console.log(error)); + }, []); - useEffect(()=>{ + useEffect(() => { setCommentsIsHere(true); - }, [comments]) + }, [comments]); const useConfirm = (message = null, onConfirm, onCancel) => { - if (!onConfirm || typeof onConfirm !== "function") { + if (!onConfirm || typeof onConfirm !== 'function') { return; } - if (onCancel && typeof onCancel !== "function") { + if (onCancel && typeof onCancel !== 'function') { return; } - + const confirmAction = () => { if (window.confirm(message)) { - onConfirm(); + onConfirm(); } else { - onCancel(); + onCancel(); } }; - + return confirmAction; }; //삭제버튼 눌렀을 때 const deleteConfirm = () => { - axios.delete('http://localhost:8080/information-share/detail',{ - withCredentials: true, - data: { - post_id : postid, - user_id : "1", + axios + .delete('http://localhost:8080/information-share/detail', { + withCredentials: true, + data: { + post_id: postid, + user_id: '1', + }, + }) + .then((response) => { + if (response.data.result) { + alert('삭제되었습니다.'); + //이전 페이지로 이동 + navigation(-1); + } else { + alert('삭제에 실패했습니다.'); } - }) - .then(response => { - if(response.data.result){ - alert("삭제되었습니다.") - //이전 페이지로 이동 - navigation(-1) - } - else { - alert("삭제에 실패했습니다.") - } - }) - .catch(error => console.log(error)); - - } + }) + .catch((error) => console.log(error)); + }; - const cancelConfirm = () => console.log("삭제 취소") + const cancelConfirm = () => console.log('삭제 취소'); const deleteClick = useConfirm( - "삭제하시겠습니까?", + '삭제하시겠습니까?', deleteConfirm, cancelConfirm ); const commentContentChange = (e) => { setCommentContent(e.target.value); - } + }; //댓글쓰기 버튼 눌렀을 때 const commentAddClick = () => { - if(commentContent !== "") { - setCommentContent(""); + if (commentContent !== '') { + setCommentContent(''); const body = { - user_id: "1", + user_id: '1', content: commentContent, post_id: postid, - } - - axios.post('http://localhost:8080/information-share/comment', body, { withCredentials: true }) - .then(response => { - if(response.data.result){ - console.log("댓글 작성됨"); - navigation(0) - } - else{ - alert("댓글 작성에 실패했습니다."); - } - }) - .catch(error => { - if(error.response.status === 401){ - alert("로그인을 먼저 해주세요"); - } - }); + }; + + axios + .post('http://localhost:8080/information-share/comment', body, { + withCredentials: true, + }) + .then((response) => { + if (response.data.result) { + console.log('댓글 작성됨'); + navigation(0); + } else { + alert('댓글 작성에 실패했습니다.'); + } + }) + .catch((error) => { + if (error.response.status === 401) { + alert('로그인을 먼저 해주세요'); + } + }); } - } + }; - return( + return ( <> -
-
-
-
{detailInfo.title}
-
{detailInfo.cinema_name} > {detailInfo.cinema_area} > {detailInfo.cinema_branch}
-
+
+
+
+
{detailInfo.title}
+
+ {detailInfo.cinema_name} >{' '} + {detailInfo.cinema_area} >{' '} + {detailInfo.cinema_branch} +
+
-
-
{detailInfo.user_status === "정지" || detailInfo.user_status === "탈퇴" ? "(알수없음)" : detailInfo.nickname}
-
{parseDate(detailInfo.written_date)}
-
{detailInfo.views}
-
+
+
+ {detailInfo.user_status === '정지' || + detailInfo.user_status === '탈퇴' + ? '(알수없음)' + : detailInfo.nickname} +
+
{parseDate(detailInfo.written_date)}
+
{detailInfo.views}
+
-
-
{detailInfo.image_url !== "" ? : null}
-
{detailInfo.content}
-
- {detailInfo.is_mine ? : null} +
+
+ {detailInfo.image_url !== '' ? ( + + ) : null} +
+
{detailInfo.content}
+
+ {detailInfo.is_mine ? ( + + ) : null} +
-
- -
-
댓글
- - {commentsIsHere ? ( - comments.map((item, index) =>
) - ) : null} -
- - + +
+
댓글
+ + {commentsIsHere + ? comments.map((item, index) => ( +
+ +
+ )) + : null} +
+ + +
- +
+ +
+ + +
- -
- - - -
-
); -} +}; -export default InformationShareDetailPage; \ No newline at end of file +export default InformationShareDetailPage; diff --git a/frontend/sweet-red-beans/src/components/InformationShares/InformationSharePage.js b/frontend/sweet-red-beans/src/components/InformationShares/InformationSharePage.js index 931e845..341e1d5 100644 --- a/frontend/sweet-red-beans/src/components/InformationShares/InformationSharePage.js +++ b/frontend/sweet-red-beans/src/components/InformationShares/InformationSharePage.js @@ -1,197 +1,245 @@ -import React, { useEffect, useState, useMemo, useCallback } from "react"; -import { useSelector, useDispatch } from "react-redux"; -import { CGVarea, CGV0, CGV1, CGV2, CGV3, CGV4, CGV5, CGV6, CGV7, CGV8 } from "../../cinemas/CGVcinemas"; -import { LCarea, LC0, LC1, LC2, LC3, LC4, LC5, LC6, LC7 } from "../../cinemas/LCcinemas"; -import { MBarea, MB0, MB1, MB2, MB3, MB4, MB5, MB6 } from "../../cinemas/MBcinemas"; -import { CQarea, CQ0, CQ1, CQ2, CQ3, CQ4 } from "../../cinemas/CQcinemas"; -import InformationShares from "./InformationShares"; -import { Link } from "react-router-dom"; -import { INFO } from "../../actions/types"; -import axios from "axios"; -import style from "../../css/InformationSharePage/InformationSharePage.module.css"; +import React, { useEffect, useState, useMemo, useCallback } from 'react'; +import { useSelector, useDispatch } from 'react-redux'; +import { + CGVarea, + CGV0, + CGV1, + CGV2, + CGV3, + CGV4, + CGV5, + CGV6, + CGV7, + CGV8, +} from '../../cinemas/CGVcinemas'; +import { + LCarea, + LC0, + LC1, + LC2, + LC3, + LC4, + LC5, + LC6, + LC7, +} from '../../cinemas/LCcinemas'; +import { + MBarea, + MB0, + MB1, + MB2, + MB3, + MB4, + MB5, + MB6, +} from '../../cinemas/MBcinemas'; +import { CQarea, CQ0, CQ1, CQ2, CQ3, CQ4 } from '../../cinemas/CQcinemas'; +import InformationShares from './InformationShares'; +import { Link } from 'react-router-dom'; +import { INFO } from '../../actions/types'; +import axios from 'axios'; +import style from '../../css/InformationSharePage/InformationSharePage.module.css'; const InformationSharePage = () => { const dispatch = useDispatch(); - const cinemaNames = ["전체", "CGV", "롯데시네마", "메가박스", "씨네큐"]; + const cinemaNames = ['전체', 'CGV', '롯데시네마', '메가박스', '씨네큐']; const CGVarray = [CGV0, CGV1, CGV2, CGV3, CGV4, CGV5, CGV6, CGV7, CGV8]; const LCarray = [LC0, LC1, LC2, LC3, LC4, LC5, LC6, LC7]; const MBarray = [MB0, MB1, MB2, MB3, MB4, MB5, MB6]; const CQarray = [CQ0, CQ1, CQ2, CQ3, CQ4]; //필터에서 선택한 영화사, 지역, 지점 이름 - const [cinemaName, setCinemaName] = useState("전체"); - const [cinemaArea, setCinemaArea] = useState("지역"); - const [cinemaBranch, setCinemaBranch] = useState("지점"); + const [cinemaName, setCinemaName] = useState('전체'); + const [cinemaArea, setCinemaArea] = useState('지역'); + const [cinemaBranch, setCinemaBranch] = useState('지점'); //필터에서 선택하면 true로 바뀜 const [cinemaNameSelected, setCinemaNameSelected] = useState(false); const [cinemaAreaSelected, setCinemaAreaSelected] = useState(false); - const [cinemaBranchSelected, setCinemaBranchSelected] = useState(false); + const [cinemaBranchSelected, setCinemaBranchSelected] = useState(false); //보여줄 array const [cinemaAreas, setCinemaAreas] = useState([]); const [array, setArray] = useState([]); const [cinemaBranches, setCinemaBranches] = useState([]); //이제까지 검색한 것 const [searchWords, setSearchWords] = useState([]); - + //search - const [search, setSearch] = useState(""); + const [search, setSearch] = useState(''); - const sorts = ["제목+내용", "제목", "내용", "작성자"]; - const [sort, setSort] = useState("제목+내용"); + const sorts = ['제목+내용', '제목', '내용', '작성자']; + const [sort, setSort] = useState('제목+내용'); useEffect(() => { document.documentElement.scrollTop = 0; - }, []) + }, []); //영화관을 선택했을 때 const cinemaNameChange = (e) => { - if(e.target.value === "전체"){ - setCinemaName("전체"); - setCinemaArea("지역") - setCinemaBranch("지점") + if (e.target.value === '전체') { + setCinemaName('전체'); + setCinemaArea('지역'); + setCinemaBranch('지점'); setCinemaNameSelected(false); setCinemaAreaSelected(false); setCinemaBranchSelected(false); - } - else { + } else { const selected = e.target.value; setCinemaName(selected); - if(selected === "CGV"){ + if (selected === 'CGV') { setCinemaAreas(CGVarea); setCinemaAreaSelected(false); - setCinemaArea("지역") - setCinemaBranch("지점") + setCinemaArea('지역'); + setCinemaBranch('지점'); setArray(CGVarray); - } else if (selected === "롯데시네마"){ + } else if (selected === '롯데시네마') { setCinemaAreas(LCarea); setCinemaAreaSelected(false); - setCinemaArea("지역") - setCinemaBranch("지점") + setCinemaArea('지역'); + setCinemaBranch('지점'); setArray(LCarray); - } else if (selected === "메가박스"){ + } else if (selected === '메가박스') { setCinemaAreas(MBarea); setCinemaAreaSelected(false); - setCinemaBranch("지점") - setCinemaArea("지역") + setCinemaBranch('지점'); + setCinemaArea('지역'); setArray(MBarray); - } else if (selected === "씨네큐"){ + } else if (selected === '씨네큐') { setCinemaAreas(CQarea); setCinemaAreaSelected(false); - setCinemaArea("지역") - setCinemaBranch("지점") + setCinemaArea('지역'); + setCinemaBranch('지점'); setArray(CQarray); } setCinemaNameSelected(true); } - } + }; //지역을 선택했을 때 const cinemaAreaChange = (e) => { - if(e.target.value === "지역"){ - setCinemaArea("지역") - setCinemaBranch("지점") + if (e.target.value === '지역') { + setCinemaArea('지역'); + setCinemaBranch('지점'); setCinemaAreaSelected(false); setCinemaBranchSelected(false); - } - else { + } else { setCinemaArea(e.target.value); - setCinemaBranch("지점") + setCinemaBranch('지점'); setCinemaAreaSelected(true); //선택한 지역에 따라 해당 지역에 있는 지점들 리스트로 지정해줌 - setCinemaBranches(array[cinemaAreas.indexOf(e.target.value)-1]); + setCinemaBranches(array[cinemaAreas.indexOf(e.target.value) - 1]); } - } + }; //지점 선택했을 때 const cinemaBranchChange = (e) => { - if(e.target.value === "지점"){ - setCinemaBranch("지점") - } - else { + if (e.target.value === '지점') { + setCinemaBranch('지점'); + } else { setCinemaBranch(e.target.value); setCinemaBranchSelected(true); } - } + }; const sortChange = (e) => { setSort(e.target.value); - } + }; - const searchChange = useCallback((e) => { - setSearch(e.target.value); - },[search]); + const searchChange = useCallback( + (e) => { + setSearch(e.target.value); + }, + [search] + ); //검색 버튼 클릭했을 때 const searchClick = () => { setSearchWords([...searchWords, search]); - } + }; - return( + return ( <> -
-
-
- - -
- - { - cinemaNameSelected ? +
+
- +
- : null - } - { - cinemaAreaSelected ? + {cinemaNameSelected ? ( +
+ + +
+ ) : null} + + {cinemaAreaSelected ? ( +
+ + +
+ ) : null} +
- + {sorts.map((item) => ( + + ))}
- : null - } - -
- - -
-
- -
- +
+ +
+ +
+
- - -
- ); -} +}; -export default InformationSharePage; \ No newline at end of file +export default InformationSharePage; diff --git a/frontend/sweet-red-beans/src/components/InformationShares/InformationShareWritePage.js b/frontend/sweet-red-beans/src/components/InformationShares/InformationShareWritePage.js index 8749770..5c0c8df 100644 --- a/frontend/sweet-red-beans/src/components/InformationShares/InformationShareWritePage.js +++ b/frontend/sweet-red-beans/src/components/InformationShares/InformationShareWritePage.js @@ -1,39 +1,69 @@ -import React, { useEffect, useState } from "react"; -import { CGVarea, CGV0, CGV1, CGV2, CGV3, CGV4, CGV5, CGV6, CGV7, CGV8 } from "../../cinemas/CGVcinemas"; -import { LCarea, LC0, LC1, LC2, LC3, LC4, LC5, LC6, LC7 } from "../../cinemas/LCcinemas"; -import { MBarea, MB0, MB1, MB2, MB3, MB4, MB5, MB6 } from "../../cinemas/MBcinemas"; -import { CQarea, CQ0, CQ1, CQ2, CQ3, CQ4 } from "../../cinemas/CQcinemas"; -import { Link } from "react-router-dom"; -import axios from "axios"; -import { useNavigate } from "react-router"; -import { useSelector } from "react-redux"; -import style from "../../css/InformationSharePage/InformationShareWritePage.module.css"; +import React, { useEffect, useState } from 'react'; +import { + CGVarea, + CGV0, + CGV1, + CGV2, + CGV3, + CGV4, + CGV5, + CGV6, + CGV7, + CGV8, +} from '../../cinemas/CGVcinemas'; +import { + LCarea, + LC0, + LC1, + LC2, + LC3, + LC4, + LC5, + LC6, + LC7, +} from '../../cinemas/LCcinemas'; +import { + MBarea, + MB0, + MB1, + MB2, + MB3, + MB4, + MB5, + MB6, +} from '../../cinemas/MBcinemas'; +import { CQarea, CQ0, CQ1, CQ2, CQ3, CQ4 } from '../../cinemas/CQcinemas'; +import { Link } from 'react-router-dom'; +import axios from 'axios'; +import { useNavigate } from 'react-router'; +import { useSelector } from 'react-redux'; +import style from '../../css/InformationSharePage/InformationShareWritePage.module.css'; const InformationShareWritePage = () => { let navigation = useNavigate(); //사용자가 작성한 글 서버에 넘기기 - console.log("정보공유 작성 페이지 렌더"); - const cinemaNames = ["영화관", "CGV", "롯데시네마", "메가박스", "씨네큐"]; + console.log('정보공유 작성 페이지 렌더'); + const cinemaNames = ['영화관', 'CGV', '롯데시네마', '메가박스', '씨네큐']; const CGVarray = [CGV0, CGV1, CGV2, CGV3, CGV4, CGV5, CGV6, CGV7, CGV8]; const LCarray = [LC0, LC1, LC2, LC3, LC4, LC5, LC6, LC7]; const MBarray = [MB0, MB1, MB2, MB3, MB4, MB5, MB6]; const CQarray = [CQ0, CQ1, CQ2, CQ3, CQ4]; //필터에서 선택한 영화사, 지역, 지점 이름 - const [cinemaName, setCinemaName] = useState("영화관"); - const [cinemaArea, setCinemaArea] = useState("지역"); - const [cinemaBranch, setCinemaBranch] = useState("지점"); + const [cinemaName, setCinemaName] = useState('영화관'); + const [cinemaArea, setCinemaArea] = useState('지역'); + const [cinemaBranch, setCinemaBranch] = useState('지점'); //필터에서 선택하면 true로 바뀜 const [cinemaNameSelected, setCinemaNameSelected] = useState(false); const [cinemaAreaSelected, setCinemaAreaSelected] = useState(false); - const [cinemaBranchSelected, setCinemaBranchSelected] = useState(false); + const [cinemaBranchSelected, setCinemaBranchSelected] = useState(false); //보여줄 array const [cinemaAreas, setCinemaAreas] = useState([]); const [array, setArray] = useState([]); const [cinemaBranches, setCinemaBranches] = useState([]); - const [title, setTitle] = useState(""); - const [content, setContent] = useState(""); + const [title, setTitle] = useState(''); + const [content, setContent] = useState(''); //사진 첨부 const [imgFile, setImgFile] = useState(null); @@ -41,243 +71,264 @@ const InformationShareWritePage = () => { useEffect(() => { document.documentElement.scrollTop = 0; - }, []) + }, []); const cinemaNameChange = (e) => { - if(e.target.value === "영화관"){ + if (e.target.value === '영화관') { setCinemaNameSelected(false); setCinemaAreaSelected(false); setCinemaBranchSelected(false); - } - else { + } else { const selected = e.target.value; setCinemaName(selected); - if(selected === "CGV"){ + if (selected === 'CGV') { setCinemaAreas(CGVarea); setCinemaAreaSelected(false); setCinemaBranchSelected(false); - setCinemaArea("지역") - setCinemaBranch("지점") + setCinemaArea('지역'); + setCinemaBranch('지점'); setArray(CGVarray); - } else if (selected === "롯데시네마"){ + } else if (selected === '롯데시네마') { setCinemaAreas(LCarea); setCinemaAreaSelected(false); setCinemaBranchSelected(false); - setCinemaArea("지역") - setCinemaBranch("지점") + setCinemaArea('지역'); + setCinemaBranch('지점'); setArray(LCarray); - } else if (selected === "메가박스"){ + } else if (selected === '메가박스') { setCinemaAreas(MBarea); setCinemaAreaSelected(false); setCinemaBranchSelected(false); - setCinemaArea("지역") - setCinemaBranch("지점") + setCinemaArea('지역'); + setCinemaBranch('지점'); setArray(MBarray); - } else if (selected === "씨네큐"){ + } else if (selected === '씨네큐') { setCinemaAreas(CQarea); setCinemaAreaSelected(false); setCinemaBranchSelected(false); - setCinemaArea("지역") - setCinemaBranch("지점") + setCinemaArea('지역'); + setCinemaBranch('지점'); setArray(CQarray); } setCinemaNameSelected(true); } - } + }; const cinemaAreaChange = (e) => { - if(e.target.value === "지역"){ + if (e.target.value === '지역') { setCinemaAreaSelected(false); setCinemaBranchSelected(false); - setCinemaBranch("지점") - } - else { + setCinemaBranch('지점'); + } else { setCinemaArea(e.target.value); setCinemaBranchSelected(false); setCinemaAreaSelected(true); - setCinemaBranch("지점") - setCinemaBranches(array[cinemaAreas.indexOf(e.target.value)-1]); + setCinemaBranch('지점'); + setCinemaBranches(array[cinemaAreas.indexOf(e.target.value) - 1]); } - } + }; const cinemaBranchChange = (e) => { setCinemaBranch(e.target.value); setCinemaBranchSelected(true); - } + }; const contentChange = (e) => { // const a = content.replace("\n",
) // console.log(a); setContent(e.target.value); - } + }; //const userId = useSelector(state => state.user.user_id); //글쓰기 버튼 눌렀을 때 const writeClick = () => { - if (title === "" || content === ""){ - alert("내용을 입력해주세요."); - } - else if (cinemaName === "영화관" || cinemaArea === "지역" || cinemaBranch === "지점"){ - alert("지점까지 선택해주세요.") - } - else { + if (title === '' || content === '') { + alert('내용을 입력해주세요.'); + } else if ( + cinemaName === '영화관' || + cinemaArea === '지역' || + cinemaBranch === '지점' + ) { + alert('지점까지 선택해주세요.'); + } else { const fd = new FormData(); - - //이미지 파일 없을 때 - if(imgFile === null){ - fd.append("user_id", "1"); - fd.append("title", title); - fd.append("cinema_name", cinemaName); - fd.append("cinema_area", cinemaArea); - fd.append("cinema_branch", cinemaBranch); - fd.append("content", content); + if (imgFile === null) { + fd.append('user_id', '1'); + fd.append('title', title); + fd.append('cinema_name', cinemaName); + fd.append('cinema_area', cinemaArea); + fd.append('cinema_branch', cinemaBranch); + fd.append('content', content); - axios.post('http://localhost:8080/information-share/write', fd, { - withCredentials: true, - headers: { - "Content-Type": `multipart/form-data; `, - } - }) - .then(response => { - if(response.data.result) { - alert("게시글이 성공적으로 작성되었습니다."); - navigation('/informationShare'); - } - else { - alert("게시글 작성을 실패했습니다.") - } - }) - .catch(error => { - if(error.response.status === 401){ - alert("로그인을 먼저 해주세요"); - } - }); + axios + .post('http://localhost:8080/information-share/write', fd, { + withCredentials: true, + headers: { + 'Content-Type': `multipart/form-data; `, + }, + }) + .then((response) => { + if (response.data.result) { + alert('게시글이 성공적으로 작성되었습니다.'); + navigation('/informationShare'); + } else { + alert('게시글 작성을 실패했습니다.'); + } + }) + .catch((error) => { + if (error.response.status === 401) { + alert('로그인을 먼저 해주세요'); + } + }); } //이미지 파일 있을 때 else { - fd.append("image_url", imgFile[0]) - fd.append("user_id", "1"); - fd.append("title", title); - fd.append("cinema_name", cinemaName); - fd.append("cinema_area", cinemaArea); - fd.append("cinema_branch", cinemaBranch); - fd.append("content", content); + fd.append('image_url', imgFile[0]); + fd.append('user_id', '1'); + fd.append('title', title); + fd.append('cinema_name', cinemaName); + fd.append('cinema_area', cinemaArea); + fd.append('cinema_branch', cinemaBranch); + fd.append('content', content); - axios.post('http://localhost:8080/information-share/write', fd, { - withCredentials: true, - headers: { - "Content-Type": `multipart/form-data; `, - } - }) - .then(response => { - if(response.data.result) { - alert("게시글이 성공적으로 작성되었습니다."); - navigation('/informationShare'); - } - else { - alert("게시글 작성을 실패했습니다.") - } - }) - .catch(error => { - if(error.response.status === 401){ - alert("로그인을 먼저 해주세요"); - } - }); + axios + .post('http://localhost:8080/information-share/write', fd, { + withCredentials: true, + headers: { + 'Content-Type': `multipart/form-data; `, + }, + }) + .then((response) => { + if (response.data.result) { + alert('게시글이 성공적으로 작성되었습니다.'); + navigation('/informationShare'); + } else { + alert('게시글 작성을 실패했습니다.'); + } + }) + .catch((error) => { + if (error.response.status === 401) { + alert('로그인을 먼저 해주세요'); + } + }); } } - } + }; const titleChange = (e) => { setTitle(e.target.value); - } + }; const handleChangeFile = (e) => { - console.log(e.target.files) + console.log(e.target.files); setImgFile(e.target.files); - } + }; useEffect(() => { - if(!imgFile) return false; + if (!imgFile) return false; const reader = new FileReader(); reader.onloadend = () => { setImgBase64(reader.result); - } + }; reader.readAsDataURL(imgFile[0]); - - }, [imgFile]) + }, [imgFile]); const previewCancelClick = () => { setImgFile(null); setImgBase64(null); - } + }; - return( + return ( <> -
-
- -
-
- - -
- - { - cinemaNameSelected ? -
- - -
- : null - } - - { - cinemaAreaSelected ? +
+
+ +
- + {cinemaNames.map((item) => ( + + ))}
- : null - } + + {cinemaNameSelected ? ( +
+ + +
+ ) : null} + + {cinemaAreaSelected ? ( +
+ + +
+ ) : null} +
-
- -
- -
- - - - -
- -
- -
{nickname}
-
{transaction.reliability}
-
+ +
+
신고사유를 적어주세요
+
+ +
+ +
+
-
- { - transaction.is_mine - ? - //
- //
{status==='진행중'? "진행중" : "마감"}
- //
-
- } - checkedIcon={ -
진행중
- } - /> - - : -
- {status === '진행중' ?
진행중
:
마감
} +
+
+ +
{nickname}
+
+ {transaction.reliability} +
- } -
- -
- {transaction.content} -
-
-
- {transaction.is_mine ? -
- +
+ {transaction.is_mine ? ( + //
+ //
{status==='진행중'? "진행중" : "마감"}
+ //
+
+ } + checkedIcon={ +
+ 진행중 +
+ } + /> + + ) : ( +
+ {status === '진행중' ? ( +
진행중
+ ) : ( +
마감
+ )}
- : -
- - {status === '진행중' ? : - } - {likeStatus? : } -
} + )}
-
- {parseDate(transaction.written_date)} -
-
+
{transaction.content}
-
+
+
+ {transaction.is_mine ? ( +
+ +
+ ) : ( +
+ + {status === '진행중' ? ( + + ) : ( + + )} + {likeStatus ? ( + + ) : ( + + )} +
+ )} +
- +
+ {parseDate(transaction.written_date)} +
+
+
); -} +}; -export default TransactionDetail; \ No newline at end of file +export default TransactionDetail; diff --git a/frontend/sweet-red-beans/src/components/TransactionPage/TransactionPage.js b/frontend/sweet-red-beans/src/components/TransactionPage/TransactionPage.js index b351416..34bf8a2 100644 --- a/frontend/sweet-red-beans/src/components/TransactionPage/TransactionPage.js +++ b/frontend/sweet-red-beans/src/components/TransactionPage/TransactionPage.js @@ -1,13 +1,13 @@ -import React, { useState, useEffect, useMemo, useRef } from "react"; -import Transactions from "./Transactions"; -import style from "../../css/TransactionPage/TransactionPage.module.css"; -import axios from "axios"; -import TransactionWriteModal from "../Modals/TransactionModal"; -import { getCookie } from "../../Cookie"; -import { useNavigate } from "react-router"; -import { useSelector } from "react-redux"; -import userImage from "../../img/user.png"; -import { Cookies } from "react-cookie"; +import React, { useState, useEffect, useMemo, useRef } from 'react'; +import Transactions from './Transactions'; +import style from '../../css/TransactionPage/TransactionPage.module.css'; +import axios from 'axios'; +import TransactionWriteModal from '../Modals/TransactionModal'; +import { getCookie } from '../../Cookie'; +import { useNavigate } from 'react-router'; +import { useSelector } from 'react-redux'; +import userImage from '../../img/user.png'; +import { Cookies } from 'react-cookie'; const TransactionPage = () => { const cookies = new Cookies(); @@ -16,310 +16,358 @@ const TransactionPage = () => { const [modalOpen, setModalOpen] = useState(false); const [transactions, setTransactions] = useState([]); const [transactionIsHere, setTransactionIsHere] = useState(false); - const [search, setSearch] = useState(""); + const [search, setSearch] = useState(''); const [searchWords, setSearchWords] = useState([]); //처음엔 전체로 보여줌, true이면 진행 중만 보여줌 const [isProceed, setIsProceed] = useState(false); //검색 필터 - const [searchSort, setSearchSort] = useState("글내용"); + const [searchSort, setSearchSort] = useState('글내용'); // 스크롤값을 저장하기 위한 상태 const [ScrollY, setScrollY] = useState(0); const [BtnStatus, setBtnStatus] = useState(false); //내용 - const [content, setContent] = useState(""); + const [content, setContent] = useState(''); const [start, setStart] = useState(0); const [end, setEnd] = useState(30); //내 프로필 - const [nickname, setNickname] = useState(""); - const [profileImage, setProfileImage] = useState(""); + const [nickname, setNickname] = useState(''); + const [profileImage, setProfileImage] = useState(''); const [fetching, setFetching] = useState(false); const serverReq = () => { - axios.get('http://localhost:8080/transactions/search',{ - withCredentials: true, - params: { - user_id: "1", + axios + .get('http://localhost:8080/transactions/search', { + withCredentials: true, + params: { + user_id: '1', is_proceed: isProceed, search_word: search, - sort_criteria : "최신순", - search_criteria : searchSort, + sort_criteria: '최신순', + search_criteria: searchSort, start: 0, end: 29, - } - } - ) - .then(response => { - setTransactions(response.data) - setStart(0); - setEnd(29); - }) - .catch(error => console.log(error)); - } + }, + }) + .then((response) => { + setTransactions(response.data); + setStart(0); + setEnd(29); + }) + .catch((error) => console.log(error)); + }; const searchChange = (e) => { setSearch(e.target.value); - } + }; //검색버튼 눌렀을 때 const searchClick = () => { setSearchWords([...searchWords, search]); - } + }; //전체보기 눌렀을 때 const allClick = () => { setIsProceed(false); - console.log("전체 보기"); - } + console.log('전체 보기'); + }; //진행중만 보기 눌렀을 때 const proceedClick = () => { setIsProceed(true); - console.log("진행 중만 보기"); - } + console.log('진행 중만 보기'); + }; //글내용 or 작성자 변경했을 때 const searchSortChange = (e) => { setSearchSort(e.target.value); - } + }; //내용 변경됐을 때 const contentChange = (e) => { setContent(e.target.value); - } + }; //글쓰기 버튼 클릭했을 때 const writeClick = () => { - if(content === "") { - return - } - else { - const body = { - content: content, - } - - axios.post('http://localhost:8080/transactions/write', body, { withCredentials: true }) - .then(response => { - if(response.data){ - axios.get('http://localhost:8080/transactions/search',{ - withCredentials: true, - params: { - is_proceed: isProceed, - search_word: search, - sort_criteria : "최신순", - search_criteria : searchSort, - start: 0, - end: 30, + if (content === '') { + return; + } else { + const body = { + content: content, + }; + + axios + .post('http://localhost:8080/transactions/write', body, { + withCredentials: true, + }) + .then((response) => { + if (response.data) { + axios + .get('http://localhost:8080/transactions/search', { + withCredentials: true, + params: { + is_proceed: isProceed, + search_word: search, + sort_criteria: '최신순', + search_criteria: searchSort, + start: 0, + end: 30, + }, + }) + .then((response) => { + setTransactions(response.data); + }) + .catch((error) => {}); + } else { + alert('글 작성에 실패했습니다.'); } - }) - .then(response => { - setTransactions(response.data); - }) - .catch(error => { - - }); - } - - else { - alert("글 작성에 실패했습니다."); - } - }) - .catch(error => { - if(error.response.status === 401){ - alert("로그인을 먼저 해주세요"); - } - }); - - setContent(""); - setModalOpen(false) - } - } + }) + .catch((error) => { + if (error.response.status === 401) { + alert('로그인을 먼저 해주세요'); + } + }); + + setContent(''); + setModalOpen(false); + } + }; const openModal = () => { - setModalOpen(true); + setModalOpen(true); }; const closeModal = () => { - setModalOpen(false); + setModalOpen(false); }; const handleFollow = () => { - setScrollY(window.pageYOffset); - if(ScrollY > 100) { - // 100 이상이면 버튼이 보이게 - setBtnStatus(true); - } else { - // 100 이하면 버튼이 사라지게 - setBtnStatus(false); - } - } - - const handleTop = () => { // 클릭하면 스크롤이 위로 올라가는 함수 - window.scrollTo({ - top: 0, - behavior: "smooth" - }); - setScrollY(0); // ScrollY 의 값을 초기화 - setBtnStatus(false); // BtnStatus의 값을 false로 바꿈 => 버튼 숨김 - } + setScrollY(window.pageYOffset); + if (ScrollY > 100) { + // 100 이상이면 버튼이 보이게 + setBtnStatus(true); + } else { + // 100 이하면 버튼이 사라지게 + setBtnStatus(false); + } + }; + + const handleTop = () => { + // 클릭하면 스크롤이 위로 올라가는 함수 + window.scrollTo({ + top: 0, + behavior: 'smooth', + }); + setScrollY(0); // ScrollY 의 값을 초기화 + setBtnStatus(false); // BtnStatus의 값을 false로 바꿈 => 버튼 숨김 + }; const fetchMoreTransactions = () => { - if(transactions.length !== 0) { - axios.get('http://localhost:8080/transactions/search',{ - withCredentials: true, - params: { - user_id: "1", - is_proceed: isProceed, - search_word: search, - sort_criteria : "최신순", - search_criteria : searchSort, - start: start+30, - end: end+30, - } - }) - .then(response => { - const more = response.data; - const mergeData = transactions.concat(...more); - setTransactions(mergeData); - setStart(start+30); - setEnd(end+30); - }) - .catch(error => console.log(error)); - } - - - console.log("더 붙이기"); - } + if (transactions.length !== 0) { + axios + .get('http://localhost:8080/transactions/search', { + withCredentials: true, + params: { + user_id: '1', + is_proceed: isProceed, + search_word: search, + sort_criteria: '최신순', + search_criteria: searchSort, + start: start + 30, + end: end + 30, + }, + }) + .then((response) => { + const more = response.data; + const mergeData = transactions.concat(...more); + setTransactions(mergeData); + setStart(start + 30); + setEnd(end + 30); + }) + .catch((error) => console.log(error)); + } - useEffect(() => { - //console.log("ScrollY is ", ScrollY); // ScrollY가 변화할때마다 값을 콘솔에 출력 + console.log('더 붙이기'); + }; - //ScrollY === document.documentElement.scrollTop - if (ScrollY + document.documentElement.clientHeight >= document.documentElement.scrollHeight){ - if(transactions.length >= 29){ - fetchMoreTransactions(); + useEffect(() => { + //console.log("ScrollY is ", ScrollY); // ScrollY가 변화할때마다 값을 콘솔에 출력 + + //ScrollY === document.documentElement.scrollTop + if ( + ScrollY + document.documentElement.clientHeight >= + document.documentElement.scrollHeight + ) { + if (transactions.length >= 29) { + fetchMoreTransactions(); + } } - } - }, [ScrollY]) - + }, [ScrollY]); + useEffect(() => { - const watch = () => { - window.addEventListener('scroll', handleFollow); - } - watch(); // addEventListener 함수를 실행 - return () => { - window.removeEventListener('scroll', handleFollow); // addEventListener 함수를 삭제 - } - }) + const watch = () => { + window.addEventListener('scroll', handleFollow); + }; + watch(); // addEventListener 함수를 실행 + return () => { + window.removeEventListener('scroll', handleFollow); // addEventListener 함수를 삭제 + }; + }); //한 번만 실행 - useEffect(()=>{ - axios.get('http://localhost:8080/transactions/search',{ - withCredentials: true, - params: { - is_proceed: isProceed, - search_word: search, - sort_criteria : "최신순", - search_criteria : searchSort, - start:start, - end:end, - } - }) - .then(response => { - setTransactions(response.data); - }) - .catch(error => console.log(error)); - + useEffect(() => { + axios + .get('http://localhost:8080/transactions/search', { + withCredentials: true, + params: { + is_proceed: isProceed, + search_word: search, + sort_criteria: '최신순', + search_criteria: searchSort, + start: start, + end: end, + }, + }) + .then((response) => { + setTransactions(response.data); + }) + .catch((error) => console.log(error)); + //내 프로필 조회 - if(cookies.get("user")){ - setNickname(cookies.get("user").nickname); - setProfileImage(cookies.get("user").porfileImage); - } - else { - setNickname("익명"); - setProfileImage(userImage); + if (cookies.get('user')) { + setNickname(cookies.get('user').nickname); + setProfileImage(cookies.get('user').porfileImage); + } else { + setNickname('익명'); + setProfileImage(userImage); } + }, []); - }, []) - - useEffect(()=>{ - setTransactionIsHere(true); - }, [transactions]) + useEffect(() => { + setTransactionIsHere(true); + }, [transactions]); useEffect(() => { - serverReq(); - console.log(isProceed); + serverReq(); + console.log(isProceed); }, [isProceed]); useEffect(() => { - serverReq(); - console.log(searchWords, searchSort); - }, [searchWords]) + serverReq(); + console.log(searchWords, searchSort); + }, [searchWords]); return ( <> -
-
-
- -
{nickname}
-
- -
- -
- -
- -
-
-
- - -
-
- - -
-
- -
- +
+
+
+ +
{nickname}
+
+ +
+ +
+ +
+ +
+
+
+ + +
+
+ + +
+
+ +
+ +
+
+ + + + + + +
+ + +
+
+ +
{nickname}
+
+
+ +
+ +
+
+ +
-
- - - - - - -
- - -
-
- -
{nickname}
-
-
- -
- -
-
- -
- -
- -
- ); -} +}; -export default TransactionPage; \ No newline at end of file +export default TransactionPage; diff --git a/frontend/sweet-red-beans/src/components/TransactionPage/Transactions.js b/frontend/sweet-red-beans/src/components/TransactionPage/Transactions.js index 6ac2633..55fe65c 100644 --- a/frontend/sweet-red-beans/src/components/TransactionPage/Transactions.js +++ b/frontend/sweet-red-beans/src/components/TransactionPage/Transactions.js @@ -1,22 +1,22 @@ -import React, { useEffect, useRef, useCallback, useState } from "react"; -import { useNavigate } from "react-router"; -import TransactionDetail from "./TransactionDetail"; +import React, { useEffect, useRef, useCallback, useState } from 'react'; +import { useNavigate } from 'react-router'; +import TransactionDetail from './TransactionDetail'; -const Transactions = ({transactions}) => { +const Transactions = ({ transactions }) => { const navigation = useNavigate(); - useEffect(()=>{ + useEffect(() => { console.log(transactions); + }, [transactions]); - }, [transactions]) - - return( + return ( <> - - { - transactions.map((item, index) =>
) - } + {transactions.map((item, index) => ( +
+ +
+ ))} ); -} +}; -export default Transactions; \ No newline at end of file +export default Transactions; diff --git a/frontend/sweet-red-beans/src/css/App/App.module.css b/frontend/sweet-red-beans/src/css/App/App.module.css index 9745ae9..70b8689 100644 --- a/frontend/sweet-red-beans/src/css/App/App.module.css +++ b/frontend/sweet-red-beans/src/css/App/App.module.css @@ -1,61 +1,65 @@ .App { - text-align: center; - padding: 0px; - min-width: 1080px; - min-height: 1300px; - background-color: #F9F2EC; - position: relative; - padding-bottom: 250px; + text-align: center; + padding: 0px; + min-width: 1080px; + min-height: 1300px; + background-color: #f9f2ec; + position: relative; + padding-bottom: 250px; } .App button { - font-family: 'ROKAFSansBold'; + font-family: 'ROKAFSansBold'; } -.App .search, .App select, .App option, .App textarea{ - font-family: 'Pretendard-Regular'; +.App .search input, +.App select, +.App option, +.App textarea { + font-family: 'Pretendard-Regular'; } -.App::-webkit-scrollbar{ - width: 15px; +.App::-webkit-scrollbar { + width: 15px; } -.App::-webkit-scrollbar-thumb{ - width: 15px; - background-color: #C4C4C4; - border-radius: 20px; - background-clip: padding-box; - border: 4px solid transparent; - +.App::-webkit-scrollbar-thumb { + width: 15px; + background-color: #c4c4c4; + border-radius: 20px; + background-clip: padding-box; + border: 4px solid transparent; } .App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: white; + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; } .footer { - position: absolute; - bottom: 0px; - width: 100%; + position: absolute; + bottom: 0px; + width: 100%; } @font-face { - font-family: 'ROKAFSansBold'; - src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts2201-3@1.0/ROKAFSansBold.woff') format('woff'); - font-weight: normal; - font-style: normal; + font-family: 'ROKAFSansBold'; + src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts2201-3@1.0/ROKAFSansBold.woff') + format('woff'); + font-weight: normal; + font-style: normal; } @font-face { - font-family: 'Pretendard-Regular'; - src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Regular.woff') format('woff'); - font-weight: 400; - font-style: normal; -} \ No newline at end of file + font-family: 'Pretendard-Regular'; + src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Regular.woff') + format('woff'); + font-weight: 400; + font-style: normal; +} diff --git a/frontend/sweet-red-beans/src/css/EventPage/EventPage.module.css b/frontend/sweet-red-beans/src/css/EventPage/EventPage.module.css index 007d8dd..f283bb1 100644 --- a/frontend/sweet-red-beans/src/css/EventPage/EventPage.module.css +++ b/frontend/sweet-red-beans/src/css/EventPage/EventPage.module.css @@ -3,107 +3,108 @@ background-color: white; width: 1000px; min-height: 1400px; - margin : 0 auto; + margin: 0 auto; border-radius: 20px; - border: 1px solid #C4C4C4; + border: 1px solid #c4c4c4; box-sizing: border-box; padding: 30px; margin-top: 50px; } .topBar { - text-align: right; - margin-right: 20px; - margin-bottom: 30px; + text-align: right; + margin-right: 20px; + margin-bottom: 30px; } .datefilter { - display: inline-block; - vertical-align: bottom; + display: inline-block; + vertical-align: bottom; } .filter { - display: inline-block; - vertical-align: bottom; - margin-left: 20px; + display: inline-block; + vertical-align: bottom; + margin-left: 20px; } -.selected, .notSelected { - cursor: pointer; - background-color: transparent; - border: none; - font-size: 14px; - margin-left: 5px; - transition: transform 200ms ease; +.selected, +.notSelected { + cursor: pointer; + background-color: transparent; + border: none; + font-size: 14px; + margin-left: 5px; + transition: transform 200ms ease; } .notSelected:hover { - transform: scale(1.2); + transform: scale(1.2); } -.selected{ - cursor:default; - font-size: 18px; - color: #f23333; +.selected { + cursor: default; + font-size: 18px; + color: #f23333; } .selected::before { - display: inline-block; - margin-right: 5px; - content: ""; - width: 15px; - height: 15px; - background: url("../../img/check.png"); - background-repeat: no-repeat; - background-size: 100%; + display: inline-block; + margin-right: 5px; + content: ''; + width: 15px; + height: 15px; + background: url('../../img/check.png'); + background-repeat: no-repeat; + background-size: 100%; } -.cinemafilter{ - display: inline-block; - position: relative; - width: 100px; - height: 35px; - border-bottom: 3px solid #C4C4C4; - margin-left: 30px; +.cinemafilter { + display: inline-block; + position: relative; + width: 100px; + height: 35px; + border-bottom: 3px solid #c4c4c4; + margin-left: 30px; } .cinemafilter > select { - font-size: 14px; - cursor: pointer; - width: inherit; - height: inherit; - background: transparent; - border: 0 none; - outline: 0 none; - padding: 0 8px; - position: relative; - z-index: 3; - appearance: none; - -webkit-appearance: none; - -moz-appearance: none; + font-size: 14px; + cursor: pointer; + width: inherit; + height: inherit; + background: transparent; + border: 0 none; + outline: 0 none; + padding: 0 8px; + position: relative; + z-index: 3; + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; } .cinemafilter > select > option { - color: #5a5a5a; - padding: 10px 0px 10px 0px; - font-size: 14px; + color: #5a5a5a; + padding: 10px 0px 10px 0px; + font-size: 14px; } .filterArrow { - position: absolute; - bottom: 7px; - right: 0; - z-index: 1; - width: 20px; - height: 20px; - transition: transform 300ms ease-in-out; - background: url("../../img/down-arrow.png"); - background-repeat: no-repeat; - background-size: 70%; - background-position: 50% 50%; + position: absolute; + bottom: 7px; + right: 0; + z-index: 1; + width: 20px; + height: 20px; + transition: transform 300ms ease-in-out; + background: url('../../img/down-arrow.png'); + background-repeat: no-repeat; + background-size: 70%; + background-position: 50% 50%; } -.cinemafilter > select:focus + .filterArrow{ - transform: rotate(180deg); +.cinemafilter > select:focus + .filterArrow { + transform: rotate(180deg); } .search { @@ -113,54 +114,54 @@ width: 200px; height: 45px; margin-left: 30px; - border-bottom: 3px solid #C4C4C4; + border-bottom: 3px solid #c4c4c4; vertical-align: bottom; right: 0px; bottom: 0px; - } - - .search input { +} + +.search input { position: absolute; bottom: 0px; - left:0px; + left: 0px; width: 170px; height: 35px; box-sizing: border-box; border: none; padding: 10px; font-size: 14px; - + font-family: 'Pretendard-Regular'; transition: border-bottom 200ms ease; - } - - .search input::placeholder { - color: #C4C4C4; - } - - .search input:focus { +} + +.search input::placeholder { + color: #c4c4c4; +} + +.search input:focus { outline: none; - } - - .underline { +} + +.underline { position: absolute; width: 0px; height: 3px; background-color: #f23333; bottom: -3px; transition: width 300ms ease; - } - .search input:focus + .underline { +} +.search input:focus + .underline { width: 200px; - } - - .search button { +} + +.search button { cursor: pointer; position: absolute; - top: 0; + top: 0; right: 0; transform: translate(-0%, 50%); z-index: 3; - width: 25px; + width: 25px; height: 25px; display: flex; background: url('../../img/search.png'); @@ -168,4 +169,4 @@ border: 0 none; outline: 0 none; background-color: white; - } \ No newline at end of file +} diff --git a/frontend/sweet-red-beans/src/css/InformationSharePage/InformationSharePage.module.css b/frontend/sweet-red-beans/src/css/InformationSharePage/InformationSharePage.module.css index f95d0d0..dec688d 100644 --- a/frontend/sweet-red-beans/src/css/InformationSharePage/InformationSharePage.module.css +++ b/frontend/sweet-red-beans/src/css/InformationSharePage/InformationSharePage.module.css @@ -2,9 +2,9 @@ position: relative; background-color: white; width: 1000px; - margin : 0 auto; + margin: 0 auto; border-radius: 20px; - border: 1px solid #C4C4C4; + border: 1px solid #c4c4c4; box-sizing: border-box; padding: 30px; margin-top: 50px; @@ -16,15 +16,15 @@ margin-bottom: 45px; } -.filter{ +.filter { display: inline-block; position: relative; width: 100px; height: 35px; - border-bottom: 3px solid #C4C4C4; + border-bottom: 3px solid #c4c4c4; margin-left: 30px; text-align: left; - } +} .filter > select { font-size: 14px; @@ -40,33 +40,32 @@ appearance: none; -webkit-appearance: none; -moz-appearance: none; - overflow:hidden; - text-overflow: ellipsis; - white-space:nowrap; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } - .filter > select > option { color: #5a5a5a; padding: 10px 0px 10px 0px; font-size: 14px; } - + .filterArrow { - position: absolute; - bottom: 7px; - right: 0; - z-index: 1; - width: 20px; + position: absolute; + bottom: 7px; + right: 0; + z-index: 1; + width: 20px; height: 20px; transition: transform 300ms ease-in-out; - background: url("../../img/down-arrow.png"); + background: url('../../img/down-arrow.png'); background-repeat: no-repeat; background-size: 70%; background-position: 50% 50%; } - -.filter > select:focus + .filterArrow{ + +.filter > select:focus + .filterArrow { transform: rotate(180deg); } @@ -82,7 +81,6 @@ width: 140px; } - .search { display: inline-block; position: relative; @@ -90,7 +88,7 @@ width: 200px; height: 45px; margin-left: 20px; - border-bottom: 3px solid #C4C4C4; + border-bottom: 3px solid #c4c4c4; vertical-align: bottom; } @@ -98,18 +96,18 @@ font-size: 14px; position: absolute; bottom: 0px; - left:0px; + left: 0px; width: 170px; height: 35px; box-sizing: border-box; border: none; + font-family: 'Pretendard-Regular'; padding: 10px; - transition: border-bottom 200ms ease; } .search input::placeholder { - color: #C4C4C4; + color: #c4c4c4; } .search input:focus { @@ -131,11 +129,11 @@ .search button { cursor: pointer; position: absolute; - top: 0; + top: 0; right: 0; transform: translate(-0%, 50%); z-index: 3; - width: 25px; + width: 25px; height: 25px; display: flex; background: url('../../img/search.png'); @@ -166,4 +164,4 @@ height: 30px; background-color: #5a5a5a; background-size: 30px 30px; -} */ \ No newline at end of file +} */ diff --git a/frontend/sweet-red-beans/src/css/TopBar/NavigationBar.module.css b/frontend/sweet-red-beans/src/css/TopBar/NavigationBar.module.css index 3297f62..f43addc 100644 --- a/frontend/sweet-red-beans/src/css/TopBar/NavigationBar.module.css +++ b/frontend/sweet-red-beans/src/css/TopBar/NavigationBar.module.css @@ -1,45 +1,3 @@ -/* .topBar{ - position: relative; - margin-top:10px; - margin-bottom: 10px; -} - -.topBarButton { - font-size: 15px; - color:cornflowerblue; - margin-right: 90px; - border-style: none; - width: 94px; - height: 66px; - font-family: '어그로'; -} - -.topBarButton:hover { - font-size: 15px; - color:#FFA0AC; - margin-right: 90px; - border-style: none; - font-family: '어그로'; - width: 94px; - height: 66px; -} - -.bottomCategory { - display: none; -} - -.bottomCategory:hover { - color: white; - } - - .topBar:hover .bottomCategory { - display: block; - } - -@font-face { - font-family: '어그로'; - src: url('../fonts/SB\ 어그로\ B.ttf'); -} */ nav { width: 100%; display: flex; @@ -48,7 +6,8 @@ nav { font-family: 'ROKAFSansBold'; } -ul, li { +ul, +li { margin: 0; padding: 0; list-style: none; @@ -67,11 +26,11 @@ ul, li { text-decoration: none; letter-spacing: 0.05em; display: inline-block; - padding: 10px 20px; + padding: 5px 20px; } .mainMenu > li > div:hover { - color: #F23333; + color: #f23333; } .mainMenu > li > div::after { @@ -79,16 +38,16 @@ ul, li { left: 50%; transform: translate(-50%, 0); bottom: 0px; - content: ""; + content: ''; width: 0px; height: 4px; - background-color: #F23333; + background-color: #f23333; } .mainMenu > li > div:hover::after { - content: ""; + content: ''; width: 100%; - transition: width 300ms ease + transition: width 300ms ease; } .subMenu { @@ -103,7 +62,7 @@ ul, li { padding: 10px 10px; } -.subMenu > li > div { +.subMenu > li > div { font-size: 14px; color: black; text-decoration: none; @@ -116,22 +75,21 @@ ul, li { } .mainMenu > li:hover .subMenu > li > div { - animation: slide linear 0.3s; } @keyframes slide { - 0%{ + 0% { color: transparent; height: 0; } - 100%{ + 100% { color: black; height: 100%; } } -.subMenu > li > div:hover { +.subMenu > li > div:hover { cursor: pointer; - color: #F23333; -} \ No newline at end of file + color: #f23333; +} diff --git a/frontend/sweet-red-beans/src/css/TopBar/TopBar.module.css b/frontend/sweet-red-beans/src/css/TopBar/TopBar.module.css index eb0662b..50bacd5 100644 --- a/frontend/sweet-red-beans/src/css/TopBar/TopBar.module.css +++ b/frontend/sweet-red-beans/src/css/TopBar/TopBar.module.css @@ -1,7 +1,7 @@ .container { position: relative; height: 50px; - border-bottom: #5A5A5A 1px solid; + border-bottom: #5a5a5a 1px solid; } .loginArea { @@ -11,10 +11,10 @@ bottom: 10px; } -.title{ +.title { position: absolute; - left:0px; - bottom: 5px; + left: 0px; + bottom: 0px; display: inline-block; margin-left: 10px; } @@ -22,15 +22,15 @@ .title > button { cursor: pointer; border-style: none; - background-color:rgba(205, 92, 92, 0); + background-color: rgba(205, 92, 92, 0); font-size: 30px; } -.navigationBar{ +.navigationBar { position: absolute; display: inline-block; - left:150px; + left: 150px; bottom: 0px; text-align: center; vertical-align: middle; -} \ No newline at end of file +} diff --git a/frontend/sweet-red-beans/src/css/TransactionPage/TransactionPage.module.css b/frontend/sweet-red-beans/src/css/TransactionPage/TransactionPage.module.css index e677488..a299275 100644 --- a/frontend/sweet-red-beans/src/css/TransactionPage/TransactionPage.module.css +++ b/frontend/sweet-red-beans/src/css/TransactionPage/TransactionPage.module.css @@ -1,74 +1,73 @@ .wrap { - position: relative; - font-size: 18px; - line-height: 1.6; - position: relative; - background-color: white; - border: #C4C4C4 1px solid; - width: 1000px; - margin : 0 auto; - border-radius: 20px; - box-sizing: border-box; - margin-bottom: 100px; - margin-top: 50px; - font-family: 'ROKAFSansBold'; + position: relative; + font-size: 18px; + line-height: 1.6; + position: relative; + background-color: white; + border: #c4c4c4 1px solid; + width: 1000px; + margin: 0 auto; + border-radius: 20px; + box-sizing: border-box; + margin-bottom: 100px; + margin-top: 50px; + font-family: 'ROKAFSansBold'; } .writeBox { - margin-top: 30px; - margin-bottom: 50px; + margin-top: 30px; + margin-bottom: 50px; } .writeBox::after { - display: block; - content: ""; - width: 100%; - height: 1px; - background-color: #C4C4C4; - margin-top: 50px; + display: block; + content: ''; + width: 100%; + height: 1px; + background-color: #c4c4c4; + margin-top: 50px; } .profileArea { - position: absolute; - display: inline-block; - text-align: left; - top:30px; + position: absolute; + display: inline-block; + text-align: left; + top: 30px; } .profileImage { - display: inline-block; - vertical-align: middle; - width: 50px; - height: 50px; - border-radius: 50px; - object-fit: cover; + display: inline-block; + vertical-align: middle; + width: 50px; + height: 50px; + border-radius: 50px; + object-fit: cover; } .nickname { - cursor: default; - margin-left: 20px; - display: inline-block; - vertical-align: middle; - font-size: 16px; - + cursor: default; + margin-left: 20px; + display: inline-block; + vertical-align: middle; + font-size: 16px; } .writeButtonArea { - position: absolute; - display: inline-block; - top: 30px; - right: 150px; + position: absolute; + display: inline-block; + top: 30px; + right: 150px; } .writeButtonArea > button { - cursor: pointer; - border: none; - width: 190px; - height: 50px; - background-color: #F23333; - border-radius: 10px; - color: white; - font-size: 16px; + cursor: pointer; + border: none; + width: 190px; + height: 50px; + background-color: #f23333; + border-radius: 10px; + color: white; + font-size: 16px; } /* .writeButtonArea > button:hover{ @@ -83,282 +82,282 @@ } */ .writeBox > textarea { - font-size: 14px; - width: 700px; - height: 200px; - border-radius: 10px; - border: #C4C4C4 1px solid; - box-shadow: 0px 0px 7px rgba(90, 90, 90, 0.25); - box-sizing: border-box; - padding: 20px; - resize: none; - margin-top: 80px; - outline: none; + font-size: 14px; + width: 700px; + height: 200px; + border-radius: 10px; + border: #c4c4c4 1px solid; + box-shadow: 0px 0px 7px rgba(90, 90, 90, 0.25); + box-sizing: border-box; + padding: 20px; + resize: none; + margin-top: 80px; + outline: none; } -.writeBox > textarea:focus{ - border: 2px solid #5a5a5a; - box-shadow:none; +.writeBox > textarea:focus { + border: 2px solid #5a5a5a; + box-shadow: none; } -.writeBox > textarea::-webkit-scrollbar{ - width: 15px; +.writeBox > textarea::-webkit-scrollbar { + width: 15px; } -.writeBox > textarea::-webkit-scrollbar-thumb{ - width: 15px; - background-color: #C4C4C4; - border-radius: 20px; - margin: 5px; - background-clip: padding-box; - border: 4px solid transparent; - +.writeBox > textarea::-webkit-scrollbar-thumb { + width: 15px; + background-color: #c4c4c4; + border-radius: 20px; + margin: 5px; + background-clip: padding-box; + border: 4px solid transparent; } -.writeBox > textarea::-webkit-scrollbar-track{ - background-color: rgba(0,0,0,0); - +.writeBox > textarea::-webkit-scrollbar-track { + background-color: rgba(0, 0, 0, 0); } .transactionsBox { } -.topBox{ - text-align: right; - margin-right: 150px; - margin-bottom: 30px; +.topBox { + text-align: right; + margin-right: 150px; + margin-bottom: 30px; } -.proceedfilter{ - display: inline-block; - vertical-align: bottom; +.proceedfilter { + display: inline-block; + vertical-align: bottom; } -.selected, .notSelected { - cursor: pointer; - background-color: transparent; - border: none; - font-size: 14px; - margin-left: 20px; - transition: transform 200ms ease; +.selected, +.notSelected { + cursor: pointer; + background-color: transparent; + border: none; + font-size: 14px; + margin-left: 20px; + transition: transform 200ms ease; } .notSelected:hover { - transform: scale(1.2); + transform: scale(1.2); } -.selected{ - cursor:default; - font-size: 18px; - color: #f23333; +.selected { + cursor: default; + font-size: 18px; + color: #f23333; } .selected::before { - display: inline-block; - margin-right: 5px; - content: ""; - width: 15px; - height: 15px; - background: url("../../img/check.png"); - background-repeat: no-repeat; - background-size: 100%; + display: inline-block; + margin-right: 5px; + content: ''; + width: 15px; + height: 15px; + background: url('../../img/check.png'); + background-repeat: no-repeat; + background-size: 100%; } -.filter{ - display: inline-block; - position: relative; - width: 100px; - height: 35px; - border-bottom: 3px solid #C4C4C4; - margin-left: 30px; +.filter { + display: inline-block; + position: relative; + width: 100px; + height: 35px; + border-bottom: 3px solid #c4c4c4; + margin-left: 30px; } .filter > select { - font-size: 14px; - cursor: pointer; - width: inherit; - height: inherit; - background: transparent; - border: 0 none; - outline: 0 none; - padding: 0 8px; - position: relative; - z-index: 3; - appearance: none; - -webkit-appearance: none; - -moz-appearance: none; + font-size: 14px; + cursor: pointer; + width: inherit; + height: inherit; + background: transparent; + border: 0 none; + outline: 0 none; + padding: 0 8px; + position: relative; + z-index: 3; + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; } .filter > select > option { - color: #5a5a5a; - padding: 10px 0px 10px 0px; - font-size: 14px; + color: #5a5a5a; + padding: 10px 0px 10px 0px; + font-size: 14px; } .filterArrow { - position: absolute; - bottom: 7px; - right: 0; - z-index: 1; - width: 20px; - height: 20px; - transition: transform 300ms ease-in-out; - background: url("../../img/down-arrow.png"); - background-repeat: no-repeat; - background-size: 70%; - background-position: 50% 50%; + position: absolute; + bottom: 7px; + right: 0; + z-index: 1; + width: 20px; + height: 20px; + transition: transform 300ms ease-in-out; + background: url('../../img/down-arrow.png'); + background-repeat: no-repeat; + background-size: 70%; + background-position: 50% 50%; } -.filter > select:focus + .filterArrow{ - transform: rotate(180deg); +.filter > select:focus + .filterArrow { + transform: rotate(180deg); } .search { - display: inline-block; - position: relative; - text-align: right; - width: 200px; - height: 45px; - margin-left: 30px; - border-bottom: 3px solid #C4C4C4; - vertical-align: bottom; + display: inline-block; + position: relative; + text-align: right; + width: 200px; + height: 45px; + margin-left: 30px; + border-bottom: 3px solid #c4c4c4; + vertical-align: bottom; } .search input { - position: absolute; - bottom: 0px; - left:0px; - width: 170px; - height: 35px; - box-sizing: border-box; - border: none; - padding: 10px; - font-size: 14px; - transition: border-bottom 200ms ease; + position: absolute; + bottom: 0px; + left: 0px; + width: 170px; + height: 35px; + box-sizing: border-box; + border: none; + padding: 10px; + font-size: 14px; + font-family: 'Pretendard-Regular'; + transition: border-bottom 200ms ease; } .search input::placeholder { - color: #C4C4C4; + color: #c4c4c4; } .search input:focus { - outline: none; + outline: none; } .underline { - position: absolute; - width: 0px; - height: 3px; - background-color: #f23333; - bottom: -3px; - transition: width 300ms ease; + position: absolute; + width: 0px; + height: 3px; + background-color: #f23333; + bottom: -3px; + transition: width 300ms ease; } .search input:focus + .underline { - width: 200px; + width: 200px; } .search button { - cursor: pointer; - position: absolute; - top: 0; - right: 0; - transform: translate(-0%, 50%); - z-index: 3; - width: 25px; - height: 25px; - display: flex; - background: url('../../img/search.png'); - background-size: cover; - border: 0 none; - outline: 0 none; - background-color: white; + cursor: pointer; + position: absolute; + top: 0; + right: 0; + transform: translate(-0%, 50%); + z-index: 3; + width: 25px; + height: 25px; + display: flex; + background: url('../../img/search.png'); + background-size: cover; + border: 0 none; + outline: 0 none; + background-color: white; } .topBtn { - position: fixed; - opacity: 0; - bottom: 30px; - right: 30px; - z-index: -10; - width: 60px; - height: 60px; - border-radius: 50px; - border: none; - cursor: pointer; - transition: opacity 0.5s ease-in-out; - background-color: #F23333; - color: white; + position: fixed; + opacity: 0; + bottom: 30px; + right: 30px; + z-index: -10; + width: 60px; + height: 60px; + border-radius: 50px; + border: none; + cursor: pointer; + transition: opacity 0.5s ease-in-out; + background-color: #f23333; + color: white; } .topBtn.active { - z-index: 10; - opacity: 1; + z-index: 10; + opacity: 1; } .topBtn:hover, .topBtn:focus, -.topBtn:active { - outline: 0 none; +.topBtn:active { + outline: 0 none; } .writeBtn { - position: fixed; - opacity: 0; - bottom: 120px; - right: 30px; - z-index: -10; - width: 60px; - height: 60px; - border-radius: 50px; - border: none; - cursor: pointer; - transition: opacity 0.5s ease-in-out; - background: url("../../img/quill.png"); - background-size: 50%; - background-repeat: no-repeat; - background-position: 50% 50%; - background-color: #F23333; - color: white; + position: fixed; + opacity: 0; + bottom: 120px; + right: 30px; + z-index: -10; + width: 60px; + height: 60px; + border-radius: 50px; + border: none; + cursor: pointer; + transition: opacity 0.5s ease-in-out; + background: url('../../img/quill.png'); + background-size: 50%; + background-repeat: no-repeat; + background-position: 50% 50%; + background-color: #f23333; + color: white; } .writeBtn.active { - z-index: 10; - opacity: 1; + z-index: 10; + opacity: 1; } .modal { - text-align: center; + text-align: center; } .modal > div:nth-child(1) { - text-align: left; - padding: 10px 0px 10px 30px; + text-align: left; + padding: 10px 0px 10px 30px; } -.modal > div > textarea{ - width: 520px; - height: 200px; - resize: none; - outline: none; - padding:20px; - box-sizing: border-box; - border-radius: 10px; - border: #C4C4C4 1px solid; - font-size: 14px; +.modal > div > textarea { + width: 520px; + height: 200px; + resize: none; + outline: none; + padding: 20px; + box-sizing: border-box; + border-radius: 10px; + border: #c4c4c4 1px solid; + font-size: 14px; } -.modal > div > textarea:focus{ - border: #5a5a5a 2px solid; +.modal > div > textarea:focus { + border: #5a5a5a 2px solid; } .modal > button { - margin-top: 30px; - cursor: pointer; - border: none; - background-color: #F23333; - color: white; - font-size: 16px; - border-radius: 10px; - height: 50px; - width: 110px; -} \ No newline at end of file + margin-top: 30px; + cursor: pointer; + border: none; + background-color: #f23333; + color: white; + font-size: 16px; + border-radius: 10px; + height: 50px; + width: 110px; +}