-
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
1 parent
f1fd048
commit 1650201
Showing
25 changed files
with
311 additions
and
245 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { JobTable } from '@/utils/types/job'; | ||
import { createContext } from 'react'; | ||
|
||
export const JobListContext = createContext<JobTable | undefined>(undefined); |
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,22 @@ | ||
import { JobTable } from '@/utils/types/job'; | ||
import { useContext, useState } from 'react'; | ||
import { JobListContext } from './context'; | ||
|
||
export const useJobListContext = (): JobTable => { | ||
const jobs = useContext(JobListContext); | ||
|
||
if (jobs === undefined) { | ||
throw new Error('Missing JobListContext'); | ||
} | ||
|
||
return jobs; | ||
}; | ||
|
||
export const useHooks = () => { | ||
const [page, setPage] = useState(1); | ||
|
||
return { | ||
page, | ||
setPage | ||
}; | ||
}; |
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,40 @@ | ||
'use client'; | ||
|
||
import Pagination from '@/components/atoms/Pagination'; | ||
import JobListTable from '@/components/organisms/JobListTable'; | ||
import SearchFilterHeader from '@/components/organisms/SearchFilterHeader'; | ||
import { JobColumns, JobData } from '@/utils/constants/jobTableData'; | ||
import { Grid } from '@mui/material'; | ||
import { JobListContext } from './context'; | ||
import { useHooks } from './hooks'; | ||
|
||
const JobList = (): JSX.Element => { | ||
const { page, setPage } = useHooks(); | ||
|
||
return ( | ||
<main> | ||
<JobListContext.Provider | ||
value={{ columns: JobColumns, data: JobData }}> | ||
<Grid | ||
container | ||
sx={{ | ||
padding: 3, | ||
gap: 3, | ||
flexDirection: 'column' | ||
}}> | ||
<Grid item> | ||
<SearchFilterHeader /> | ||
</Grid> | ||
<Grid item> | ||
<JobListTable /> | ||
</Grid> | ||
<Grid item sx={{ alignSelf: 'center' }}> | ||
<Pagination count={12} page={page} onChange={setPage} /> | ||
</Grid> | ||
</Grid> | ||
</JobListContext.Provider> | ||
</main> | ||
); | ||
}; | ||
|
||
export default JobList; |
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 was deleted.
Oops, something went wrong.
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,17 @@ | ||
import { ChipColors } from '@/utils/constants/statusChipColor'; | ||
import { Chip, ChipProps } from '@mui/material'; | ||
import { FC } from 'react'; | ||
|
||
const StatusChip: FC<ChipProps> = ({ label }: ChipProps) => { | ||
return ( | ||
<Chip | ||
label={label} | ||
sx={{ | ||
backgroundColor: ChipColors[label as string] ?? '#65707b33', | ||
typography: 'label1r' | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export default StatusChip; |
22 changes: 22 additions & 0 deletions
22
web/src/components/molecules/CreatedDateRangeFilter/hooks.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,22 @@ | ||
import { Moment } from 'moment'; | ||
import { useState } from 'react'; | ||
|
||
export const useHooks = () => { | ||
const [startDate, setStartDate] = useState<Moment | null>(); | ||
const [endDate, setEndDate] = useState<Moment | null>(); | ||
|
||
const handleStartDateChange = (date: Moment | null): void => { | ||
setStartDate(date); | ||
}; | ||
|
||
const handleEndDateChange = (date: Moment | null): void => { | ||
setEndDate(date); | ||
}; | ||
|
||
return { | ||
startDate, | ||
handleStartDateChange, | ||
endDate, | ||
handleEndDateChange | ||
}; | ||
}; |
17 changes: 4 additions & 13 deletions
17
...ents/molecules/CreatedDateRangeFilter.tsx → ...olecules/CreatedDateRangeFilter/index.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
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
web/src/components/molecules/EstimationStatusFilter/hooks.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,15 @@ | ||
import { SelectChangeEvent } from '@mui/material'; | ||
import { useState } from 'react'; | ||
|
||
export const useHooks = () => { | ||
const [status, setStatus] = useState(''); | ||
|
||
const handleChange = (e: SelectChangeEvent) => { | ||
setStatus(e.target.value); | ||
}; | ||
|
||
return { | ||
status, | ||
handleChange | ||
}; | ||
}; |
33 changes: 33 additions & 0 deletions
33
web/src/components/molecules/EstimationStatusFilter/index.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,33 @@ | ||
import styles from '@/styles/Filter.module.css'; | ||
import { EstimationStatus } from '@/utils/constants/estimationStatus'; | ||
import { FormControl, InputLabel, MenuItem, Select } from '@mui/material'; | ||
import { useHooks } from './hooks'; | ||
|
||
const EstimationStatusFilter = () => { | ||
const { status, handleChange } = useHooks(); | ||
|
||
return ( | ||
<FormControl sx={{ width: 180 }}> | ||
<InputLabel size='small' id='estimation-status-label'> | ||
Estimation Status | ||
</InputLabel> | ||
<Select | ||
size='small' | ||
labelId='estimation-status-label' | ||
name='estimation-status' | ||
value={status} | ||
label='Estimation Status' | ||
color='secondary' | ||
onChange={handleChange} | ||
className={styles.input}> | ||
{EstimationStatus.map((status) => ( | ||
<MenuItem key={status.id} value={status.status}> | ||
{status.status} | ||
</MenuItem> | ||
))} | ||
</Select> | ||
</FormControl> | ||
); | ||
}; | ||
|
||
export default EstimationStatusFilter; |
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,15 @@ | ||
import { ChangeEvent, useState } from 'react'; | ||
|
||
export const useHooks = () => { | ||
const [searchKeyword, setSearchKeyword] = useState(''); | ||
|
||
const handleSearch = (e: ChangeEvent<HTMLInputElement>) => { | ||
setSearchKeyword(e.target.value); | ||
}; | ||
|
||
return { | ||
searchKeyword, | ||
handleSearch | ||
}; | ||
|
||
}; |
10 changes: 3 additions & 7 deletions
10
web/src/components/molecules/SearchBar.tsx → .../components/molecules/SearchBar/index.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
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
import { SelectChangeEvent } from '@mui/material'; | ||
import { useState } from 'react'; | ||
|
||
export const useHooks = () => { | ||
const [tag, setTag] = useState(''); | ||
|
||
const handleChange = (e: SelectChangeEvent) => { | ||
setTag(e.target.value); | ||
}; | ||
|
||
return { | ||
tag, | ||
handleChange | ||
}; | ||
}; |
Oops, something went wrong.