diff --git a/src/Lounge/LoungeDetail.tsx b/src/Lounge/LoungeDetail.tsx
index 7c30965..623e0ee 100644
--- a/src/Lounge/LoungeDetail.tsx
+++ b/src/Lounge/LoungeDetail.tsx
@@ -93,67 +93,6 @@ function Community() {
{commun.contents}
- {/*
- {Community.map((text: string, index: number) => (
-
-
- 이름
-
-
- {heart ? : }
-
- /
-
- /
-
-
-
-
-
- {text}
-
- ))}
-
- {Reply.map((Text2: string, index: number) => (
-
-
-
-
- 이름
-
-
- {heart ? : }
-
- /
-
-
- {Text2}
-
-
- ))}
-
- {Change && (
- <>
-
- 대댓글 쓰기
- >
- )}
- */}
-
- {/*
-
- 답장하기
- */}
@@ -170,8 +109,8 @@ const CommunityComponent = styled.div`
`;
const CommunityBox = styled.div`
- width: 50%;
- min-height: 90vh;
+ width: 950px;
+ min-height: 100vh;
padding-top: 30px;
margin-top: 70px;
padding-bottom: 30px;
@@ -185,12 +124,24 @@ const CommunityBox = styled.div`
`;
const CommunityDetail = styled.div`
- width: 80%;
+ width: 750px;
border-radius: 25px;
padding: 50px;
height: 500px;
background-color: white;
`;
+const Detailtop = styled.div`
+ display: flex;
+ height: 70px;
+ justify-content: space-between;
+`;
+
+const Detailtitle = styled.div`
+ font-size: 25px;
+`;
+
+const Detailname = styled.div``;
+const Detailcomponent = styled.div``;
const Communityinput = styled.input`
height: 70px;
@@ -238,19 +189,6 @@ const Communityanswer = styled.div`
background-color: white;
`;
-const Detailtop = styled.div`
- display: flex;
- height: 70px;
- justify-content: space-between;
-`;
-
-const Detailtitle = styled.div`
- font-size: 25px;
-`;
-
-const Detailname = styled.div``;
-const Detailcomponent = styled.div``;
-
const Answertop = styled.div`
display: flex;
padding: 10px;
@@ -278,3 +216,69 @@ const Ca = styled.div`
justify-content: space-around;
align-items: center;
`;
+
+{
+ /*
+ {Community.map((text: string, index: number) => (
+
+
+ 이름
+
+
+ {heart ? : }
+
+ /
+
+ /
+
+
+
+
+
+ {text}
+
+ ))}
+
+ {Reply.map((Text2: string, index: number) => (
+
+
+
+
+ 이름
+
+
+ {heart ? : }
+
+ /
+
+
+ {Text2}
+
+
+ ))}
+
+ {Change && (
+ <>
+
+ 대댓글 쓰기
+ >
+ )}
+ */
+}
+
+{
+ /*
+
+ 답장하기
+ */
+}
diff --git a/src/MyPage/MyPage.tsx b/src/MyPage/MyPage.tsx
index c81ec0d..01dc534 100644
--- a/src/MyPage/MyPage.tsx
+++ b/src/MyPage/MyPage.tsx
@@ -10,8 +10,18 @@ interface Frined {
name: string;
}
const MyPage = () => {
- const friendDelete = () => {
+ const friendDelete = async (id: number) => {
+ await axios.delete(`http://localhost:3001/MyPage/${id}`);
alert("삭제되었습니다.");
+ // 삭제 후 친구 목록을 다시 불러와서 상태를 업데이트합니다.
+ axios
+ .get("http://localhost:3001/MyPage")
+ .then((response) => {
+ setFriend(response.data);
+ })
+ .catch((error) => {
+ console.log(error);
+ });
};
const [friend, setFriend] = useState();
@@ -52,7 +62,7 @@ const MyPage = () => {
{fr.name}
친구 페이지
-
+ friendDelete(fr.id)}>
친구 삭제
diff --git a/src/json-server/db.json b/src/json-server/db.json
index 1ba03ba..4478afa 100644
--- a/src/json-server/db.json
+++ b/src/json-server/db.json
@@ -13,11 +13,11 @@
"name": "강서쪽 사람"
},
{
- "id": "3",
+ "id": "5",
"name": "강서쪽 사람"
},
{
- "id": "3",
+ "id": "4",
"name": "강서쪽 사람"
}
],
@@ -376,5 +376,21 @@
]
}
],
- "Posts": []
-}
\ No newline at end of file
+ "Posts": [
+ {
+ "id": "97ff",
+ "content": "asasasasasasasasasasasasasasasasas",
+ "replies": []
+ },
+ {
+ "id": "8a1b",
+ "content": "ㅁㄴㅇㄴㅇㅁㄴㅇㅇㅁㅇㅁㄴ",
+ "replies": []
+ },
+ {
+ "id": "1f45",
+ "content": "ㅁㄴㅇㅁㄴ",
+ "replies": []
+ }
+ ]
+}