Skip to content

Commit d831475

Browse files
Create and Edit Opportunities (#82)
2 parents dfbc89a + 0e30ba6 commit d831475

File tree

8 files changed

+224
-118
lines changed

8 files changed

+224
-118
lines changed

src/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Jobs from "./opportunities/pages/Jobs.js";
88
import Departments from "./staff/pages/Departments.tsx";
99
import StaffPage from "./staff/pages/Staff.tsx";
1010
import Department from "./staff/pages/Department.tsx";
11-
import CreatePost from "./staff/pages/CreatePost.js";
11+
import CreatePost from "./staff/pages/CreatePost.tsx";
1212
import IndividualPost from "./opportunities/pages/IndividualPost.js";
1313
import ProfilePage from "./shared/pages/Profile.js";
1414
import LoginRedirection from "./auth/Login.tsx";
@@ -44,10 +44,10 @@ function App() {
4444
/>
4545
<Route path="/staff" element={<Departments authenticated={authenticated} />} />
4646
<Route path="/staff/:staffId" element={<StaffPage authenticated={authenticated} />} />
47-
<Route path="/createPost" element={<CreatePost edit={false} />} />
47+
<Route path="/create" element={<CreatePost edit={false} authenticated={authenticated} />} />
4848
<Route
49-
path="/editPost/:postID"
50-
element={<CreatePost edit={true} />}
49+
path="/edit/:postID"
50+
element={<CreatePost edit={true} authenticated={authenticated} />}
5151
/>
5252
<Route path="/post/:postID" element={<IndividualPost />} />
5353

src/shared/components/Navigation/MainNavigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function MainNavigation(authenticated) {
99
const routes = authenticated.authenticated[1]
1010
? [
1111
{ name: "Jobs", href: "/jobs", current: true },
12-
{ name: "Create", href: "/createPost", current: false },
12+
{ name: "Create", href: "/create", current: false },
1313
{ name: "Staff", href: "/staff", current: false },
1414
{ name: "Profile", href: "/profile", current: false },
1515
{ name: "Sign Out", href: "/signout", current: false },

src/shared/components/Navigation/StickyFooter.tsx

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default function StickyFooter(authenticated) {
77
const routes = authenticated.authenticated[1]
88
? [
99
{ name: "Jobs", href: "/jobs", current: true },
10-
{ name: "Create", href: "/createPost", current: false },
10+
{ name: "Create", href: "/create", current: false },
1111
{ name: "Staff", href: "/staff", current: false },
1212
{ name: "Profile", href: "/profile", current: false },
1313
{ name: "Sign Out", href: "/signout", current: false },
@@ -22,14 +22,13 @@ export default function StickyFooter(authenticated) {
2222
RCOS
2323
</Link>
2424
</h1>
25-
<br />
26-
<div className="stickyfooter-info">
25+
<div className="stickyfooter-info mt-5">
2726
<div className="pb-3">
28-
<img src={logo} alt="LabConnect" width="160" height="160 / (319/289)" />
27+
<img src={logo} alt="LabConnect" width="160" height="160 / (319/289)" />
2928
</div>
3029

3130
<div className="w-40">
32-
<p>
31+
<div>
3332
<b>Contact Us</b>
3433
<p className="text-base">
3534
<Link
@@ -47,27 +46,25 @@ export default function StickyFooter(authenticated) {
4746
</Link>
4847
<br />
4948
</p>
50-
</p>
49+
</div>
5150
</div>
52-
<div className="w-40 text-base">
53-
<b>Additional Pages</b>
54-
<p>
55-
{routes.map((item) => (
56-
<>
57-
<Link
58-
key={item.name}
59-
to={item.href}
60-
className="grey-link hover:text-neutral-950 focus:text-neutral-950"
61-
aria-current={item.current}
62-
>
63-
{item.name}
64-
</Link>
65-
<br />
66-
</>
67-
))}
68-
</p>
51+
<div>
52+
<b>Resources</b>
53+
<br />
54+
{routes.map((item) => (
55+
<React.Fragment key={item.name}>
56+
<Link
57+
to={item.href}
58+
className="grey-link hover:text-neutral-950 focus:text-neutral-950"
59+
aria-current={item.current}
60+
>
61+
{item.name}
62+
</Link>
63+
<br />
64+
</React.Fragment>
65+
))}
6966
</div>
70-
</div>
71-
</section>
67+
</div >
68+
</section >
7269
);
7370
}
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from "react";
2+
import PropTypes from "prop-types";
23

34
const CheckBox = ({
45
formHook,
@@ -9,10 +10,6 @@ const CheckBox = ({
910
options,
1011
type,
1112
}) => {
12-
// if (!formHook) {
13-
// return <h1>FormHook Not Given</h1>;
14-
// }
15-
1613
return (
1714
<div>
1815
<div className="check-input">
@@ -46,5 +43,14 @@ const CheckBox = ({
4643
</div>
4744
);
4845
};
46+
CheckBox.propTypes = {
47+
formHook: PropTypes.object,
48+
errors: PropTypes.object,
49+
errorMessage: PropTypes.string,
50+
name: PropTypes.string.isRequired,
51+
label: PropTypes.string,
52+
options: PropTypes.arrayOf(PropTypes.string),
53+
type: PropTypes.string,
54+
};
4955

5056
export default CheckBox;

0 commit comments

Comments
 (0)