Skip to content

Commit

Permalink
Merge pull request #39 from CafeFlow/rian
Browse files Browse the repository at this point in the history
[add]Q&AList css수정
  • Loading branch information
AhnRian authored Aug 11, 2023
2 parents 1b88166 + c88ff0d commit 7267182
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 163 deletions.
104 changes: 5 additions & 99 deletions cafeflow/src/components/Community/Community.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,6 @@
left:205px;
}

.more {
width: 10vw;
height: 5vh;
background-color: #7267c8;
color: white;
border-radius: 20px;
border: none;
font-size: 18px;
position: relative;
right: 50px;
}

.moreButton_container {
display: flex;
justify-content: flex-end;
}

.community-table{
width:80vw;
margin-left:5vw;
}


.preButton{
background-image: url("../../icons/pre_arrow1.png");
Expand All @@ -117,30 +95,6 @@
background-color: transparent;
}


.community-tr{
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid lightgray;
height:4wh;
}

.community-left{
display: flex;
justify-content: center;
align-items: center;
margin-left: 5vw;
}

/* .community-title{
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 5px;
margin-left: 5vw;
} */

.community-right{
display: flex;
justify-content: center;
Expand Down Expand Up @@ -171,7 +125,6 @@
.select-box{
padding:8px;
font-size:15px;
/* width:10vw; */
}


Expand All @@ -197,22 +150,21 @@
.community-search{
height:30px;
}
/* 리스트 추가 */



/* 리스트 추가 */
.community-post-list{
list-style:none;
}

.community-createdBy{
color:black;
font-size:15px;
font-weight:bold;
}

.community-createdAt{
color:black;
margin:3vw;
font-size:15px;
}

Expand Down Expand Up @@ -306,8 +258,6 @@
position: relative;
}



.freeboard{
width:26vw;
height:3px;
Expand All @@ -322,31 +272,7 @@
position:relative;
left:29vw;
}

.more {
width: 10vw;
height: 5vh;
background-color: #7267c8;
color: white;
border-radius: 20px;
border: none;
font-size: 18px;
position: relative;
right: 50px;
}

.moreButton_container {
display: flex;
justify-content: flex-end;
}

.community-table{
width:80vw;
margin-left:5vw;
/* background-color: red; */
}



.preButton{
background-image: url("../../icons/pre_arrow1.png");
background-color: transparent;
Expand Down Expand Up @@ -378,29 +304,9 @@
}


.community-tr{
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid lightgray;
height:5vh;
width:50vw;
}

.community-left{
display: flex;
justify-content: center;
align-items: center;
margin-left: 5vw;
}


/* .community-title{
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 5px;
margin-left: 5vw;
} */

.community-post-title{
font-size:4vw;
}
Expand Down
27 changes: 8 additions & 19 deletions cafeflow/src/components/Community/Community.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from "react";
import { useNavigate } from "react-router-dom";
import { useNavigate,Link } from "react-router-dom";
import { useState, useEffect } from "react";
import axios from "axios";
import { API_URL } from "../Constant";
import ViewCount from "../../icons/ViewCount.png";
import "./Community.css";



