Skip to content

Commit

Permalink
팀 배치시 팀페이지 내 팀 인원 확인 (#147) (#148)
Browse files Browse the repository at this point in the history
* Remove: team url 제거하기

* Rename: GDSC -> GDG로 이름 변경

* Design: CSS 내용 추가

* Feat: TeamList 및 멤버 리스트 API 구현

* Feat: 드롭다운 공용컴포넌트 구현

* Feat: Team Title 반응형 전부 구현

* Feat: TeamData type 설정

* Remove: MetaData 제거

* Feat: Team Member 및 Team Name설정

* Feat: Team Content 최종 설정

* Feat: 새 Core Member 추가하기
  • Loading branch information
KimKyuHoi authored Sep 20, 2024
1 parent 5626727 commit 12087c6
Show file tree
Hide file tree
Showing 36 changed files with 597 additions and 68 deletions.
27 changes: 27 additions & 0 deletions src/apis/hooks/team/useGetTeamList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { fetchInstance } from '@gdsc/apis/instance/Api_JWT';

import { useQuery, UseQueryResult } from '@tanstack/react-query';

export type TeamList = {
id: number;
teamName: string;
};

const getTeamListPath = () => '/api/team';

const teamListQueryKey = [getTeamListPath()];

const getTeamList = async () => {
const response = await fetchInstance.get(getTeamListPath());
return response.data;
};

export const useGetTeamList = (): UseQueryResult<TeamList[], Error> => {
const accessToken = sessionStorage.getItem('accessToken');

return useQuery<TeamList[], Error>({
queryKey: teamListQueryKey,
queryFn: getTeamList,
enabled: !!accessToken,
});
};
23 changes: 23 additions & 0 deletions src/apis/hooks/team/useGetTeamMate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { fetchInstance } from '@gdsc/apis/instance/Api_JWT';

import type { TeamData } from '@gdsc/types/TeamData.type';
import { useQuery, UseQueryResult } from '@tanstack/react-query';

const getTeamMatePath = (teamId: number) => `/api/team/${teamId}/member`;

const getTeamMate = async (teamId: number) => {
const response = await fetchInstance.get(getTeamMatePath(teamId));
return response.data;
};

export const useGetTeamMate = (
teamId: number
): UseQueryResult<TeamData[], Error> => {
const accessToken = sessionStorage.getItem('accessToken');

return useQuery<TeamData[], Error>({
queryKey: [getTeamMatePath(teamId)],
queryFn: () => getTeamMate(teamId),
enabled: !!accessToken,
});
};
Binary file added src/assets/gdgknu.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 src/assets/gdscknu4/Core-Chaewon.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 src/assets/gdscknu4/Core-Jeongmin.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 src/assets/gdscknu4/Core-Yeongin.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/gdscknu4/Core-Yeongin.jpg
Binary file not shown.
123 changes: 123 additions & 0 deletions src/components/common/dropdown/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import { useEffect, useState } from 'react';

import HdDropDown from '@gdsc/assets/HdDropDown.svg';
import HdDropUp from '@gdsc/assets/HdDropUp.svg';

import type { TeamList } from '@gdsc/apis/hooks/team/useGetTeamList';

import styled from '@emotion/styled';

type DropDownProps = {
options: TeamList[];
onSelect: (option: TeamList) => void;
};

const DropDown = ({ options, onSelect }: DropDownProps) => {
const [isOpen, setIsOpen] = useState(false);
const [selectedOption, setSelectedOption] = useState<TeamList | null>(
options && options.length > 0 ? options[0] : null
);

const toggleDropDown = () => setIsOpen((prev) => !prev);
const handleOptionClick = (option: TeamList) => {
setSelectedOption(option);
onSelect(option);
setIsOpen(false);
};

useEffect(() => {
if (options && options.length > 0 && !selectedOption) {
setSelectedOption(options[0]);
onSelect(options[0]);
}
}, [options, selectedOption, onSelect]);

return (
<DropDownContainer>
<DropDownBox onClick={toggleDropDown}>
<DropDownText>{selectedOption?.teamName || 'Select Team'}</DropDownText>
<img src={isOpen ? HdDropUp : HdDropDown} alt='toggle dropdown' />
</DropDownBox>

<DropDownList isOpen={isOpen}>
{(options || []).map((option) => (
<DropDownItem
key={option.id}
onClick={() => handleOptionClick(option)}
>
{option.teamName}
</DropDownItem>
))}
</DropDownList>
</DropDownContainer>
);
};

export default DropDown;

const DropDownContainer = styled.div`
position: relative;
width: 100%;
`;

const DropDownBox = styled.div`
background: rgba(255, 255, 255, 0.15);
border-radius: 16px;
box-shadow: 0 5px 30px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(0px);
-webkit-backdrop-filter: blur(0px);
width: calc(100% - 26px);
height: 15px;
padding: 14px 13px;
display: flex;
align-items: center;
justify-content: space-between;
cursor: pointer;
`;

const DropDownText = styled.span`
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-size: var(--font-size-sm);
`;

interface DropDownListProps {
isOpen: boolean;
}

const DropDownList = styled.ul<DropDownListProps>`
background: white;
border-radius: 12px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
margin-top: 8px;
position: absolute;
width: 100%;
z-index: 10;
list-style: none;
padding: 0;
opacity: ${({ isOpen }) => (isOpen ? '1' : '0')};
overflow-y: auto;
transition:
max-height 0.3s ease,
opacity 0.3s ease;
`;

const DropDownItem = styled.li`
padding: 12px;
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: var(--color-halti);
font-size: var(--font-size-sm);
border-bottom: 1px solid var(--color-santas);
margin: 0 auto;
&:hover {
background-color: rgba(0, 0, 0, 0.05);
}
&:last-of-type {
border-bottom: 0px;
}
`;
2 changes: 1 addition & 1 deletion src/components/common/title/PageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const PageTitle = ({
<Text size='lg' weight='bold'>
{SubTitle}
</Text>
<Text>GDSC KNU</Text>
<Text>GDG on Campus KNU</Text>
</SubTitleLayout>
</MainTitlelayout>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/feature/auth/AuthModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const AuthModal: React.FC<ISignModal> = ({ title, text, children }) => {
};

//title: GDSC 로그인
//text: Google 계정을 이용하여 GDSC knu에 로그인하세요
//text: Google 계정을 이용하여 GDG on Campus KNU에 로그인하세요
//children: 로그인버튼 컴포넌트

export default AuthModal;
2 changes: 1 addition & 1 deletion src/components/feature/footer/MainFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const MainFooter = () => {
<Display>
<TextBorder>
<Text color='white' size='md'>
GDSC KNU
GDG on Campus KNU
</Text>
</TextBorder>
<Table>
Expand Down
2 changes: 1 addition & 1 deletion src/components/feature/footer/MainFooterMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const MobileFooterMobile = () => {
<Display>
<TextBorder>
<Text color='white' size='md'>
GDSC KNU
GDG on Campus KNU
</Text>
</TextBorder>
<Table>
Expand Down
2 changes: 1 addition & 1 deletion src/components/feature/header/admin/AdminTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const AdminTitle = () => {
<Text size='lg' weight='bold'>
Admin Page
</Text>
<Text size='sm'>GDSC KNU</Text>
<Text size='sm'>GDG on Campus KNU</Text>
</SubtitleTextContainer>
<Text size='xxl' weight='bold'>
{getTitle(pathName.pathname)}
Expand Down
20 changes: 10 additions & 10 deletions src/pages/apply/components/ApplyDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export const FrontendData = {
],
event: [
'격주마다 온라인 세미나 참여할 수 있어요.',
'GDSC KOR나 GDSC KNU가 기획 및 운영하는 이벤트에 참여할 수 있어요.',
'GDSC KNU에서 진행하는 프로젝트에 참여할 수 있어요.',
'GDSC KOR나 GDG on Campus KNU가 기획 및 운영하는 이벤트에 참여할 수 있어요.',
'GDG on Campus KNU에서 진행하는 프로젝트에 참여할 수 있어요.',
],
};

Expand All @@ -52,8 +52,8 @@ export const BackendData = {
],
event: [
'격주마다 온라인 세미나 참여할 수 있어요.',
'GDSC KOR나 GDSC KNU가 기획 및 운영하는 이벤트에 참여할 수 있어요.',
'GDSC KNU에서 진행하는 프로젝트에 참여할 수 있어요.',
'GDSC KOR나 GDG on Campus KNU가 기획 및 운영하는 이벤트에 참여할 수 있어요.',
'GDG on Campus KNU에서 진행하는 프로젝트에 참여할 수 있어요.',
],
};

Expand All @@ -79,8 +79,8 @@ export const AIData = {
],
event: [
'격주마다 온라인 세미나 참여할 수 있어요.',
'GDSC KOR나 GDSC KNU가 기획 및 운영하는 이벤트에 참여할 수 있어요.',
'GDSC KNU에서 진행하는 프로젝트에 참여할 수 있어요.',
'GDSC KOR나 GDG on Campus KNU가 기획 및 운영하는 이벤트에 참여할 수 있어요.',
'GDG on Campus KNU에서 진행하는 프로젝트에 참여할 수 있어요.',
],
};

Expand Down Expand Up @@ -108,8 +108,8 @@ export const AndroidData = {
],
event: [
'격주마다 온라인 세미나 참여할 수 있어요.',
'GDSC KOR나 GDSC KNU가 기획 및 운영하는 이벤트에 참여할 수 있어요.',
'GDSC KNU에서 진행하는 프로젝트에 참여할 수 있어요.',
'GDSC KOR나 GDG on Campus KNU가 기획 및 운영하는 이벤트에 참여할 수 있어요.',
'GDG on Campus KNU에서 진행하는 프로젝트에 참여할 수 있어요.',
],
};

Expand All @@ -135,7 +135,7 @@ export const DesignerData = {
],
event: [
'격주마다 온라인 세미나 참여할 수 있어요.',
'GDSC KOR나 GDSC KNU가 기획 및 운영하는 이벤트에 참여할 수 있어요.',
'GDSC KNU에서 진행하는 프로젝트에 참여할 수 있어요.',
'GDSC KOR나 GDG on Campus KNU가 기획 및 운영하는 이벤트에 참여할 수 있어요.',
'GDG on Campus KNU에서 진행하는 프로젝트에 참여할 수 있어요.',
],
};
4 changes: 2 additions & 2 deletions src/pages/apply/components/ApplyEx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const ApplyEx = () => {
<TitleLayout>
<SubLayout>
<SubTitle color=' var(--color-white)'>To Apply</SubTitle>
<Explain>GDSC KNU</Explain>
<Explain>GDG on Campus KNU</Explain>
</SubLayout>
<TitleWrapper>
<MainTitle color=' var(--color-white)'>{data.korean}</MainTitle>
Expand Down Expand Up @@ -189,7 +189,7 @@ const ApplyEx = () => {
<TitleLayout>
<SubLayout>
<SubTitle color=' var(--color-white)'>To Apply</SubTitle>
<Explain>GDSC KNU</Explain>
<Explain>GDG on Campus KNU</Explain>
</SubLayout>
<TitleWrapper>
<MainTitle color=' var(--color-white)'>{data.korean}</MainTitle>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/apply/components/ApplyForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const ApplyForm = () => {
<TitleLayout>
<SubLayout>
<SubTitle color=' var(--color-white)'>To Apply</SubTitle>
<Explain>GDSC KNU</Explain>
<Explain>GDG on Campus KNU</Explain>
</SubLayout>
<TitleWrapper>
<MainTitle color=' var(--color-white)'>{data?.korean}</MainTitle>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/apply/components/ApplyFormDocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const DesignerData = {
sub: '프로젝트 말고도 본인이 겪었던 문제 상황과 어떻게 해결한 방법에 대해 적어주세요.',
},
Question4: {
main: 'GDSC KNU에서 디자이너로서 어떤 것을 얻어가고 싶으신가요?',
main: 'GDG on Campus KNU에서 디자이너로서 어떤 것을 얻어가고 싶으신가요?',
sub: '디자이너로 활동하면서 얻고 싶은 것이나 이루고 싶은 목표에 대해 적어주세요.',
},
};
2 changes: 1 addition & 1 deletion src/pages/apply/components/ApplyNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ApplyNav = () => {
<MainTitle color=' var(--color-white)'>지원하기</MainTitle>
<SubLayout>
<SubTitle color=' var(--color-white)'>To Apply</SubTitle>
<Explain>GDSC KNU</Explain>
<Explain>GDG on Campus KNU</Explain>
</SubLayout>
<Explain>각 분야별로 선택해서 지원을 해주세요.</Explain>
<InquiryLayout>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/apply/components/ApplyNavEnd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const ApplyNavEnd = () => {
<MainTitle color=' var(--color-white)'>지원하기</MainTitle>
<SubLayout>
<SubTitle color=' var(--color-white)'>To Apply</SubTitle>
<Explain>GDSC KNU</Explain>
<Explain>GDG on Campus KNU</Explain>
</SubLayout>
<Explain>각 분야별로 선택해서 지원을 해주세요.</Explain>
<InquiryLayout>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/apply/components/ApplySaveForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const ApplySaveForm = ({ SaveData }: ApplySaveFormProps) => {
<TitleLayout>
<SubLayout>
<SubTitle color=' var(--color-white)'>To Apply</SubTitle>
<Explain>GDSC KNU</Explain>
<Explain>GDG on Campus KNU</Explain>
</SubLayout>
<TitleWrapper>
<MainTitle color=' var(--color-white)'>{data?.korean}</MainTitle>
Expand Down
16 changes: 15 additions & 1 deletion src/pages/introduce/components/CoreTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import { useEffect } from 'react';
import gsap from 'gsap';

import Bosung from '@gdsc/assets/gdscknu4/Core-Bosung.jpg';
import Chaewon from '@gdsc/assets/gdscknu4/Core-Chaewon.png';
import Daegun from '@gdsc/assets/gdscknu4/Core-Daegun.jpg';
import Dongpil from '@gdsc/assets/gdscknu4/Core-Dongpil.jpg';
import Kangmin from '@gdsc/assets/gdscknu4/Core-Gangmin.jpeg';
import Hyunmin from '@gdsc/assets/gdscknu4/Core-Hyeonmin.jpeg';
import Jaeyong from '@gdsc/assets/gdscknu4/Core-Jaeyong.jpg';
import Jeongmin from '@gdsc/assets/gdscknu4/Core-Jeongmin.png';
import Suhyeon from '@gdsc/assets/gdscknu4/Core-Suhyeon.jpg';
import Yeongin from '@gdsc/assets/gdscknu4/Core-Yeongin.jpg';
import Yeongin from '@gdsc/assets/gdscknu4/Core-Yeongin.jpeg';
import Kyuhoi from '@gdsc/assets/gdscknu4/Lead-Kyuhoi.png';

import { IntroText, IntroTextStyle } from '@gdsc/styles/IntroduceStyle';
Expand Down Expand Up @@ -114,6 +116,12 @@ const CoreTable = () => {
<IntroText>김대건</IntroText>
</TableTextLayout>
</CoreBox>
<CoreBox backgroundImage={Chaewon}>
<TableStatusText>CORE-FE</TableStatusText>
<TableTextLayout>
<IntroText>신채원</IntroText>
</TableTextLayout>
</CoreBox>
<CoreBox backgroundImage={Suhyeon}>
<TableStatusText>CORE-BE</TableStatusText>
<TableTextLayout>
Expand All @@ -132,6 +140,12 @@ const CoreTable = () => {
<IntroText>윤재용</IntroText>
</TableTextLayout>
</CoreBox>
<CoreBox backgroundImage={Jeongmin}>
<TableStatusText>CORE-BE</TableStatusText>
<TableTextLayout>
<IntroText>채정민</IntroText>
</TableTextLayout>
</CoreBox>
<CoreBox backgroundImage={Bosung}>
<TableStatusText>CORE-AI</TableStatusText>
<TableTextLayout>
Expand Down
4 changes: 3 additions & 1 deletion src/pages/introduce/components/FieldEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ const FieldEvent = () => {
<GDSCText>Recruitment Field Composition</GDSCText>
</RecruitFieldBox>
<RecruitIntroBox>
<IntroText>GDSC KNU는 5가지 직렬로 구성되어 있습니다.</IntroText>
<IntroText>
GDG on Campus KNU는 5가지 직렬로 구성되어 있습니다.
</IntroText>
</RecruitIntroBox>
</FieldLayout>
);
Expand Down
Loading

0 comments on commit 12087c6

Please sign in to comment.