feat: update tonggao
This commit is contained in:
@ -7,7 +7,7 @@ import { AgreementPopup } from '@/components/agreement-popup';
|
||||
import HomePage from '@/components/home-page';
|
||||
import MaterialGuide from '@/components/material-guide';
|
||||
import { EventName, OpenSource, PageType, PageUrl, RoleType } from '@/constants/app';
|
||||
import { EmployType, JOB_PAGE_TABS, SortType } from '@/constants/job';
|
||||
import { EmployType, JOB_PAGE_TABS, JobSourceType, SortType } from '@/constants/job';
|
||||
import JobFragment from '@/fragments/job/base';
|
||||
import useInviteCode from '@/hooks/use-invite-code';
|
||||
import useLocation from '@/hooks/use-location';
|
||||
@ -31,7 +31,8 @@ export default function Job() {
|
||||
const location = useLocation();
|
||||
const { barHeight, statusBarHeight } = useNavigation();
|
||||
const inviteCode = useInviteCode();
|
||||
const [tabType, setTabType] = useState<EmployType>(EmployType.All);
|
||||
const [tabType, setTabType] = useState<JobSourceType>(JobSourceType.All);
|
||||
const [employType, setEmployType] = useState<EmployType>(EmployType.All);
|
||||
const [sortType, setSortType] = useState<SortType>(SortType.RECOMMEND);
|
||||
const [cityCode, setCityCode] = useState<string>(location.cityCode);
|
||||
const [coordinate, setCoordinate] = useState<Coordinate>({
|
||||
@ -59,6 +60,10 @@ export default function Job() {
|
||||
[cityCode]
|
||||
);
|
||||
|
||||
const handleClickEmployType = useCallback(type => {
|
||||
setEmployType(type);
|
||||
}, []);
|
||||
|
||||
const handleClickSortType = useCallback(
|
||||
async (type: SortType) => {
|
||||
if (type === SortType.DISTANCE && (!location.latitude || !location.longitude)) {
|
||||
@ -151,8 +156,10 @@ export default function Job() {
|
||||
<JobFragment
|
||||
cityCode={cityCode}
|
||||
sortType={sortType}
|
||||
employType={tab.type}
|
||||
sourceType={tab.type}
|
||||
employType={employType}
|
||||
coordinate={coordinate}
|
||||
onClickEmployType={handleClickEmployType}
|
||||
onClickCity={handleClickCity}
|
||||
onClickSort={handleClickSortType}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user