Skip to content

Commit

Permalink
Merge branch 'develop' into feat/#84/SearchAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
hoyyChoi committed Nov 23, 2023
2 parents 7dccdd1 + 59fb24e commit cd0bb0b
Show file tree
Hide file tree
Showing 43 changed files with 947 additions and 291 deletions.
83 changes: 81 additions & 2 deletions src/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const GwangjangAxios = axios.create({
baseURL: "https://api.gwang-jang.co.kr",
});

//로그인 및 회원가입
export const postLocalLogin = async ({ id, pw }: loginType) => {
const res = await GwangjangAxios.post("/member/auth/signIn", { id, pw });
return res;
Expand Down Expand Up @@ -77,16 +78,62 @@ export const putKakaoRegister = async ({
return res;
};

// 메인페이지
export const getMainBubbleChart = async () => {
const res = await GwangjangAxios.get("/keyword/main");
return res;
};

// 디테일페이지
export const getDetailOneLineIntro = async () => {
const res = await GwangjangAxios.get(`/keyword/topic/issueDetail/all`);
return res;
};

export const getDetailLineGraph = async (name: string) => {
const res = await GwangjangAxios.get(`/keyword/trend/${name}`);
return res;
};

export const getDetailSubscribeCount = async (issueId: number) => {
const res = await GwangjangAxios.get(`/member/subscribe/issue/${issueId}`);
return res;
};

export const getDetailBubbleGraph = async (name: string) => {
const res = await GwangjangAxios.get(`/contents/bubbleChart/${name}`);
return res;
};

export const getKeywordArticle = async (keyword: string) => {
const res = await GwangjangAxios.get(`/contents/keyword/${keyword}/NAVER`);
return res;
};
export const getKeywordYoutube = async (keyword: string) => {
const res = await GwangjangAxios.get(`/contents/keyword/${keyword}/YOUTUBE`);
return res;
};
export const getTopicArticle = async (issue: string) => {
const res = await GwangjangAxios.get(`/contents/issueTitle/${issue}/NAVER`);
return res;
};
export const getTopicYoutube = async (issue: string) => {
const res = await GwangjangAxios.get(`/contents/issueTitle/${issue}/YOUTUBE`);
return res;
};

// 커뮤니티 페이지
export const getCommunityAllData = async () => {
const res = await GwangjangAxios.get("/community");
const res = await GwangjangAxios.get("/community/");
return res;
};

export const getCommunityAreaData = async (topicId: number) => {
export const getCommunityAreaData = async (topicId: string) => {
const res = await GwangjangAxios.get(`/community/topic/${topicId}`);
return res;
};


//검색 페이지

export const getSearch = async (keyword: string) => {
Expand All @@ -96,5 +143,37 @@ export const getSearch = async (keyword: string) => {

export const getSearchCommunity = async (keyword: string) => {
const res = await GwangjangAxios.get(`/community/search/ALL/${keyword}`);
};
export const postCommunityItem = async (
contentsId: number,
writeText: string,
accessToken: string
) => {
const res = await GwangjangAxios.post(
`/community/contents/${contentsId}`,
{
communityText: writeText,
},
{
headers: {
Authorization: `Bearer ${accessToken}`,
},
}
);
return res;
};

export const getSubscribeTop5 = async () => {
const res = await GwangjangAxios.get("/member/subscribe/issue");
return res;
};

export const getCommunityDetailData = async (topicId: number, communityId: number) => {
const res = await GwangjangAxios.get(`/community/topic/${topicId}/community/${communityId}`);
return res;
};

export const getCommunityTop5 = async () => {
const res = await GwangjangAxios.get("/community/?sortBy=ALL/");
return res;
};
9 changes: 1 addition & 8 deletions src/components/atoms/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,13 @@ export const LikeBorderButton = ({
);
};

export const QuotBorderButton = ({
onClick,
quotCount,
}: {
onClick?: () => void;
quotCount: number;
}) => {
export const QuotBorderButton = ({ onClick }: { onClick?: () => void }) => {
//인용 버튼 클릭 시 모달창 오픈

return (
<>
<BorderStyleButton onClick={onClick}>
<div>인용</div>
<p>{quotCount}</p>
</BorderStyleButton>
</>
);
Expand Down
6 changes: 4 additions & 2 deletions src/components/atoms/oneLine/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ export const Container = styled.div`
display: flex;
border-radius: 5px;
background: var(--Gray3_200, #eee);
width: fit-content;
/* width: fit-content; */
height: 20px;
padding: 17px 20px;
padding: 22px 20px;
line-height: 27px;
align-items: center;
.title {
display: flex;
align-items: center;
color: var(--Gray6_500, #959595);
width: 80px;
}
.title::after {
content: "";
Expand All @@ -26,6 +27,7 @@ export const Container = styled.div`
.text {
color: var(--Gray9_800, #424242);
width: 900px;
}
@media (max-width: 650px) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/atoms/tag/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export const TopicTag = ({ category }: { category: string }) => {
return <Tag $category={category}>{category}</Tag>;
};

export const KeywordTag = ({ category }: { category: string }) => {
return <Keyword $category={category}>{category}</Keyword>;
export const KeywordTag = ({ category, children }: { category: string; children: string }) => {
return <Keyword $category={category}>{children}</Keyword>;
};
12 changes: 7 additions & 5 deletions src/components/atoms/tag/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ export const Tag = styled.div<{ $category: string }>`
align-items: center;
border-radius: 55px;
background: ${(props) =>
props.$category === "일자리·노동"
props.$category === "일자리-노동"
? "var(--Main_Blue)"
: props.$category === "주거"
: props.$category === "주거-사회안전망"
? "var(--Sub_Purple)"
: props.$category === "환경"
? "var(--Main_NeonGreen)"
: "var(--Sub_Orange)"};
: props.$category === "교육"
? "var(--Sub_Orange)"
: "white"};
//text
color: var(--Gray1_50, #fafafa);
Expand All @@ -31,9 +33,9 @@ export const Keyword = styled.div<{ $category: string }>`
align-items: center;
border-radius: 55px;
color: ${(props) =>
props.$category === "일자리·노동"
props.$category === "일자리-노동"
? "var(--Main_Blue)"
: props.$category === "주거"
: props.$category === "주거-사회안전망"
? "var(--Sub_Purple)"
: props.$category === "환경"
? "var(--Main_NeonGreen)"
Expand Down
4 changes: 2 additions & 2 deletions src/components/molecules/PreviewCommunityBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const PreviewCommunityBox = ({ data }: { data: CommunityItemProps }) => {
</div>
<div className="top-second-wrapper">
<div>
<KeywordTag category={data.area} />
<KeywordTag category={data.area}>{data.keyword}</KeywordTag>
</div>
<div className="button-wrapper">
<LikeBorderButton
Expand All @@ -33,7 +33,7 @@ export const PreviewCommunityBox = ({ data }: { data: CommunityItemProps }) => {
</div>
<div className="bottom-content">
<div>인용한 콘텐츠</div>
<p>{data.quotText}</p>
<p>{data.contentsTitle}</p>
</div>
</CommunityDetailContainer>
</>
Expand Down
Loading

0 comments on commit cd0bb0b

Please sign in to comment.