diff --git a/package.json b/package.json index 1379eee..fcad68e 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "dependencies": { "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", + "@hookstate/core": "^4.0.1", "@mdx-js/loader": "^2.3.0", "@mdx-js/react": "^2.3.0", "@next/mdx": "^13.5.5", diff --git a/public/profile.png b/public/profile.png index c7865c7..064cc14 100644 Binary files a/public/profile.png and b/public/profile.png differ diff --git a/src/components/JobList/JobFilter.tsx b/src/components/JobList/JobFilter.tsx index a73fcfc..0a35165 100644 --- a/src/components/JobList/JobFilter.tsx +++ b/src/components/JobList/JobFilter.tsx @@ -1,9 +1,10 @@ import { breakpoints, uiConfigs } from '@/configs/ui.configs' import styled from '@emotion/styled' +import { calculateTotalJobCount } from '../../../utils/jobs' import { FilterTitle } from '../Filter' import { Job } from './JobItem' // adjust path accordingly -interface BoardJobs { +export interface BoardJobs { [key: string]: Job[] } @@ -28,10 +29,6 @@ const JobFilter = ({ data, activeBUs, setActiveBUs }: Props) => { } } - const calculateTotalJobCount = (units: BoardJobs): number => { - return Object.keys(units).reduce((sum, unit) => sum + units[unit].length, 0) - } - return ( { + if (!units) { + return 0 + } + return Object.keys(units).reduce((sum, unit) => sum + units[unit].length, 0) +} diff --git a/yarn.lock b/yarn.lock index 0b369f6..8e4fb39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -196,6 +196,11 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.51.0.tgz#6d419c240cfb2b66da37df230f7e7eef801c32fa" integrity sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg== +"@hookstate/core@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@hookstate/core/-/core-4.0.1.tgz#6744380e96ce13fe3488c926c1cbae93bbea0ff6" + integrity sha512-Uh2D8Z0z/pqOJ7t+SfC+2sj13JQcB4yFhtL+T1choCaBxTSlgOS/CKRBohgJ4cjTKoxOmTT8uSQysu3gUjX+Gw== + "@humanwhocodes/config-array@^0.11.11": version "0.11.11" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.11.tgz#88a04c570dbbc7dd943e4712429c3df09bc32844"