Skip to content

Commit 1224827

Browse files
Will-Frontend (#123)
2 parents 6713bea + e72fc7b commit 1224827

File tree

16 files changed

+504
-425
lines changed

16 files changed

+504
-425
lines changed

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import "./style/App.css";
44
import Home from "./shared/pages/Home.tsx";
55
import PageNotFound from "./shared/pages/404.tsx";
66
import MainNavigation from "./shared/components/Navigation/MainNavigation.tsx";
7-
import Jobs from "./opportunities/pages/Jobs.js";
7+
import Jobs from "./opportunities/pages/Jobs.tsx";
88
import Departments from "./staff/pages/Departments.tsx";
99
import StaffPage from "./staff/pages/Staff.tsx";
1010
import Department from "./staff/pages/Department.tsx";
1111
import CreatePost from "./staff/pages/CreatePost.tsx";
12-
import IndividualPost from "./opportunities/pages/IndividualPost.js";
12+
import IndividualPost from "./opportunities/pages/IndividualPost.tsx";
1313
import ProfilePage from "./shared/pages/Profile.tsx";
1414
import LoginRedirection from "./auth/Login.tsx";
1515
import LogoutRedirection from "./auth/Logout.tsx";

src/opportunities/components/FiltersField.js

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import React from "react";
2+
import SmallTextButton from "./SmallTextButton.tsx";
3+
import SearchBar from "./SearchBar.tsx";
4+
import GroupedComponents from "../../shared/components/UIElements/GroupedComponents";
5+
import HorizontalIconButton from "./HorizontalIconButton.tsx";
6+
import { PiSlidersHorizontal } from "react-icons/pi";
7+
import { MdCancel } from "react-icons/md";
8+
import PropTypes from "prop-types";
9+
10+
const FiltersField = ({ resetFilters, deleteFilter, filters, setPopUpMenu }) => {
11+
12+
return (
13+
<div>
14+
<hr />
15+
<div className="px-3 max-h-20 flex">
16+
<div className="flex gap-2 w-full">
17+
<SearchBar />
18+
19+
<SmallTextButton className="" onClick={setPopUpMenu} special={true}>
20+
<PiSlidersHorizontal className="pr-1"/>
21+
Change Filters
22+
<PiSlidersHorizontal className="pl-1"/>
23+
</SmallTextButton>
24+
25+
{/* Fix rendering with new filters = [ [],[],[] ]*/}
26+
<GroupedComponents gap={2}>
27+
{filters[1].map((filter) => {
28+
return(
29+
<HorizontalIconButton
30+
onClick={deleteFilter}
31+
icon={<MdCancel />}
32+
key={filter}
33+
special={false}
34+
>
35+
{filter}
36+
</HorizontalIconButton>
37+
)
38+
})}
39+
</GroupedComponents>
40+
</div>
41+
42+
<SmallTextButton className="flex flex-right" onClick={resetFilters} special={true}>
43+
Reset
44+
</SmallTextButton>
45+
</div>
46+
<hr />
47+
</div>
48+
);
49+
};
50+
51+
FiltersField.propTypes = {
52+
resetFilters: PropTypes.func.isRequired,
53+
deleteFilter: PropTypes.func.isRequired,
54+
filters: PropTypes.arrayOf(PropTypes.array),
55+
setPopUpMenu: PropTypes.func.isRequired,
56+
};
57+
58+
export default FiltersField;

src/opportunities/components/HorizontalIconButton.js renamed to src/opportunities/components/HorizontalIconButton.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { Children } from "react";
1+
import React from "react";
2+
import PropTypes from "prop-types";
23

34
const HorizontalIconButton = ({ children, onClick, icon, special }) => {
45
return (
@@ -20,4 +21,11 @@ const HorizontalIconButton = ({ children, onClick, icon, special }) => {
2021
);
2122
};
2223

24+
HorizontalIconButton.propTypes = {
25+
children: PropTypes.node,
26+
onClick: PropTypes.func.isRequired,
27+
icon: PropTypes.node,
28+
special: PropTypes.bool,
29+
}
30+
2331
export default HorizontalIconButton;

src/opportunities/components/Posts.js

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)