-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
407 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/frameworks/web/components/molecules/LectureCard/LectureCard.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react'; | ||
import { withKnobs, text } from '@storybook/addon-knobs'; | ||
import { action } from '@storybook/addon-actions'; | ||
import theme from 'theme'; | ||
import LectureCard from 'frameworks/web/components/molecules/LectureCard/LectureCard'; | ||
|
||
export default { | ||
title: 'Lecture Card', | ||
decorators: [withKnobs], | ||
}; | ||
|
||
export const SimpleLectureCard = () => { | ||
const title = text('Card Title', '프로그래머, 인공지능 시대의 꽤 괜찮은 직업이지 아니한가?'); | ||
const speaker = text('Card Speaker', '박성우'); | ||
|
||
return ( | ||
<div style={{ width: '350px', margin: '20px' }}> | ||
<LectureCard title={title} speaker={speaker} onCardClick={action('card-clicked')} /> | ||
</div> | ||
); | ||
}; | ||
|
||
SimpleLectureCard.story = { | ||
parameters: { | ||
backgrounds: [{ name: 'Snow', value: theme.color.secondary.Snow, default: true }], | ||
}, | ||
}; |
55 changes: 55 additions & 0 deletions
55
src/frameworks/web/components/molecules/LectureCard/LectureCard.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import theme from 'theme'; | ||
|
||
import ContentsBox from 'frameworks/web/components/atoms/ContentsBox/ContentsBox'; | ||
import Label from 'frameworks/web/components/atoms/Label/Label'; | ||
import { ILectureCard } from 'interfaces/frameworks/web/components/molecules/LectureCard/ILectureCard'; | ||
|
||
const CardContainer = styled(ContentsBox)` | ||
width: auto; | ||
height: auto; | ||
padding: 40px 48px; | ||
background-color: white; | ||
text-align: center; | ||
cursor: pointer; | ||
transition: all 0.2s; | ||
@media (hover: hover) { | ||
&:hover { | ||
box-shadow: 0 5px 30px 0 rgba(155, 155, 155, 0.4); | ||
} | ||
} | ||
`; | ||
|
||
const SpeakerContainer = styled.div` | ||
display: flex; | ||
margin-top: 24px; | ||
width: 100%; | ||
justify-content: center; | ||
`; | ||
|
||
export default function LectureCard({ | ||
title, | ||
speaker, | ||
onCardClick, | ||
style, | ||
}: ILectureCard): React.ReactElement { | ||
return ( | ||
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions | ||
<div onClick={() => onCardClick()}> | ||
<CardContainer isDarkBackground style={style}> | ||
<Label type="H4" color={theme.color.primary.Azure}> | ||
{title} | ||
</Label> | ||
<SpeakerContainer> | ||
<Label type="H5" color={theme.color.secondary.Moon} style={{ marginRight: '16px' }}> | ||
강연자 | ||
</Label> | ||
<Label type="P1" color={theme.color.secondary.Moon}> | ||
{speaker} | ||
</Label> | ||
</SpeakerContainer> | ||
</CardContainer> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/frameworks/web/components/organisms/Lecture/LectureList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import React, { ReactNode } from 'react'; | ||
import styled from 'styled-components'; | ||
import { Row, Col } from 'react-grid-system'; | ||
|
||
import { ILectureInfo } from 'interfaces/frameworks/web/components/organisms/Lecture/ILectureList'; | ||
import LectureCard from '../../molecules/LectureCard/LectureCard'; | ||
|
||
const LectureListContainer = styled.div` | ||
width: 100%; | ||
max-width: 1280px; | ||
padding: 48px 85px 90px 85px; | ||
`; | ||
|
||
export default function LectureList(): React.ReactElement { | ||
const lectureArray: ILectureInfo[] = []; | ||
|
||
// TODO: 강연 정보를 불러와야 함 | ||
for (let i = 1; i <= 10; i += 1) { | ||
lectureArray.push({ title: `제목 ${i}`, speaker: '테스트' }); | ||
} | ||
|
||
const onLectureClicked = (idx: number) => { | ||
// TODO: 렉쳐카드 클릭 시 모달이 나오는 함수를 구현해야 함 | ||
console.log(idx); | ||
}; | ||
|
||
function LectureColContainer({ col }: any): React.ReactElement { | ||
const listElement: ReactNode[] = []; | ||
lectureArray.forEach((lecture, i) => { | ||
if (i % 3 === col) { | ||
listElement.push( | ||
<LectureCard | ||
title={lecture.title} | ||
speaker={lecture.speaker} | ||
onCardClick={() => onLectureClicked(i)} | ||
style={{ marginBottom: '30px' }} | ||
/>, | ||
); | ||
} | ||
}); | ||
return <Col>{listElement}</Col>; | ||
} | ||
return ( | ||
<LectureListContainer> | ||
<Row align="start"> | ||
<LectureColContainer col={0} /> | ||
<LectureColContainer col={1} /> | ||
<LectureColContainer col={2} /> | ||
</Row> | ||
</LectureListContainer> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import React, { useState } from 'react'; | ||
import styled from 'styled-components'; | ||
import { Row, Col } from 'react-grid-system'; | ||
|
||
import theme from 'theme'; | ||
import SomulLogo from 'assets/logo/logo-white.svg'; | ||
import SearchButtonAsset from 'assets/icon/search.svg'; | ||
import ListIllustAsset from 'assets/illust/list-illlustration.svg'; | ||
import Label from 'frameworks/web/components/atoms/Label/Label'; | ||
import TextField from 'frameworks/web/components/atoms/TextField/TextField'; | ||
import LectureList from 'frameworks/web/components/organisms/Lecture/LectureList'; | ||
|
||
const LectureHeader = styled.div` | ||
margin-top: 80px; | ||
padding: 23px 0; | ||
display: flex; | ||
justify-content: center; | ||
background-color: ${theme.color.primary.Azure}; | ||
`; | ||
|
||
const LectureHeaderContainer = styled(Row)` | ||
width: 100%; | ||
max-width: 1280px; | ||
padding: 0 85px; | ||
`; | ||
|
||
const LectureHeaderTitle = styled.div` | ||
display: flex; | ||
margin-bottom: 38px; | ||
`; | ||
|
||
const ListIllust = styled.img` | ||
width: 240px; | ||
height: 174px; | ||
`; | ||
|
||
const LectureListContainer = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
background-color: ${theme.color.secondary.Snow}; | ||
`; | ||
|
||
export default function Lecture(): React.ReactElement { | ||
const [searchText, setSearchText] = useState(''); | ||
const handleSearch = () => { | ||
console.log(searchText); | ||
// TODO : 검색 로직 구현 | ||
}; | ||
return ( | ||
<> | ||
<LectureHeader> | ||
<LectureHeaderContainer align="center" justify="between" gutterWidth={0}> | ||
<Col xs={8}> | ||
<LectureHeaderTitle> | ||
<img | ||
src={SomulLogo} | ||
alt="소물 로고" | ||
style={{ width: '138px', height: '24px', margin: '6px 21px 6px 0' }} | ||
/> | ||
<Label type="H4" color={theme.color.primary.White}> | ||
강연 리스트 | ||
</Label> | ||
</LectureHeaderTitle> | ||
<TextField | ||
defaultLabel="검색어를 입력하세요" | ||
onValueChange={(search: string) => setSearchText(search)} | ||
isButton | ||
buttonSrc={SearchButtonAsset} | ||
onButtonClicked={() => handleSearch()} | ||
style={{ width: 'auto' }} | ||
/> | ||
</Col> | ||
<Col xs={3}> | ||
<ListIllust src={ListIllustAsset} alt="일러스트 이미지" /> | ||
</Col> | ||
</LectureHeaderContainer> | ||
</LectureHeader> | ||
<LectureListContainer> | ||
<LectureList /> | ||
</LectureListContainer> | ||
</> | ||
); | ||
} |
6 changes: 6 additions & 0 deletions
6
src/interfaces/frameworks/web/components/molecules/LectureCard/ILectureCard.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export interface ILectureCard { | ||
title: string; | ||
speaker: string; | ||
onCardClick: Function; | ||
style?: object; | ||
} |
5 changes: 5 additions & 0 deletions
5
src/interfaces/frameworks/web/components/organisms/Lecture/ILectureList.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface ILectureInfo { | ||
title: string; | ||
speaker: string; | ||
// 이후 모달 추가시 인터페이스에 내용 추가 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters