-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
결과 페이지/사이드 메뉴 #12
base: master
Are you sure you want to change the base?
결과 페이지/사이드 메뉴 #12
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { Story, Meta } from '@storybook/react/types-6-0'; | ||
import Card, { CardProps } from './Card'; | ||
|
||
export default { | ||
title: 'Card', | ||
component: Card, | ||
} as Meta; | ||
|
||
const Template: Story<CardProps> = (args) => <Card {...args} />; | ||
|
||
const defaultParams = { | ||
imageSrc:'image', | ||
title:'title', | ||
description:'수원 연합 창작 동아리 그 노래 회원모집', | ||
}; | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = defaultParams; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from 'react'; | ||
import classNames from 'classnames'; | ||
|
||
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> { | ||
imageSrc?:string; | ||
label?:string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. label은 어디세 사용되나요?? |
||
description?:string; | ||
} | ||
function Card({ label, imageSrc,description }: CardProps) { | ||
|
||
|
||
return ( | ||
<div className="col"> | ||
<div className="card border-light"> | ||
<style jsx> | ||
{` | ||
|
||
.card { | ||
width: 146px; | ||
} | ||
|
||
.card-body { | ||
padding: 8px; | ||
} | ||
.card-text { | ||
font-size: 12px; | ||
} | ||
|
||
.card-img-top { | ||
width: 146px; | ||
height: 146px; | ||
background-color: #aaa; | ||
cursor: pointer; | ||
border-radius: 6px; | ||
} | ||
`} | ||
</style> | ||
Comment on lines
+15
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<img src={imageSrc} className="card-img-top" alt="..." /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. alt는 ... 대신 다른걸로 정하는게 좋아보입니다! |
||
<div className="card-body"> | ||
<p className="card-text">{description}</p> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 모든 웹 페이지에서 공통적인 텍스트를 유지할 수 있도록 텍스트는 |
||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default Card; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default } from './Card'; | ||
export type { CardProps } from './Card'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { Story, Meta } from '@storybook/react/types-6-0'; | ||
import Sidebar, { SidebarProps } from './Sidebar'; | ||
|
||
export default { | ||
title: 'Sidebar', | ||
component: Sidebar, | ||
} as Meta; | ||
|
||
const Template: Story<SidebarProps> = (args) => <Sidebar {...args} />; | ||
|
||
const defaultParams = { | ||
title:'title', | ||
}; | ||
|
||
export const Default = Template.bind({}); | ||
Default.args = defaultParams; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import React from 'react'; | ||
|
||
// TODO: 네비게이션에 맞는 이미지 설정 + background-color gui에 맞게 수정 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 주석은 삭제해주세요..! |
||
export interface SidebarProps extends React.HTMLAttributes<HTMLHeadElement> { | ||
title: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. title이라는 props는 sidebar에서 사용되지않고 있어요ㅠ |
||
} | ||
Comment on lines
+4
to
+6
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sidebar는 Head 태그를 사용하고 있지 않아서 Head의 속성을 확장하는것보다는 HTMLDivElement의 속성을 확장하는게 좋아보여요 |
||
const Sidebar = React.forwardRef<HTMLHeadElement, SidebarProps>((props, ref) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ref를 전달하는 재사용가능한 ui 컴포넌트를 만드는게 아니라면 |
||
const { title, ...rest } = props; | ||
|
||
return ( | ||
<div className="sidenav"> | ||
<style jsx> | ||
{` | ||
.sidenav { | ||
width: 260px; | ||
height: 640px; | ||
position: fixed; | ||
z-index: 1; | ||
top: 0px; | ||
left: 0px; | ||
padding:15px; | ||
|
||
|
||
|
||
} | ||
|
||
|
||
.profile-image { | ||
background: #EDEDED 0% 0% no-repeat padding-box; | ||
opacity: 1; | ||
width: 66px; | ||
|
||
height: 66px; | ||
border-radius: 50%; | ||
margin: 10px; | ||
} | ||
.sidebar-line{ | ||
border: 1px solid #CDCDCD; | ||
text-align:center; | ||
margin:8px; | ||
} | ||
.list-group-item{ | ||
border:none; | ||
margin:5px; | ||
font-weight:bold; | ||
|
||
} | ||
span{ | ||
font-size:14px; | ||
|
||
} | ||
`} | ||
</style> | ||
Comment on lines
+12
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. card 컴포넌트와 마찬가지로 |
||
<img className="profile-image" /> | ||
<span> | ||
로그인이 필요합니다 | ||
</span> | ||
<i className='fas fa-angle-right'></i> | ||
|
||
<hr className="sidebar-line"/> | ||
<ul className="list-group"> | ||
<li className="list-group-item">홈</li> | ||
<li className="list-group-item">맞춤 동아리 테스트</li> | ||
<li className="list-group-item">동아리 등록</li> | ||
<li className="list-group-item">등록한 게시물</li> | ||
<li className="list-group-item">스크랩 동아리</li> | ||
<li className="list-group-item">고객센터</li> | ||
<li className="list-group-item">로그인</li> | ||
</ul> | ||
</div> | ||
); | ||
}); | ||
|
||
export default Sidebar; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default } from './Sidebar'; | ||
export type { SidebarProps } from './Sidebar'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,9 @@ router.get('/', (req, res) => { | |
res.render('index', { title: 'Express' }); | ||
}); | ||
|
||
/* GET result page. */ | ||
router.get('/result', (req, res) => { | ||
res.render('result', { title: 'Express' }); | ||
}); | ||
|
||
Comment on lines
+10
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 라우터를 추가한 이유가 있을까요? 🤔 |
||
module.exports = router; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import { Typography, Button, Card } from '@dodam/components'; | ||
|
||
export default function Result() { | ||
const mode = 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. mode를 숫자로 구분하면 1이 어떤 모드를 나타내는지 알기 어려워요 아래 예시처럼 상수를 사용해주세요! const READ_MODE = 1;
const WRITE_MODE = 2;
const mode = READ_MODE; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 그리고 함수 컴포넌트 내부에서 데이터는 |
||
return ( | ||
<> | ||
<div className="result"> | ||
<style jsx> | ||
{` | ||
.result-top { | ||
background-color: #fff6d9; | ||
padding: 50px; | ||
text-align: center; | ||
|
||
height: 289px; | ||
} | ||
|
||
.result-image { | ||
background: #ffffff 0% 0% no-repeat padding-box; | ||
box-shadow: 0px 10px 15px #0000001c; | ||
opacity: 1; | ||
width: 152px; | ||
height: 152px; | ||
border-radius: 50%; | ||
margin: 20px; | ||
} | ||
.result-bottom { | ||
padding: 50px 10px 20px 10px; | ||
} | ||
|
||
.row { | ||
padding: 10px; | ||
} | ||
|
||
.recommendation { | ||
padding: 30px 10px; | ||
} | ||
`} | ||
</style> | ||
Comment on lines
+8
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<div className="result-top"> | ||
<Typography className="header" align="center" variant="h5"> | ||
김도담님은 | ||
</Typography> | ||
<Typography className="header" align="center" variant="h3" weight="bolder"> | ||
이상적인 세상을 | ||
</Typography> | ||
<Typography className="header" align="center" variant="h3" weight="bolder"> | ||
만들어가시는군요! | ||
</Typography> | ||
<img className="result-image" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. alt props를 추가해주세요 |
||
</div> | ||
<div className="result-bottom"> | ||
<Typography weight="bolder">분석 결과</Typography> | ||
<Typography> | ||
상세 분석 결과입니다 상세분석 결과입니다. 상세 분석 결과입니다 상세분석 결과입니다. 상세분석 결과입니다 | ||
상세분석 결과입니다. 분석 결과입니다. 상세 분석 결과입니다 상세분석 결과입니다. 상세 분석 결과입니다 | ||
상세분석 결과입니다. 상세분석 결과입니다 상세분석 결과입니다. 분석 결과입니다. 상세 분석 결과입니다 상세분석 | ||
결과입니다. 상세분석 결과입니다 상세분석 결과입니다. 분석 결과입니다. | ||
</Typography> | ||
<div className="row"> | ||
<Button id="btn-1" outline fullWidth variant="secondary"> | ||
결과 공유 | ||
</Button> | ||
</div> | ||
{mode === 2 && ( | ||
<div className="row"> | ||
<Button id="btn-2" variant="secondary" fullWidth> | ||
동아리 등록 완료 | ||
</Button> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
{mode === 1 && ( | ||
<> | ||
<div className="result-line"></div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. jsx에서는 |
||
<div className="recommendation"> | ||
<Typography className="header" align="center" variant="h5" weight="bolder"> | ||
이 동아리를 추천드려요! | ||
</Typography> | ||
|
||
<div className="row"> | ||
<Card /> | ||
<Card /> | ||
<Card /> | ||
<Card /> | ||
</div> | ||
|
||
<Button fullWidth>더보기</Button> | ||
</div> | ||
</> | ||
)} | ||
Comment on lines
+40
to
+92
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이부분을 컴포넌트 단위로 쪼개면 코드 가독성이 높아질것같아요! |
||
</> | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classNames
는 사용되지 않고 있어요!