const Community = () => {
const token = localStorage.getItem("jwtToken");
const [type, setType] = useState("freeBoard");
Expand Down Expand Up @@ -69,7 +70,7 @@ const Community = () => {
const month = ("0" + (date.getMonth() + 1)).slice(-2);
const day = ("0" + date.getDate()).slice(-2);

return `${year}-${month}-${day}`;
return `${year}/${month}/${day}`;
}

const handleSubmit=(e)=>{
Expand All @@ -92,21 +93,7 @@ const Community = () => {
const handleKeyDown=(e)=>{
e.preventDefault();
console.log(e.key);
// if(e.key=='enter'){
//
// axios
// .get(`${API_URL}/boards?page=${pageNum}&size=${size}&boardType=${type}&option=${option}&searchKeyword=${keyword}`, {
// headers: {
// Authorization: `Bearer ${token}`,
// },
// })
// .then((response) => {
// setposts(response.data.data.boardList);
// })
// .catch((error) => {
// console.log(error);
// });
// }

}

const handleInputChange=(event)=>{
Expand Down Expand Up @@ -175,7 +162,7 @@ const Community = () => {

<div className="community-post-list-up">
<div><span className="community-createdBy">{post.createdBy}</span>
<span className="community-createdAt"> 작성 일자 : {formatDate(post.createdAt)}</span>
<span className="community-createdAt"> 작성 : {formatDate(post.createdAt)}</span>
</div>
<div>
<img className="viewCountImg" src={ViewCount}></img>
Expand All @@ -184,7 +171,9 @@ const Community = () => {

</div>
<div className="community-post-list-middle">
<div className="community-title">{post.title}</div>
<Link className="community-title" to={isFreeBoardClick?`/freepage/${post.boardId}`:`/sharepage/${post.boardId}`}>
{post.title}
</Link>
</div>
<div className="community-post-list-down">

Expand Down
11 changes: 11 additions & 0 deletions cafeflow/src/components/QnAList/QnAList.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,17 @@ table {
gap: 10px;
}

/* 추가 */

.profile-img{
width:15px;
height:15px;
background-image: url("../../icons/Account_circle.png");
background-size: cover;
background-position: center center;
margin-right:2px;
}

/* 모바일 버전 */
@media (max-width: 768px) {
.aaa {
Expand Down
89 changes: 44 additions & 45 deletions cafeflow/src/components/QnAList/QnAList.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,57 +133,56 @@ const QnAList = ({ chatId }) => {
</div>
</div>
{/* <div className="divider1"></div> */}
<table>
<tbody>
<div className="divider2">
</div>
<div className="board-container">
{/* map 함수를 이용하여 questions에 들어가있는 배열 가져오기 */}
{questions.map((question) => (
// console.log(question),
<tr key={question.questionId}>
<div className="oneTr">
<div className="leftside">
<td className="questionId">{question.questionId}</td>
<div className="titleBox">
<td className="title">
<Link to={`/questions/${question.questionId}`}>
{question.title}
</Link>
</td>
<td>{question.content}</td>
<div>
<ul className="post-list" key={question.boardId}>
<li className="community-post-list">

<div className="community-post-list-up">
<div>
<img className="profile-img"/>
<span className="community-createdBy">{question.createdBy}</span>
<span className="community-createdAt"> 작성 : {formatDate(question.createdAt)}</span>
</div>
</div>
<div className="rightside">
<div className="nicknameBox">
<td onClick={() => handleAuthorClick(question.createdBy)}>
<h2 className="createdBy">{question.createdBy}</h2>
</td>
{token &&
isDropdownVisible &&
nickname !== question.createdBy && (
<div className="dropdown">
<button
className="chatbutton123"
onClick={() => startChat(nickname, question)}
>
1:1 채팅하기
</button>
</div>
)}
<div>
<img className="viewCountImg" src={ViewCount}></img>
<span className="viewCountSpan">{question.viewCount}</span>
</div>
<td className="createdAt">
<span className="createdBy">
{formatDate(question.createdAt)}
</span>
</td>
<td className="viewCount">
<img src={ViewCount}></img>
{question.viewCount}
</td>

</div>
<div className="community-post-list-middle">
<Link to={`/questions/${question.questionId}`}>
{question.title}
</Link>
</div>
</div>
</tr>
<div className="community-post-list-down">

</div>
</li>

</ul>
<div className="divider2">
</div>
</div>

))}
</tbody>
</table>
<div className="pageNum">
{/* <button
className="preButton" onClick={() => setPageNum((prevPageNum) => prevPageNum - 1)}
disabled={pageNum === 0}
>
</button>
<span className="pageNumber">{pageNum+1}/300</span>
<button className="nextButton" onClick={() => setPageNum((prevPageNum) => prevPageNum + 1)}>
</button> */}
</div>
</div>


<div className="pageNum">
<button
onClick={() => setPageNum((prevPageNum) => prevPageNum - 1)}
Expand Down
Binary file added cafeflow/src/icons/Account_circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7267182

Please sign in to comment.