-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Feat] LogPage, HistoryPage 퍼블리싱 및 리스트 컴포넌트 작업 #47
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
15fba08
design(log | history): 컴포넌트 생성 후 퍼블리싱 작업 (#37)
nanafromjeju add169d
style: 공통 컴포넌트 CSS 수정 작업 (#37)
nanafromjeju 1644cff
Merge branch 'develop' of https://github.com/Kernel360/KEDV3_techdom_…
nanafromjeju f29e1ba
style: BaseButton 공통 컴포넌트 padding값 제외 (#37)
nanafromjeju 6170df9
feat(log | history): mockData id 추가 (#37)
nanafromjeju 7ed5f0b
feat(log | history): 차량 데이터 모델 생성 및 타입 분리 (#37)
nanafromjeju 6be4cda
Merge branch 'develop' of https://github.com/Kernel360/KEDV3_techdom_…
nanafromjeju cdbb42b
refactor(log | history): 코드 리뷰 반영 후 컨벤션 적용 (#46)
nanafromjeju 5cfc7bb
refactor(log | history): 중복되는 ListHeader 컴포넌트 통합 (#37)
nanafromjeju 29501e5
chore(log): VehicleRegisterForm 컴포넌트 폴더 이동 (#37)
nanafromjeju ebb70b1
style(history): ListItem 컴포넌트 스타일명 변경 (#37)
nanafromjeju 2288eda
style(log): ListItem 컴포넌트 스타일명 변경 (#37)
nanafromjeju 4882d4e
refactor(log | history): 불필요한 props 제거 (#37)
nanafromjeju 1747f3b
style(log | history): SearchField 스타일 수정 (#37)
nanafromjeju 4aae2de
style: RoundButton 공통 컴포넌트 styleVariants 적용 (#37)
nanafromjeju 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { RightIcon } from '@/public/icons' | ||
import { ListItemModel } from '@/types/history' | ||
|
||
import * as styles from './styles.css' | ||
|
||
interface ListItemProps { | ||
data: ListItemModel | ||
} | ||
|
||
const ListItem = ({ data }: ListItemProps) => { | ||
const { | ||
vehicleNumber, | ||
department, | ||
name, | ||
drivingDays, | ||
averageDrivingDistance, | ||
averageDrivingTime, | ||
totalDrivingDistance, | ||
drivingRate, | ||
} = data | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<div className={styles.itemWrapper}>{vehicleNumber}</div> | ||
<span className={styles.itemWrapper}>{department}</span> | ||
<span className={styles.itemWrapper}>{name}</span> | ||
<span className={styles.itemWrapper}>{drivingDays}일</span> | ||
<span className={styles.itemWrapper}>{averageDrivingDistance}km</span> | ||
<span className={styles.itemWrapper}>{averageDrivingTime}분</span> | ||
<span className={styles.itemWrapper}>{totalDrivingDistance}km</span> | ||
<span className={styles.itemWrapper}>{drivingRate}%</span> | ||
<div className={styles.icon}> | ||
<RightIcon /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default ListItem |
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,23 @@ | ||
import { style } from '@vanilla-extract/css' | ||
|
||
import { styles } from '@/styles/theme.css' | ||
|
||
export const container = style({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
textAlign: 'center', | ||
padding: '24px 0px', | ||
borderBottom: `1px solid ${styles.colors.gray[200]}`, | ||
color: styles.colors.black, | ||
fontWeight: styles.fontWeights.bold, | ||
fontSize: styles.fontSizes.mediumPlus, | ||
}) | ||
|
||
export const itemWrapper = style({ | ||
flex: 1, | ||
}) | ||
|
||
export const icon = style({ | ||
width: '24px', | ||
height: '24px', | ||
}) |
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 |
---|---|---|
@@ -1,5 +1,149 @@ | ||
'use client' | ||
|
||
import ListHeader from '@/components/domain/vehicle/ListHeader' | ||
import SearchField from '@/components/domain/vehicle/SearchField' | ||
import { ListItemModel } from '@/types/history' | ||
|
||
import ListItem from './components/ListItem/index' | ||
import * as styles from './styles.css' | ||
|
||
const HistoryPage = () => { | ||
return <div>HistoryPage</div> | ||
// TODO 실제 데이터로 변경하기 | ||
const mockHistoryData: ListItemModel[] = [ | ||
{ | ||
id: 1, | ||
vehicleNumber: '123가 4567', | ||
department: '해외영업1팀', | ||
name: '김알린', | ||
drivingDays: 15, | ||
averageDrivingDistance: 150, | ||
averageDrivingTime: 480, | ||
totalDrivingDistance: 2250, | ||
drivingRate: '85', | ||
}, | ||
{ | ||
id: 2, | ||
vehicleNumber: '456나 7890', | ||
department: '국내영업2팀', | ||
name: '이택배', | ||
drivingDays: 12, | ||
averageDrivingDistance: 180, | ||
averageDrivingTime: 420, | ||
totalDrivingDistance: 2160, | ||
drivingRate: '78', | ||
}, | ||
{ | ||
id: 3, | ||
vehicleNumber: '789다 1234', | ||
department: '해외영업2팀', | ||
name: '박배송', | ||
drivingDays: 18, | ||
averageDrivingDistance: 165, | ||
averageDrivingTime: 510, | ||
totalDrivingDistance: 2970, | ||
drivingRate: '92', | ||
}, | ||
{ | ||
id: 4, | ||
vehicleNumber: '321라 5678', | ||
department: '국내영업1팀', | ||
name: '최드라', | ||
drivingDays: 14, | ||
averageDrivingDistance: 145, | ||
averageDrivingTime: 450, | ||
totalDrivingDistance: 2030, | ||
drivingRate: '75', | ||
}, | ||
{ | ||
id: 5, | ||
vehicleNumber: '654마 9012', | ||
department: '해외영업3팀', | ||
name: '정기사', | ||
drivingDays: 16, | ||
averageDrivingDistance: 175, | ||
averageDrivingTime: 495, | ||
totalDrivingDistance: 2800, | ||
drivingRate: '88', | ||
}, | ||
{ | ||
id: 6, | ||
vehicleNumber: '987바 3456', | ||
department: '국내영업3팀', | ||
name: '강운전', | ||
drivingDays: 13, | ||
averageDrivingDistance: 155, | ||
averageDrivingTime: 435, | ||
totalDrivingDistance: 2015, | ||
drivingRate: '82', | ||
}, | ||
{ | ||
id: 7, | ||
vehicleNumber: '147사 7890', | ||
department: '해외영업1팀', | ||
name: '조안전', | ||
drivingDays: 17, | ||
averageDrivingDistance: 185, | ||
averageDrivingTime: 525, | ||
totalDrivingDistance: 3145, | ||
drivingRate: '95', | ||
}, | ||
{ | ||
id: 8, | ||
vehicleNumber: '258아 1234', | ||
department: '국내영업2팀', | ||
name: '윤차량', | ||
drivingDays: 11, | ||
averageDrivingDistance: 135, | ||
averageDrivingTime: 390, | ||
totalDrivingDistance: 1485, | ||
drivingRate: '70', | ||
}, | ||
{ | ||
id: 9, | ||
vehicleNumber: '369자 5678', | ||
department: '해외영업2팀', | ||
name: '한주행', | ||
drivingDays: 19, | ||
averageDrivingDistance: 195, | ||
averageDrivingTime: 540, | ||
totalDrivingDistance: 3705, | ||
drivingRate: '98', | ||
}, | ||
{ | ||
id: 10, | ||
vehicleNumber: '159차 9012', | ||
department: '국내영업3팀', | ||
name: '황배달', | ||
drivingDays: 15, | ||
averageDrivingDistance: 160, | ||
averageDrivingTime: 465, | ||
totalDrivingDistance: 2400, | ||
drivingRate: '86', | ||
}, | ||
] | ||
|
||
const headerTitles = [ | ||
'차량번호', | ||
'부서명', | ||
'이름', | ||
'운행일수', | ||
'평균운행거리', | ||
'평균운행시간', | ||
'총운행거리', | ||
'운행률', | ||
] | ||
return ( | ||
<div> | ||
<SearchField hasButton={false} /> | ||
<div className={styles.listWrapper}> | ||
<ListHeader headerTitles={headerTitles} /> | ||
{mockHistoryData.map((history) => ( | ||
<ListItem key={history.id} data={history} /> | ||
))} | ||
</div> | ||
{/* TODO 페이지네이션 추가 */} | ||
</div> | ||
) | ||
} | ||
|
||
export default HistoryPage |
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,7 @@ | ||
import { style } from '@vanilla-extract/css' | ||
|
||
export const listWrapper = style({ | ||
padding: '120px 100px', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
}) |
Empty file.
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,28 @@ | ||
import Badge from '@/components/common/Badge' | ||
import { RightIcon } from '@/public/icons' | ||
import { ListItemModel } from '@/types/log' | ||
|
||
import * as styles from './styles.css' | ||
|
||
interface ListItemProps { | ||
data: ListItemModel | ||
} | ||
|
||
const ListItem = ({ data }: ListItemProps) => { | ||
const { vehicleNumber, vehicleModel, status } = data | ||
|
||
return ( | ||
<div className={styles.container}> | ||
<span className={styles.itemWrapper}>{vehicleNumber}</span> | ||
<span className={styles.itemWrapper}>{vehicleModel}</span> | ||
<span className={styles.itemWrapper}> | ||
<Badge shape={'rectangle'} variant={status} /> | ||
</span> | ||
<div className={styles.icon}> | ||
<RightIcon /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default ListItem |
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,23 @@ | ||
import { style } from '@vanilla-extract/css' | ||
|
||
import { styles } from '@/styles/theme.css' | ||
|
||
export const container = style({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
textAlign: 'center', | ||
padding: '24px 0px', | ||
borderBottom: `1px solid ${styles.colors.gray[200]}`, | ||
color: styles.colors.black, | ||
fontWeight: styles.fontWeights.bold, | ||
fontSize: styles.fontSizes.mediumPlus, | ||
}) | ||
|
||
export const itemWrapper = style({ | ||
flex: 1, | ||
}) | ||
|
||
export const icon = style({ | ||
width: '24px', | ||
height: '24px', | ||
}) |
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,5 +1,42 @@ | ||
'use client' | ||
|
||
import ListHeader from '@/components/domain/vehicle/ListHeader' | ||
import SearchField from '@/components/domain/vehicle/SearchField' | ||
import { ListItemModel } from '@/types/log' | ||
|
||
import ListItem from './components/ListItem/index' | ||
import * as styles from './styles.css' | ||
|
||
const LogPage = () => { | ||
return <div></div> | ||
// TODO 실제 데이터로 변경하기 | ||
const mockLogData: ListItemModel[] = [ | ||
{ id: 1, vehicleNumber: '123가 4567', vehicleModel: '미니쿠퍼', status: '운행중' }, | ||
{ id: 2, vehicleNumber: '456나 7890', vehicleModel: '현대', status: '미운행' }, | ||
{ id: 3, vehicleNumber: '789다 1234', vehicleModel: '기아', status: '미관제' }, | ||
{ id: 4, vehicleNumber: '321라 5678', vehicleModel: '토요타', status: '운행중' }, | ||
{ id: 5, vehicleNumber: '654마 9012', vehicleModel: '벤츠', status: '미운행' }, | ||
{ id: 6, vehicleNumber: '987바 3456', vehicleModel: '테슬라', status: '미운행' }, | ||
{ id: 7, vehicleNumber: '147사 7890', vehicleModel: '아우디', status: '운행중' }, | ||
{ id: 8, vehicleNumber: '258아 1234', vehicleModel: '포르쉐', status: '운행중' }, | ||
{ id: 9, vehicleNumber: '369자 5678', vehicleModel: '볼보', status: '운행중' }, | ||
{ id: 10, vehicleNumber: '159차 9012', vehicleModel: '폭스바겐', status: '운행중' }, | ||
] | ||
|
||
const headerTitles = ['차량번호', '차종', '차량현황'] | ||
|
||
return ( | ||
<div> | ||
<SearchField hasButton={true} /> | ||
<div className={styles.listWrapper}> | ||
<ListHeader headerTitles={headerTitles} /> | ||
{mockLogData.map((log) => ( | ||
<ListItem key={log.id} data={log} /> | ||
))} | ||
</div> | ||
|
||
{/* TODO 페이지네이션 추가 */} | ||
</div> | ||
) | ||
} | ||
|
||
export default LogPage |
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,7 @@ | ||
import { style } from '@vanilla-extract/css' | ||
|
||
export const listWrapper = style({ | ||
padding: '120px 100px', | ||
display: 'flex', | ||
flexDirection: 'column', | ||
}) |
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
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
Oops, something went wrong.
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.
여기처럼 위 History도 컨벤션대로 수정해주세요~
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.
넵!