-
Notifications
You must be signed in to change notification settings - Fork 3
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
[FE] Issue sidebar component #229
Merged
moaikang
merged 3 commits into
boostcamp-2020:dev-web
from
moaikang:feature/web/issue-sidebar
Nov 9, 2020
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,24 @@ | ||
import React, {useState} from 'react' | ||
import * as S from './style' | ||
|
||
interface IssueSideBarItemProps { | ||
menuName: string, | ||
children: React.ReactNode | ||
} | ||
|
||
export default function IssueSideBarItem({menuName, children} : IssueSideBarItemProps) { | ||
const [isHover, setIsHover] = useState<boolean>(false); | ||
|
||
return ( | ||
<S.ItemWrapper> | ||
<S.ItemHead> | ||
<S.MenuName onMouseEnter={() => setIsHover(true)} onMouseLeave={() => setIsHover(false)} isHover={isHover}>{menuName}</S.MenuName> | ||
<S.SettingIcon onMouseEnter={() => setIsHover(true)} onMouseLeave={() => setIsHover(false)} isHover={isHover}/> | ||
</S.ItemHead> | ||
|
||
<S.ItemBody> | ||
{children} | ||
</S.ItemBody> | ||
</S.ItemWrapper> | ||
) | ||
} | ||
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,38 @@ | ||
import styled from 'styled-components'; | ||
import {Settings} from '@styled-icons/ionicons-sharp/Settings'; | ||
|
||
export const SettingIcon = styled(Settings)<{isHover: boolean}>` | ||
display: block; | ||
color: ${props => props.isHover ? '#5490E2' : 'grey'}; | ||
|
||
width: 15px; | ||
height: 15px; | ||
`; | ||
|
||
export const ItemWrapper = styled.div` | ||
padding: 10px; | ||
|
||
|
||
width: 280px; | ||
`; | ||
|
||
export const ItemHead = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
|
||
margin-bottom: 10px; | ||
|
||
box-sizing: border-box; | ||
`; | ||
|
||
export const MenuName = styled.div<{isHover: boolean}>` | ||
color: ${props => props.isHover ? '#5490E2' : '#555'}; | ||
font-weight: 700; | ||
`; | ||
|
||
export const ItemBody = styled.div` | ||
padding-bottom: 20px; | ||
|
||
border-bottom : 1px solid #ccc; | ||
`; |
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,51 @@ | ||
import React from 'react' | ||
import * as S from './style'; | ||
import ProfileImage from '../../profile-image'; | ||
import IssueSideBarItem from '../item'; | ||
|
||
interface AsigneeProfileProps { | ||
userName:string, | ||
img: string | ||
} | ||
|
||
function AssigneeProfile ({userName, img} : AsigneeProfileProps) { | ||
return ( | ||
<S.AssigneeProfileWrapper> | ||
<ProfileImage img={img} size={20}/> | ||
<S.AssigneeName>{userName}</S.AssigneeName> | ||
</S.AssigneeProfileWrapper> | ||
) | ||
} | ||
|
||
interface LabelProps { | ||
name: string, | ||
color: string | ||
} | ||
|
||
function Label({name, color} :LabelProps) { | ||
return ( | ||
<S.LabelWrapper color={color}>{name}</S.LabelWrapper> | ||
) | ||
} | ||
|
||
|
||
export default function IssueSideBar() { | ||
return ( | ||
<> | ||
<IssueSideBarItem menuName="Assignees"> | ||
<div> | ||
<AssigneeProfile userName="moaikang" img=""/> | ||
<AssigneeProfile userName="moaikang" img=""/> | ||
</div> | ||
</IssueSideBarItem> | ||
|
||
<IssueSideBarItem menuName="Labels"> | ||
<Label name="라벨" color="#A3EEEF"/> | ||
</IssueSideBarItem> | ||
|
||
<IssueSideBarItem menuName="Milestone"> | ||
<div>Progress Commponent</div> | ||
</IssueSideBarItem> | ||
</> | ||
) | ||
} |
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 styled from 'styled-components'; | ||
|
||
export const AssigneeProfileWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
|
||
margin-bottom: 7px; | ||
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. pixel 로 margin 을 설정하면 화면 크기에 따라 모양이 바뀌지 않을까요? |
||
` | ||
|
||
export const AssigneeName = styled.div` | ||
margin-left: 10px; | ||
|
||
font-weight: 700; | ||
color: #333; | ||
`; | ||
|
||
export const LabelWrapper = styled.div<{color: string}>` | ||
padding: 6px 5px; | ||
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. 여기도 margin 부분과 마찬가지 입니다 |
||
|
||
border-radius: 6px; | ||
|
||
background: ${props => props.color}; | ||
|
||
font-weight: 700; | ||
|
||
box-sizing:border-box; | ||
`; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
childeren 을 받아서 재활용 할 수 있어서 좋은 것 같습니다!