diff --git a/src/components/organisms/Home/DiscussedTopics.tsx b/src/components/organisms/Home/DiscussedTopics.tsx
index 5fcf5183..b9e0a3bd 100644
--- a/src/components/organisms/Home/DiscussedTopics.tsx
+++ b/src/components/organisms/Home/DiscussedTopics.tsx
@@ -7,7 +7,7 @@ import { topicData } from "@/dummy/topicData";
import { TalkingTopicState } from "@/recoil/atoms";
// import { TalkingTopicState } from "@/recoil/atoms";
-const title = "광장이 지금\n얘기하고 있는 주제";
+const title = "광장이 이야기하는\n사회 이슈";
const DiscussedTopics = () => {
const bottomData = useRecoilValue(TalkingTopicState);
console.log("bbb", bottomData);
@@ -28,7 +28,16 @@ const DiscussedTopics = () => {
))}
);
diff --git a/src/components/organisms/Home/LoginTopic.tsx b/src/components/organisms/Home/LoginTopic.tsx
index 4794c502..be0c9bcf 100644
--- a/src/components/organisms/Home/LoginTopic.tsx
+++ b/src/components/organisms/Home/LoginTopic.tsx
@@ -10,10 +10,28 @@ import { CategoryFilter } from "@/components/molecules/categoryFilter";
import { MySubscribeData } from "@/dummy/MySubscribeData";
export const LoginTopic = () => {
+ // const [arr, setArr] = useState([]);
+ // const [a, setA] = useState("");
+
+ // const [b, setB] = useState("");
+ // const [c, setC] = useState("");
+
+ // useEffect(() => {
+ // getget()
+ // .then((res) => {
+ // console.log(res.data.data.subscribeResList);
+ // setA(res.data.data.subscribeResList[0]?.issue);
+ // setB(res.data.data.subscribeResList[1]?.issue);
+ // setC(res.data.data.subscribeResList[2]?.issue);
+ // })
+ // .catch((err) => {
+ // console.log(err);
+ // });
+ // }, []);
return (
-
+
{" "}
diff --git a/src/components/organisms/Home/MainContent.tsx b/src/components/organisms/Home/MainContent.tsx
index 5282480b..7991591d 100644
--- a/src/components/organisms/Home/MainContent.tsx
+++ b/src/components/organisms/Home/MainContent.tsx
@@ -9,9 +9,11 @@ import { ContentsPopularState } from "@/recoil/atoms";
import { Inner } from "@/style/global";
export const MainContent = () => {
+
// const firstData = contentData[0];
const title = "지금 사람들이\n가장 많이 본 콘텐츠";
+
const contentsData = useRecoilValue(ContentsPopularState);
console.log("dfdf", contentsData);
const firstData = contentsData[0];
diff --git a/src/components/organisms/Home/MainTopic.tsx b/src/components/organisms/Home/MainTopic.tsx
index 3cd4ad1a..b31cc9e8 100644
--- a/src/components/organisms/Home/MainTopic.tsx
+++ b/src/components/organisms/Home/MainTopic.tsx
@@ -9,7 +9,7 @@ import { MainTopState } from "@/recoil/atoms";
import { Inner } from "@/style/global";
export const MainTopic = () => {
- const title = "가장 인기있는\n주제";
+ const title = " 광장에서 가장\n인기 있는 사회 이슈";
const mainTopicData = useRecoilValue(MainTopState);
console.log(mainTopicData);
diff --git a/src/dummy/MySubscribeData.ts b/src/dummy/MySubscribeData.ts
index f5c6886e..8429942f 100644
--- a/src/dummy/MySubscribeData.ts
+++ b/src/dummy/MySubscribeData.ts
@@ -1,26 +1,17 @@
export const MySubscribeData = [
{
id: 8,
- url: "환경",
- title: "후쿠시마 오염수",
- imgUrl: "",
- type: "safsdjafliej",
- pubDate: "환경",
+ area: "환경",
+ subject: "후쿠시마 오염수",
},
{
- id: 8,
- url: "환경",
- title: "후쿠시마 오염수",
- imgUrl: "",
- type: "safsdjafliej",
- pubDate: "환경",
+ id: 2,
+ area: "환경",
+ subject: "후쿠시마 오염수",
},
{
- id: 8,
- url: "환경",
- title: "후쿠시마 오염수",
- imgUrl: "",
- type: "safsdjafliej",
- pubDate: "환경",
+ id: 3,
+ area: "환경",
+ subject: "후쿠시마 오염수",
},
];
diff --git a/src/pages/DetailCommunityPage.tsx b/src/pages/DetailCommunityPage.tsx
index f82088cc..3aef7d2c 100644
--- a/src/pages/DetailCommunityPage.tsx
+++ b/src/pages/DetailCommunityPage.tsx
@@ -1,6 +1,6 @@
import { useState, useEffect } from "react";
-import { useParams } from "react-router";
+import { useParams } from "react-router-dom";
import { getCommunityDetailData } from "@/apis";
import { CommentList } from "@/components/organisms/DetailCommunity/CommentList";
@@ -19,7 +19,7 @@ const DetailCommunityPage = () => {
setDetailData(res.data.data);
})
.catch((err) => console.log(err));
- }, []);
+ }, [communityId, topicId]);
return (
<>
diff --git a/src/pages/DetailPage.tsx b/src/pages/DetailPage.tsx
index b2f5851c..8f620fc0 100644
--- a/src/pages/DetailPage.tsx
+++ b/src/pages/DetailPage.tsx
@@ -1,11 +1,13 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
-import { useEffect } from "react";
+import { useEffect, useState } from "react";
import { useParams } from "react-router-dom";
-import { useRecoilValue, useSetRecoilState } from "recoil";
+import { useRecoilValue, useSetRecoilState, useRecoilState } from "recoil";
import styled from "styled-components";
-import { getDetailOneLineIntro, getDetailSubscribeCount } from "@/apis";
+import { getDetailOneLineIntro, getDetailSubscribeCount, getRandomIssue } from "@/apis";
+import Loading from "@/components/atoms/Loading";
+import ChallengeToast from "@/components/atoms/toast";
import { BubbleGraph } from "@/components/organisms/Details/BubbleGraph";
import { CommunityPreview } from "@/components/organisms/Details/CommunityPreview";
import { DetailArticleTitle } from "@/components/organisms/Details/DetailArticleTitle";
@@ -17,16 +19,24 @@ import { QuotModal } from "@/components/organisms/Modal/QuotModal";
//import { bubbleDummydata } from "@/dummy/bubbleData";
import { detailTitleData } from "@/dummy/detailTitleData";
//import { lineDummydata } from "@/dummy/lineData";
-import { similartopicData } from "@/dummy/similartopicData";
-import { ShowModalState, bubbleGraphState, detailTitleState } from "@/recoil/atoms";
+import {
+ ShowModalState,
+ ToastState,
+ bubbleGraphState,
+ detailTitleState,
+ loadingState,
+} from "@/recoil/atoms";
//import { BubbleGraphProps } from "@/types";
const DetailPage = () => {
//모달 show 여부
const Show = useRecoilValue(ShowModalState);
+ const Toast = useRecoilValue(ToastState);
const setDetailTitle = useSetRecoilState(detailTitleState);
const setBubbleGraphData = useSetRecoilState(bubbleGraphState);
const { id } = useParams();
+ const [loading, setLoading] = useRecoilState(loadingState);
+ const [similar, setSimilar] = useState([]);
useEffect(() => {
const name = decodeURI(decodeURIComponent(id || ""));
@@ -52,6 +62,7 @@ const DetailPage = () => {
oneline: objectTitle.issueDetail,
id: objectTitle.issueId,
});
+ setLoading(false);
})
.catch((err) => {
console.log(err);
@@ -61,42 +72,44 @@ const DetailPage = () => {
console.log(err);
setDetailTitle(detailTitleData);
});
- // getDetailBubbleGraph(name)
- // .then((res) => {
- // console.log(res.data.data);
- // const obj = [...res.data.data];
- // const RealObj = obj.map((item: any) => {
- // return Object.freeze(item);
- // });
- // setBubbleGraphData(RealObj);
- // })
- // .catch((err) => {
- // console.log(err);
- // setBubbleGraphData(bubbleDummydata);
- // });
- }, [id, setBubbleGraphData, setDetailTitle]);
+ getRandomIssue()
+ .then((res) => {
+ console.log(res.data.data);
+ setSimilar(res.data.data);
+ })
+ .catch((err) => {
+ console.log(err);
+ });
+ }, [id, setBubbleGraphData, setDetailTitle, setLoading]);
return (
<>
-
-
-
-
-
-
- {window.innerWidth > 800 ? (
- <>
-
-
- >
- ) : (
- <>
-
-
- >
- )}
-
- {Show ? : ""}
+ {Toast ? : ""}
+ {!loading ? (
+ <>
+
+
+
+
+
+
+ {window.innerWidth > 800 ? (
+ <>
+
+
+ >
+ ) : (
+ <>
+
+
+ >
+ )}
+
+ {Show ? : ""}
+ >
+ ) : (
+
+ )}
>
);
};
diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx
index f34e5c25..2521d4ad 100644
--- a/src/pages/Home.tsx
+++ b/src/pages/Home.tsx
@@ -11,7 +11,7 @@ import {
} from "@/apis";
import BubbleChart from "@/components/organisms/Home/BubbleChart";
import DiscussedTopics from "@/components/organisms/Home/DiscussedTopics";
-import { LoginTopic } from "@/components/organisms/Home/LoginTopic";
+// import { LoginTopic } from "@/components/organisms/Home/LoginTopic";
import { MainCommunity } from "@/components/organisms/Home/MainCommunity";
import { MainContent } from "@/components/organisms/Home/MainContent";
import { MainTopic } from "@/components/organisms/Home/MainTopic";
@@ -96,7 +96,7 @@ const Home = () => {
{/* 여러가지 메인에 들어갈 organism들 */}
- {!localStorage.getItem("accessToken") ? : }
+ {!localStorage.getItem("accessToken") ? : ""}
diff --git a/src/recoil/atoms/index.ts b/src/recoil/atoms/index.ts
index e2d8fe4e..e132f2a3 100644
--- a/src/recoil/atoms/index.ts
+++ b/src/recoil/atoms/index.ts
@@ -131,6 +131,18 @@ export const topDateState = atom({
default: "",
});
+
+export const ToastState = atom({
+ // 주제뱔 상세페이지 접속시, 쿼리스트링의 영역값을 저장
+ key: "src/atoms/auth.tsx-ToastState ",
+ default: false,
+});
+
+export const subscriber = atom({
+ // 주제뱔 상세페이지 접속시, 쿼리스트링의 영역값을 저장
+ key: "src/atoms/auth.tsx-subscriber ",
+ default: 0,
+});
export const TalkingTopicState = atom({
key: "src/atoms/auth.tsx-TalkingTopicState",
default: [],
@@ -154,4 +166,5 @@ export const ContentsPopularState = atom({
export const PopularCommunityState = atom({
key: "src/atoms/auth.tsx-PopularCommunityState",
default: [],
+
});
diff --git a/src/types/index.ts b/src/types/index.ts
index dd81f9dd..f697d43d 100644
--- a/src/types/index.ts
+++ b/src/types/index.ts
@@ -125,6 +125,14 @@ export interface ArticleDataProps {
type: string;
url: string;
} // 좋아요 수 넣기
+export interface ArticleData1Props {
+ id: number;
+ url: string;
+ title: string;
+ imgUrl: string;
+ type: string;
+ pubDate: string;
+} // 좋아요 수 넣기
export interface ArticleItemProps {
title: string;
@@ -181,14 +189,27 @@ export interface CommentItemProps {
}
export interface SimilarTopicesProps {
id: number;
- topic: string;
- item: SimilarTopicProps[];
+ communityText: string;
+ date: string;
+ writerId: string;
+ nickname: string;
+ profileImg: string;
+ area: string;
+ subject: string;
+ keyword: string;
+ likeCount: number;
+ commentCount: number;
+ contentsId: number;
+ contents: null;
+ contentsTitle: string;
+ contentsUrl: string;
+ likeStatus: string;
+ quotText: string;
}
export interface SimilarTopicProps {
- subscribeCount: number;
- topic: string;
- area: string;
+ issueTitle: string;
+ topicTitle: string;
}
export interface ToptopicProps {
id: number;
@@ -260,6 +281,12 @@ export interface BubbleGraphProps {
name: string;
}
+
+export interface CommentProps {
+ topicId: number;
+ communityId: number;
+ talk?: string;
+
export interface FirstTopicProps {
topicId: number;
topicTitle: string;