Skip to content

Commit 1e24247

Browse files
authored
Merge pull request #36 from pythonkr/develop
후원사 상세 페이지 스타일 변경
2 parents 143c6b9 + 660cfc9 commit 1e24247

File tree

9 files changed

+15357
-10346
lines changed

9 files changed

+15357
-10346
lines changed

.github/workflows/dev-cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
- name: Build
3838
run: |
39-
yarn build
39+
yarn build:dev
4040
4141
- name: Deploy
4242
run: |

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
"@testing-library/user-event": "^13.5.0",
1919
"axios": "^1.6.8",
2020
"dotenv": "^16.4.5",
21+
"env-cmd": "^10.1.0",
2122
"hamburger-react": "^2.5.1",
2223
"react": "^18.2.0",
2324
"react-dom": "^18.2.0",
2425
"react-error-boundary": "^4.0.13",
2526
"react-helmet": "^6.1.0",
27+
"react-markdown": "^9.0.1",
2628
"react-redux": "^9.1.0",
2729
"react-router": "^6.22.3",
2830
"react-router-dom": "^6.22.3",
@@ -34,14 +36,12 @@
3436
"web-vitals": "^2.1.4"
3537
},
3638
"scripts": {
37-
"start": "react-scripts start",
38-
"start:prod": "react-scripts start",
39-
"build": "react-scripts build",
40-
"build:prod": "react-scripts build",
41-
"prestart": "./scripts/set_dev.sh",
42-
"prestart:prod": "./scripts/set_prod.sh",
43-
"prebuild": "chmod +x ./scripts/set_dev.sh || ./scripts/set_dev.sh",
44-
"prebuild:prod": "chmod +x ./scripts/set_prod.sh || ./scripts/set_prod.sh"
39+
"start": "env-cmd -f ./.env.local react-scripts start",
40+
"start:dev": "env-cmd -f ./.env.development react-scripts start",
41+
"start:prod": "env-cmd -f ./.env.production react-scripts start",
42+
"build": "env-cmd -f ./.env.local react-scripts build --profile",
43+
"build:dev": "env-cmd -f ./.env.development react-scripts build --profile",
44+
"build:prod": "env-cmd -f ./.env.production react-scripts build"
4545
},
4646
"eslintConfig": {
4747
"extends": [

src/components/Footer/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ const Footer = () => {
7575
{/* <section className="right"></section> */}
7676
</div>
7777
<div className="footer-fixed-section">
78-
<section className="left">{t("파이콘 한국 행동 강령")} (CoC)</section>
78+
<section className="left">
79+
<a href="https://pythonkr.github.io/pycon-code-of-conduct/ko/coc/a_intent_and_purpose.html">
80+
{t("파이콘 한국 행동 강령")} (CoC)
81+
</a>
82+
</section>
7983
<section className="right">
8084
<a href="mailto:[email protected]">
8185
<Email />

src/components/Nav/menus.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ const Menus: MenuType = {
3535
},
3636
{
3737
name: "건강 관련 안내",
38-
onClick: ({ setOpenMenu }) => {
39-
setOpenMenu(false)
40-
window.open("/about/health", "_blank")
41-
}
38+
path: "/about/health",
4239
},
4340
// {
4441
// name: "파이콘 한국 준비위원회",
@@ -87,13 +84,13 @@ const Menus: MenuType = {
8784
setOpenMenu(false)
8885
}
8986
},
90-
// {
91-
// name: "세션 시간표",
92-
// onClick: ({ setOpenMenu, navigate }) => {
93-
// navigate?.("/session/timetable")
94-
// setOpenMenu(false)
95-
// }
96-
// },
87+
{
88+
name: "세션 시간표",
89+
onClick: ({ setOpenMenu, navigate }) => {
90+
navigate?.("/session/timetable")
91+
setOpenMenu(false)
92+
}
93+
},
9794
],
9895
},
9996
sponsoring: {

src/pages/About/coc.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import React, { useEffect } from "react";
22
import Page from "components/common/Page";
33

44
const CocPage = () => {
5-
useEffect(() => {
6-
window.location.href = "https://2023.pycon.kr/coc/purpose"
7-
}, [])
8-
return <Page title="Code Of Conduct"></Page>;
9-
}
5+
useEffect(() => {
6+
window.location.href =
7+
"https://pythonkr.github.io/pycon-code-of-conduct/ko/coc/a_intent_and_purpose.html";
8+
}, []);
9+
return <Page title="Code Of Conduct"></Page>;
10+
};
1011

