Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/kusitms-28th-Meetup-E/FE
Browse files Browse the repository at this point in the history
…into feat/#83/mypage-api
  • Loading branch information
chamny20 committed Nov 23, 2023
2 parents 3c2bcc6 + 2ab2b7d commit 6e93228
Show file tree
Hide file tree
Showing 49 changed files with 1,068 additions and 370 deletions.
96 changes: 94 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,107 @@ 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 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;
};

//검색 페이지

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

export const getSearchCommunity = async (keyword: string) => {
const res = await GwangjangAxios.get(`/community/search/ALL/${keyword}`);
return res;
};

//내가 구독한 주제
export const getMySubscribeData = async (accessToken: string) => {
const res = await GwangjangAxios.get("/member/subscribe", {
Expand Down
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
6 changes: 3 additions & 3 deletions src/components/atoms/tag/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Keyword, Tag } from "./style";

export const TopicTag = ({ category }: { category: string }) => {
export const TopicTag = ({ category }: { category: string | undefined }) => {
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>;
};
14 changes: 8 additions & 6 deletions src/components/atoms/tag/style.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import styled from "styled-components";

export const Tag = styled.div<{ $category: string }>`
export const Tag = styled.div<{ $category: string | undefined }>`
display: inline-flex;
padding: 5px 10px;
justify-content: center;
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 6e93228

Please sign in to comment.