Skip to content

Commit

Permalink
Merge pull request #55 from GDSC-DGU/feature/main
Browse files Browse the repository at this point in the history
✨ Feat -  전반적 코드 수정
  • Loading branch information
shimseohyun authored May 16, 2024
2 parents 19e816f + b294f3f commit fada833
Show file tree
Hide file tree
Showing 53 changed files with 1,916 additions and 108 deletions.
1,632 changes: 1,603 additions & 29 deletions package-lock.json

Large diffs are not rendered by default.

Binary file modified public/images/default_member.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/default_project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/main/aboutGDSC_map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/main/ourActivity/demoDay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/main/ourActivity/firstGDSC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/main/ourActivity/solutionChallenge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/main/ourActivity/withU.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/main/storiesFromTheCommunity/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/main/storiesFromTheCommunity/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/main/storiesFromTheCommunity/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/main/storiesFromTheCommunity/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/members/default_member.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/seminar/default_open_seminar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/seminar/default_seminar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions public/svg/icons/common/chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions public/svg/icons/common/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions public/svg/icons/common/col3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions public/svg/icons/common/down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/svg/icons/common/git.svg
10 changes: 10 additions & 0 deletions public/svg/icons/common/left.svg
10 changes: 10 additions & 0 deletions public/svg/icons/common/light.svg
3 changes: 3 additions & 0 deletions public/svg/icons/common/link.svg
11 changes: 11 additions & 0 deletions public/svg/icons/common/part_ai.ml.svg
8 changes: 8 additions & 0 deletions public/svg/icons/common/part_dev.svg
8 changes: 8 additions & 0 deletions public/svg/icons/common/part_devrel.svg
3 changes: 3 additions & 0 deletions public/svg/icons/common/part_lead.svg
3 changes: 3 additions & 0 deletions public/svg/icons/common/part_server.cloud.svg
6 changes: 6 additions & 0 deletions public/svg/icons/common/part_web.app.svg
10 changes: 10 additions & 0 deletions public/svg/icons/common/right.svg
10 changes: 10 additions & 0 deletions public/svg/icons/common/row3.svg
10 changes: 10 additions & 0 deletions public/svg/icons/common/up.svg
3 changes: 3 additions & 0 deletions public/svg/icons/common/youtube.svg
46 changes: 46 additions & 0 deletions src/app/api/member/porojectMember/route.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import { Client } from '@notionhq/client';
import { NextRequest } from 'next/server';

const notion = new Client({
auth: process.env.NOTION_SECRET_KEY,
});


async function queryAllMemberData(): Promise<any[]> {
try {
const response = await notion.databases.query({
database_id: process.env.NOTION_MEMBER_DATABASE_ID || '',
});
return response.results;
} catch (error) {
console.error(JSON.stringify(error));

throw error;
}
}


export async function GET(req: NextRequest) {
try {
const data = await queryAllMemberData();

return new Response(JSON.stringify({ data, message: 'Success' }), {
status: 200,
headers: {
'Content-Type': 'application/json',
},
});
} catch (error) {

return new Response(
JSON.stringify({ message: `Failed: ${error?.toString()}` }),
{
status: 500,
headers: {
'Content-Type': 'application/json',
},
},
);
}
}

35 changes: 26 additions & 9 deletions src/app/api/member/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,51 @@ const notion = new Client({
auth: process.env.NOTION_SECRET_KEY,
});


async function queryAllMemberData(): Promise<any[]> {
// seminar id를 가진 member 불러오기
async function queryMemberData(
databaseId: string,
seminarId: string,
): Promise<any[]> {
try {
const response = await notion.databases.query({
database_id: process.env.NOTION_MEMBER_DATABASE_ID || '',
database_id: databaseId,
filter: {
property: 'Seminars',
relation: {
contains: seminarId,
},
},
});

return response.results;
} catch (error) {
console.error(JSON.stringify(error));

console.error(
'Error querying Notion database and fetching member data:',
JSON.stringify(error),
);
throw error;
}
}

type Data = {
items?: any[];
message: string;
};

export async function GET(req: NextRequest) {
try {
const data = await queryAllMemberData();
const url = new URL(req.url);
const seminarId = url.searchParams.get('seminarId') || ''; // 쿼리 파라미터에서 세미나 ID 가져오기
const databaseId = process.env.NOTION_MEMBER_DATABASE_ID || '';

try {
const data = await queryMemberData(databaseId, seminarId);
return new Response(JSON.stringify({ data, message: 'Success' }), {
status: 200,
headers: {
'Content-Type': 'application/json',
},
});
} catch (error) {

return new Response(
JSON.stringify({ message: `Failed: ${error?.toString()}` }),
{
Expand All @@ -43,4 +61,3 @@ export async function GET(req: NextRequest) {
);
}
}

2 changes: 1 addition & 1 deletion src/app/member/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const MemberPage = () => {
{/* -----------------------------------------------*/}
{/* ----------- 타임라인 및 GDSC세대별 페이지-------------*/}
{/* -----------------------------------------------*/}
<GenerationPage />
{/* <GenerationPage /> */}
</main>
);
};
Expand Down
4 changes: 3 additions & 1 deletion src/app/project/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const ProjectDetailPage = async ({ params }: { params: { id: string } }) => {
}

// 멤버 데이터 불러오기
const memberResponse = await fetch(`${process.env.SERVER_HOST}/api/member`);
const memberResponse = await fetch(
`${process.env.SERVER_HOST}/api/member/projectMember`,
);

const memberList = await memberResponse.json();

Expand Down
8 changes: 4 additions & 4 deletions src/app/recruit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ const RecruitPage = () => {
{/* -----------------------------------------------*/}
{/* -------------------- 인재상 -------------------*/}
{/* -----------------------------------------------*/}
<RecruitRecommand />
{/* <RecruitRecommand /> */}
{/* -----------------------------------------------*/}
{/* -------------------- 모집상 -------------------*/}
{/* -----------------------------------------------*/}
<RecruitTarget />
{/* <RecruitTarget /> */}
{/* -----------------------------------------------*/}
{/* -------------------- 스케쥴 -------------------*/}
{/* -----------------------------------------------*/}
<RecruitSchedule />
{/* <RecruitSchedule /> */}
{/* -----------------------------------------------*/}
{/* -------------------- FAQ ---------------------*/}
{/* -----------------------------------------------*/}
<RecruitFaq />
{/* <RecruitFaq /> */}
</main>
);
};
Expand Down
11 changes: 7 additions & 4 deletions src/components/home/aboutGDSC/AboutGDSC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,18 @@ const AboutGDSC = () => {
<br />
</motion.p>

<motion.div
<motion.a
className="H6 flex gap-1 items-center"
initial="hidden"
whileInView="visible"
viewport={{ once: true, amount: 0.8 }}
variants={aniSlideUp}
href="https://developers.google.com/community/gdsc"
target="_blank"
>
GDSC 소개 바로가기 <div className="w-6 h-6 bg-red-900"></div>
</motion.div>
GDSC 소개 바로가기{' '}
<img className="w-6 h-6" src="/svg/icons/common/right.svg" />
</motion.a>

<motion.div
className="flex gap-10 pt-6"
Expand All @@ -73,7 +76,7 @@ const AboutGDSC = () => {

{/* 이미지 */}
<motion.div
className="desktop:flex-grow desktop:h-[378px] bg-red-100 desktop:w-auto w-full"
className="desktop:flex-grow desktop:h-[378px] desktop:w-auto w-full"
initial="hidden"
whileInView="visible"
viewport={{ once: true, amount: 0.8 }}
Expand Down
Loading

0 comments on commit fada833

Please sign in to comment.