11-
export default CocPage;
12+
export default CocPage;

src/pages/Session/detail.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { wrap } from '@suspensive/react'
22
import React from "react"
3+
import Markdown from 'react-markdown'
34
import * as R from 'remeda'
45

56
import { SloganShort } from 'assets/icons'
@@ -19,7 +20,7 @@ const SessionSpeakerItem: React.FC<{ speaker: APIPretalxSessions[0]['speakers'][
1920
</SessionSpeakerImageContainerStyled>
2021
<div>
2122
<h3>{speaker.name}</h3>
22-
<p>{speaker.biography}</p>
23+
<Markdown>{speaker.biography}</Markdown>
2324
</div>
2425
</SessionSpeakerItemStyled>
2526
)
@@ -62,7 +63,7 @@ const SessionDetail: React.FC<{ session: APIPretalxSessions[0] }> = ({ session }
6263
</SessionInfoContainerStyled>
6364
<hr />
6465
<h3>{t('설명')}</h3>
65-
<p>{session.description}</p>
66+
<Markdown>{session.description}</Markdown>
6667
<hr />
6768
<h3>{t('발표자 소개')}</h3>
6869
{session.speakers.map(speaker => <SessionSpeakerItem speaker={speaker} key={speaker.code} />)}
@@ -76,6 +77,8 @@ export const SessionDetailPage: React.FC = () => {
7677
const { code } = useParams<{ code: string }>()
7778
const navigate = useNavigate()
7879

80+
React.useEffect(() => window.scrollTo(0, 0), [])
81+
7982
if (!(R.isString(code) && !R.isEmpty(code))) {
8083
navigate('/session')
8184
return null
@@ -135,7 +138,7 @@ const SessionSpeakerItemStyled = styled.div`
135138
display: flex;
136139
flex-direction: row;
137140
justify-content: flex-start;
138-
align-items: center;
141+
align-items: flex-start;
139142
gap: 0.75rem;
140143
141144
h3 {

src/pages/Session/timetable.tsx

Lines changed: 81 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { wrap } from '@suspensive/react'
22
import React from "react"
3+
import * as R from 'remeda'
34
import styled from 'styled-components'
45

56
import Page from "components/common/Page"
@@ -8,6 +9,12 @@ import { useNavigate } from 'react-router'
89
import { useListSessionsQuery } from 'utils/hooks/useAPI'
910
import useTranslation from "utils/hooks/useTranslation"
1011

12+
const ENABLE_DETAILS = false
13+
14+
const TD_HEIGHT = 2.5
15+
const TD_WIDTH = 12.5
16+
const TD_WIDTH_MOBILE = 20
17+
1118
type TimeTableData = {
1219
[date: string]: {
1320
[time: string]: {
@@ -83,10 +90,11 @@ const getTimeTableData: (data: APIPretalxSessions) => TimeTableData = (data) =>
8390
return timeTableData
8491
}
8592

86-
const SessionColumn: React.FC<{ rowSpan: number, session: APIPretalxSessions[0] }> = ({ rowSpan, session }) => {
93+
const SessionColumn: React.FC<{ rowSpan: number, colSpan?: number, session: APIPretalxSessions[0] }> = ({ rowSpan, colSpan, session }) => {
8794
const navigate = useNavigate()
88-
return <td rowSpan={rowSpan}>
89-
<SessionBox onClick={() => navigate(`/session/${session.code}`)}>
95+
const clickable = ENABLE_DETAILS && R.isArray(session.speakers) && !R.isEmpty(session.speakers)
96+
return <td rowSpan={rowSpan} colSpan={colSpan}>
97+
<SessionBox onClick={() => clickable && navigate(`/session/${session.code}`)} className={clickable ? 'clickable' : ''}>
9098
<h6>{session.title}</h6>
9199
<SessionSpeakerContainer>
92100
{session.speakers.map((speaker) => <kbd key={speaker.code}>{speaker.name}</kbd>)}
@@ -95,15 +103,6 @@ const SessionColumn: React.FC<{ rowSpan: number, session: APIPretalxSessions[0]
95103
</td>
96104
}
97105

98-
const BreakColumn: React.FC<{ colSpan: number, hideText?: boolean }> = ({ colSpan, hideText }) => {
99-
const t = useTranslation()
100-
return <td colSpan={colSpan}>
101-
<small style={{ color: 'rgba(255, 255, 255, 0.5)' }}>{!hideText && t('휴식')}</small>
102-
</td>
103-
}
104-
105-
const BlankColumn: React.FC = () => <td></td>
106-
107106
export const SessionTimeTablePage: React.FC = () => {
108107
const t = useTranslation()
109108

@@ -123,11 +122,13 @@ export const SessionTimeTablePage: React.FC = () => {
123122
const timeTableData = getTimeTableData(data)
124123
const dates = Object.keys(timeTableData).sort((a, b) => new Date(a).getTime() - new Date(b).getTime())
125124
const rooms: { [room: string]: number } = getRooms(data).reduce((acc, room) => ({ ...acc, [room]: 0 }), {})
126-
const sortedRoomList = Object.keys(rooms).sort()
127125
const roomCount = Object.keys(rooms).length
126+
const sortedRoomList = Object.keys(rooms).sort()
128127

129128
const selectedDate = confDate || dates[0]
130129
const selectedTableData = timeTableData[selectedDate]
130+
131+
let breakCount = 0
131132
return <>
132133
<hr />
133134
<SessionDateTabContainer>
@@ -151,24 +152,59 @@ export const SessionTimeTablePage: React.FC = () => {
151152
<tr><td colSpan={roomCount + 1}></td></tr>
152153
{
153154
Object.entries(selectedTableData).map(([time, roomData], i, a) => {
155+
const hasSession = Object.values(rooms).some((c) => c >= 1) || Object.values(roomData).some((room) => room !== undefined)
156+
157+
if (!hasSession) {
158+
if (breakCount > 1) {
159+
breakCount--
160+
return <tr></tr>
161+
} else {
162+
// 지금부터 다음 세션이 존재하기 전까지의 휴식 시간을 계산합니다.
163+
breakCount = 1
164+
for (let bi = i + 1; bi < a.length; bi++) {
165+
if (Object.values(a[bi][1]).some((room) => room !== undefined)) break
166+
breakCount += 1
167+
}
168+
169+
// I really hate this, but I can't think of a better way to do this.
170+
const height = TD_HEIGHT * breakCount / (breakCount <= 2 ? 1 : 3)
171+
return <tr>
172+
<td style={{ height: `${height}rem`, transform: `translateY(-${height / 2}rem)` }}>{time}</td>
173+
<td colSpan={roomCount + 1} rowSpan={breakCount} style={{ height: `${height}rem` }}>
174+
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center' }}>
175+
{i !== a.length - 1 && <small style={{ color: 'rgba(255, 255, 255, 0.5)' }}>{t('휴식')}</small>}
176+
</div>
177+
</td>
178+
</tr>
179+
}
180+
}
181+
182+
// 만약 세션 타입이 아닌 발표가 존재하는 경우, 해당 줄에서는 colSpan이 roomCount인 column을 생성합니다.
183+
const nonSessionTypeData = Object.values(roomData).find((room) => room !== undefined && room.session.submission_type.en !== 'Session')
184+
if (nonSessionTypeData) {
185+
Object.keys(rooms).forEach((room) => rooms[room] = nonSessionTypeData.rowSpan - 1)
186+
return <tr>
187+
<td>{time}</td>
188+
<SessionColumn rowSpan={nonSessionTypeData.rowSpan} colSpan={roomCount} session={nonSessionTypeData.session} />
189+
</tr>
190+
}
191+
154192
return <tr>
155193
<td>{time}</td>
156194
{
157-
Object.values(rooms).some((c) => c >= 1) || Object.values(roomData).some((room) => room !== undefined)
158-
? sortedRoomList.map((room) => {
159-
const roomDatum = roomData[room]
160-
if (roomDatum === undefined) {
161-
// 진행 중인 세션이 없는 경우, 해당 줄에서는 해당 room의 빈 column을 생성합니다.
162-
if (rooms[room] <= 0) return <BlankColumn />
163-
// 진행 중인 세션이 있는 경우, 이번 줄에서는 해당 세션들만큼 column을 생성하지 않습니다.
164-
rooms[room] -= 1
165-
return null
166-
}
167-
// 세션이 여러 줄에 걸쳐있는 경우, n-1 줄만큼 해당 room에 column을 생성하지 않도록 합니다.
168-
if (roomDatum.rowSpan > 1) rooms[room] = roomDatum.rowSpan - 1
169-
return <SessionColumn key={room} rowSpan={roomDatum.rowSpan} session={roomDatum.session} />
170-
})
171-
: <BreakColumn colSpan={roomCount} hideText={i === a.length - 1} />
195+
sortedRoomList.map((room) => {
196+
const roomDatum = roomData[room]
197+
if (roomDatum === undefined) {
198+
// 진행 중인 세션이 없는 경우, 해당 줄에서는 해당 room의 빈 column을 생성합니다.
199+
if (rooms[room] <= 0) return <td></td>
200+
// 진행 중인 세션이 있는 경우, 이번 줄에서는 해당 세션들만큼 column을 생성하지 않습니다.
201+
rooms[room] -= 1
202+
return null
203+
}
204+
// 세션이 여러 줄에 걸쳐있는 경우, n-1 줄만큼 해당 room에 column을 생성하지 않도록 합니다.
205+
if (roomDatum.rowSpan > 1) rooms[room] = roomDatum.rowSpan - 1
206+
return <SessionColumn key={room} rowSpan={roomDatum.rowSpan} session={roomDatum.session} />
207+
})
172208
}
173209
</tr>
174210
})
@@ -189,9 +225,6 @@ export const SessionTimeTablePage: React.FC = () => {
189225
)
190226
}
191227

192-
const TD_HEIGHT = 2.5
193-
const TD_WIDTH = 12.5
194-
195228
const SessionDateTabContainer = styled.div`
196229
display: flex;
197230
gap: 2rem;
@@ -262,6 +295,17 @@ const SessionTable = styled.table`
262295
max-width: ${TD_WIDTH}vw;
263296
border-top: 1px solid rgba(255, 255, 255, 0.1);
264297
}
298+
299+
small {
300+
font-size: 0.8rem;
301+
}
302+
303+
@media only screen and (max-width: 810px) {
304+
td:not(:first-child) {
305+
width: ${TD_WIDTH_MOBILE}vw;
306+
max-width: ${TD_WIDTH_MOBILE}vw;
307+
}
308+
}
265309
`
266310

267311
const SessionBox = styled.div`
@@ -272,19 +316,21 @@ const SessionBox = styled.div`
272316
flex-direction: column;
273317
justify-content: center;
274318
align-items: center;
275-
border: 1px solid rgba(176, 168, 254, 0.75);
319+
border: 1px solid rgba(176, 168, 254, 0.3);
276320
border-radius: 0.5rem;
277321
278322
background-color: rgba(176, 168, 254, 0.1);
279323
font-size: 1rem;
280324
transition: all 0.25s ease;
281325
282-
cursor: pointer;
326+
&.clickable {
327+
cursor: pointer;
328+
}
283329
284330
h6 {
285331
margin: 0;
286332
color: rgba(255, 255, 255, 0.6);
287-
font-size: 0.9rem;
333+
font-size: 0.8rem;
288334
transition: all 0.25s ease;
289335
}
290336
@@ -300,6 +346,7 @@ const SessionBox = styled.div`
300346
}
301347
302348
&:hover {
349+
border: 1px solid rgba(176, 168, 254, 0.75);
303350
background-color: rgba(176, 168, 254, 0.25);
304351
transition: all 0.25s ease;
305352

src/pages/Sponsor/SponsorDetail.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ const SponsorDetail: React.FC<{ sponsor: APISponsor }> = ({ sponsor }) => {
1515
<a href={sponsor.url}>
1616
<LogoImage src={sponsor.logo_image} alt={sponsor.name} />
1717
</a>
18-
<H3 dangerouslySetInnerHTML={{ __html: sponsor.desc }}></H3>
18+
<H3
19+
dangerouslySetInnerHTML={{ __html: sponsor.desc }}
20+
style={{ maxWidth: "70%", display: "block" }}
21+
/>
1922
</Vertical>
2023
);
2124
};
@@ -90,7 +93,20 @@ const H1 = styled.h1`
9093
const H3 = styled.h3`
9194
margin-top: 1.5rem;
9295
font-size: 24px;
93-
color: white;
96+
color: #c2c7d0;
97+
98+
& > p,
99+
span {
100+
font-size: 24px !important;
101+
color: #c2c7d0 !important;
102+
text-align: left;
103+
104+
& > p,
105+
span {
106+
font-size: 24px !important;
107+
color: #c2c7d0 !important;
108+
}
109+
}
94110
95111
@media only screen and (max-width: 810px) {
96112
padding: 0 1rem;

0 commit comments

Comments
 (0)