-
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
926dafd
commit 96ef3e5
Showing
14 changed files
with
198 additions
and
88 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { JobTable } from '@/utils/types/job'; | ||
import { JobQuery, JobTable } from '@/utils/types/job'; | ||
import { createContext } from 'react'; | ||
|
||
export const JobListContext = createContext<JobTable | undefined>(undefined); | ||
export const JobQueryContext = createContext<JobQuery | 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
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
13 changes: 11 additions & 2 deletions
13
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 |
---|---|---|
@@ -1,15 +1,24 @@ | ||
import { formatEnum, useJobQueryContext } from '@/app/job/hooks'; | ||
import { EstimationStatusEnum } from '@/utils/constants/estimationStatusEnum'; | ||
import { SelectChangeEvent } from '@mui/material'; | ||
import { useState } from 'react'; | ||
|
||
export const useHooks = () => { | ||
const [status, setStatus] = useState(''); | ||
const { status, setStatus } = useJobQueryContext(); | ||
|
||
const handleChange = (e: SelectChangeEvent) => { | ||
setStatus(e.target.value); | ||
}; | ||
|
||
const statusOptions = Object.keys(EstimationStatusEnum).map((key) => { | ||
return { | ||
value: EstimationStatusEnum[key as keyof typeof EstimationStatusEnum], | ||
name: formatEnum(key) | ||
} | ||
}); | ||
|
||
return { | ||
status, | ||
statusOptions, | ||
handleChange | ||
}; | ||
}; |
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 |
---|---|---|
@@ -1,15 +1,25 @@ | ||
import { formatEnum, useJobQueryContext } from '@/app/job/hooks'; | ||
import { TagsEnum } from '@/utils/constants/tagsEnum'; | ||
|
||
import { SelectChangeEvent } from '@mui/material'; | ||
import { useState } from 'react'; | ||
|
||
export const useHooks = () => { | ||
const [tag, setTag] = useState(''); | ||
const { tag, setTag } = useJobQueryContext(); | ||
|
||
const handleChange = (e: SelectChangeEvent) => { | ||
setTag(e.target.value); | ||
}; | ||
|
||
const tagOptions = Object.keys(TagsEnum).map((key) => { | ||
return { | ||
value: TagsEnum[key as keyof typeof TagsEnum], | ||
name: formatEnum(key) | ||
} | ||
}); | ||
|
||
return { | ||
tag, | ||
tagOptions, | ||
handleChange | ||
}; | ||
}; |
Oops, something went wrong.