Skip to content

Commit 585cee2

Browse files
committed
개인 후원자 목록 반영
1 parent cbc5991 commit 585cee2

File tree

8 files changed

+50
-9
lines changed

8 files changed

+50
-9
lines changed

frontend/components/service/Home/PersonListItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const PersonListItem = (props: { item: IPerson }) => {
4747

4848
return (
4949
<PersonContainer>
50-
<PersonProfile image={item.image || DEFAULT_PROFILE_PATH} />
50+
<PersonProfile image={item?.image || DEFAULT_PROFILE_PATH} />
5151
<PersonInfo>
5252
<PersonName>{item.name}</PersonName>
5353
<PersonIntro>

frontend/interfaces/IProgram.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface ITalkList {
1717
}
1818

1919
export interface IPerson {
20-
image: string
20+
image?: string
2121
name: string
2222
introduction: string
2323
}

frontend/interfaces/api/IApiSponsor.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ export interface IApiSponsorDetail {
2929
created_at: string
3030
updated_at: string
3131
}
32+
33+
export interface IPatrons {
34+
name: string
35+
message: string
36+
}

frontend/locales/en/label.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,8 @@ export default {
6666
organizingTeamInfo:
6767
"PyCon Korea Organizing Team is an open community of Pythonistas recruiting new members every year. PyCon Korea Organizing Team was first organized in 2014 and we're preparing our 8th PyCon in Korea.",
6868
staffList: 'PyCon Korea Organizing Team (Ordered alphabetically in Korean)',
69-
staffListInfo: 'PyCon Korea 2020 is being prepared by the following people.'
69+
staffListInfo:
70+
'PyCon Korea 2020 is being prepared by the following people.',
71+
patronInfo:
72+
'Meet PyCon Korea 2022 individual sponsors. Thanks for your support.'
7073
}

frontend/locales/ko/label.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,7 @@ export default {
7373
organizingTeamInfo:
7474
'파이콘 한국 준비위원회는 2014년 조직되어, 올해 아홉 번째 한국에서의 파이콘 행사를 준비하고 있습니다. 준비위원회는 매년 신규 멤버를 모집하는 파이콘을 사랑하는 사람들의 열린 모임입니다.',
7575
staffList: '준비위원회 명단(가나다순)',
76-
staffListInfo: '파이콘 한국 2020는 다음과 같은 사람들이 준비하고 있습니다.'
76+
staffListInfo: '파이콘 한국 2020는 다음과 같은 사람들이 준비하고 있습니다.',
77+
patronInfo:
78+
'파이콘 한국 2022를 후원해주신 개인 후원자 분들의 명단입니다. 후원해주셔서 감사합니다.'
7779
}

frontend/locales/ko/pageTitle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default {
1717
[PageName.CfpGuide]: '발표안 작성 가이드',
1818
[PageName.Sponsor]: '후원하기',
1919
[PageName.SponsorList]: '후원사 목록',
20-
[PageName.SponsorPatrons]: '개인 후원자',
20+
[PageName.SponsorPatrons]: '개인 후원자 목록',
2121
[PageName.SponsorProspectus]: '후원사 안내',
2222
[PageName.SponsorJoin]: '후원사로 참여하기',
2323
[PageName.SponsorBenefit]: '후원사 혜택 설명',

frontend/pages/api/sponsor.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { IApiContents } from '../../interfaces/api/IApiContents'
44
import { API_SERVER } from '../../data/constants/config'
55
import {
66
IApiSponsorDetail,
7-
IApiSponsorListItem
7+
IApiSponsorListItem,
8+
IPatrons
89
} from '../../interfaces/api/IApiSponsor'
910
import { ISponsorDetail, ISponsorList } from '../../interfaces/ISponsor'
1011

@@ -46,3 +47,8 @@ export const getSponsorContentData = async (
4647
}
4748
}
4849
}
50+
51+
export const getPatronData = async (): Promise<IPatrons[]> => {
52+
const response = await axios.get(`${API_SERVER}/sponsor/personal`)
53+
return response.data
54+
}

frontend/pages/sponsor/patrons.tsx

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,47 @@ import { useTranslation } from 'react-i18next'
44
import { PageName } from '../../data/enums/PageName'
55
import PageTitle from '../../components/core/PageTitle'
66
import { PageProps } from '../../interfaces/PageProps'
7+
import PersonListItem from '../../components/service/Home/PersonListItem'
8+
import { IPatrons } from '../../interfaces/api/IApiSponsor'
9+
import { getPatronData } from '../api/sponsor'
10+
import { IPerson } from '../../interfaces/IProgram'
11+
import { Heading3 } from '../../assets/styles/typo'
12+
import styled from 'styled-components'
713

8-
const Patrons: NextPage = (props: PageProps) => {
14+
const PageInfo = styled.div`
15+
margin: 2rem 0 3rem;
16+
`
17+
18+
interface PatronsProps extends PageProps {
19+
list: IPerson[]
20+
}
21+
22+
const Patrons: NextPage = (props: PatronsProps) => {
923
const { t } = useTranslation()
1024

1125
return (
1226
<div>
1327
<PageTitle title={props.pageName} />
14-
{t('label:preparing')}
28+
<PageInfo>{t('label:patronInfo')}</PageInfo>
29+
{props.list.map((item, index) => (
30+
<PersonListItem key={`patron-${index}`} item={item} />
31+
))}
1532
</div>
1633
)
1734
}
1835

1936
export const getServerSideProps: GetServerSideProps = async () => {
37+
const list: IPatrons[] = await getPatronData()
38+
39+
const formattedList: IPerson[] = list.map((item) => ({
40+
name: item.name,
41+
introduction: item.message
42+
}))
43+
2044
return {
2145
props: {
22-
title: PageName.SponsorPatrons
46+
title: PageName.SponsorPatrons,
47+
list: formattedList
2348
}
2449
}
2550
}

0 commit comments

Comments
 (0)