
diff --git a/src/shared/components/UIElements/Backdrop.js b/src/shared/components/UIElements/Backdrop.tsx
similarity index 62%
rename from src/shared/components/UIElements/Backdrop.js
rename to src/shared/components/UIElements/Backdrop.tsx
index e462cef9..de4ba4af 100644
--- a/src/shared/components/UIElements/Backdrop.js
+++ b/src/shared/components/UIElements/Backdrop.tsx
@@ -1,10 +1,10 @@
import React from "react";
import ReactDOM from "react-dom";
-const Backdrop = ({ onClick }) => {
+const Backdrop = ({ onClick }: { onClick: () => void }) => {
return ReactDOM.createPortal(
,
- document.getElementById("backdrop-hook")
+ document.getElementById("backdrop-hook")!
);
};
diff --git a/src/shared/components/UIElements/Breadcrumb.tsx b/src/shared/components/UIElements/Breadcrumb.tsx
index 6981b854..493c804b 100644
--- a/src/shared/components/UIElements/Breadcrumb.tsx
+++ b/src/shared/components/UIElements/Breadcrumb.tsx
@@ -1,12 +1,20 @@
import React from "react";
import { Link } from "react-router-dom";
-import PropTypes from "prop-types";
-const Breadcrumb = ({ tree }) => {
+interface BreadcrumbProps {
+ tree: {link: string, title: string}[];
+}
+
+interface Shape {
+ link: string;
+ title: string;
+}
+
+const Breadcrumb = ({ tree }: BreadcrumbProps) => {
return (
- {tree.map((item) => {
+ {tree.map((item: Shape) => {
return (
-
{item.title}
@@ -17,13 +25,5 @@ const Breadcrumb = ({ tree }) => {
);
};
-Breadcrumb.propTypes = {
- tree: PropTypes.arrayOf(
- PropTypes.shape({
- link: PropTypes.string.isRequired,
- title: PropTypes.string.isRequired,
- })
- ).isRequired,
-};
export default Breadcrumb;
diff --git a/src/shared/components/UIElements/GroupedComponents.js b/src/shared/components/UIElements/GroupedComponents.js
deleted file mode 100644
index ba8af41f..00000000
--- a/src/shared/components/UIElements/GroupedComponents.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import React from "react";
-
-const GroupedComponents = ({ children, gap }) => {
- return
{children}
;
-};
-
-export default GroupedComponents;
diff --git a/src/shared/components/UIElements/GroupedComponents.tsx b/src/shared/components/UIElements/GroupedComponents.tsx
new file mode 100644
index 00000000..4e13d76e
--- /dev/null
+++ b/src/shared/components/UIElements/GroupedComponents.tsx
@@ -0,0 +1,12 @@
+import React from "react";
+
+interface GroupedComponentsProps {
+ children?: React.ReactNode[];
+ gap: number;
+}
+
+const GroupedComponents = ({ children, gap }: GroupedComponentsProps) => {
+ return
{children}
;
+};
+
+export default GroupedComponents;
diff --git a/src/shared/components/UIElements/LargeTextCard.tsx b/src/shared/components/UIElements/LargeTextCard.tsx
index 693d41f3..ca9e9d0d 100644
--- a/src/shared/components/UIElements/LargeTextCard.tsx
+++ b/src/shared/components/UIElements/LargeTextCard.tsx
@@ -1,8 +1,15 @@
import React from "react";
import { Link } from "react-router-dom";
-import PropTypes from "prop-types";
-const LargeTextCard = ({ to, title, due, pay, credits }) => {
+interface LargeTextCardProps {
+ to: string;
+ title: string;
+ due: string;
+ pay?: string;
+ credits?: string;
+}
+
+const LargeTextCard = ({ to, title, due, pay, credits }: LargeTextCardProps) => {
return (
@@ -22,12 +29,4 @@ const LargeTextCard = ({ to, title, due, pay, credits }) => {
);
};
-LargeTextCard.propTypes = {
- to: PropTypes.string.isRequired,
- title: PropTypes.string.isRequired,
- due: PropTypes.string.isRequired,
- pay: PropTypes.string,
- credits: PropTypes.string,
-};
-
export default LargeTextCard;
diff --git a/src/shared/hooks/page-navigation-hook.ts b/src/shared/hooks/page-navigation-hook.ts
index d910c4b7..cfc58b7b 100644
--- a/src/shared/hooks/page-navigation-hook.ts
+++ b/src/shared/hooks/page-navigation-hook.ts
@@ -1,10 +1,5 @@
import { useState } from "react";
-interface PagesState {
- pages: string[];
- activePage: string;
-}
-
type SwitchPage = (view: string) => void;
const usePageNavigation = (views: string[], activeView: string): [PagesState, SwitchPage] => {
diff --git a/src/shared/pages/EditProfile.js b/src/shared/pages/EditProfile.tsx
similarity index 68%
rename from src/shared/pages/EditProfile.js
rename to src/shared/pages/EditProfile.tsx
index f4a6b102..b45f1d1b 100644
--- a/src/shared/pages/EditProfile.js
+++ b/src/shared/pages/EditProfile.tsx
@@ -1,6 +1,17 @@
import React from "react";
-import ProfileAvatar from "../components/UIElements/ProfileAvatar.tsx";
-import EditInformation from "../components/Profile/EditInformation";
+import ProfileAvatar from "../components/Profile/ProfileAvatar.tsx";
+import EditInformation from "../components/Profile/EditInformation.tsx";
+
+interface EditProfileProps {
+ id: string;
+ name: string;
+ department: string;
+ researchCenter: string;
+ description: string;
+ email: string;
+ role: string;
+ image: string;
+}
const EditProfile = ({
id,
@@ -11,7 +22,7 @@ const EditProfile = ({
email,
role,
image,
-}) => {
+}: EditProfileProps) => {
return (
diff --git a/src/staff/components/DepartmentStaff.tsx b/src/staff/components/DepartmentStaff.tsx
index 7c258d30..dc939619 100644
--- a/src/staff/components/DepartmentStaff.tsx
+++ b/src/staff/components/DepartmentStaff.tsx
@@ -1,9 +1,12 @@
import React from "react";
-import PropTypes from "prop-types";
import AvatarCard from "../../shared/components/UIElements/AvatarCard.tsx";
import { Link } from "react-router-dom";
-const DepartmentStaff = ({ staff }) => {
+interface DepartmentStaffProps {
+ staff: {id: string, name: string, image: string}[];
+}
+
+const DepartmentStaff = ({ staff }: DepartmentStaffProps) => {
return (
{staff.map((staff_member) => {
@@ -21,14 +24,4 @@ const DepartmentStaff = ({ staff }) => {
);
};
-DepartmentStaff.propTypes = {
- staff: PropTypes.arrayOf(
- PropTypes.shape({
- id: PropTypes.string.isRequired,
- name: PropTypes.string.isRequired,
- image: PropTypes.string.isRequired,
- })
- ).isRequired,
-};
-
export default DepartmentStaff;
diff --git a/src/staff/components/Input.js b/src/staff/components/Input.tsx
similarity index 59%
rename from src/staff/components/Input.js
rename to src/staff/components/Input.tsx
index 1fd702a6..6e33215e 100644
--- a/src/staff/components/Input.js
+++ b/src/staff/components/Input.tsx
@@ -1,6 +1,51 @@
import React from "react";
+import { FieldErrors, UseFormRegisterReturn, FieldValues} from "react-hook-form";
-const Input = ({
+interface InputProps
{
+ type?: string;
+ errorMessage: string;
+ errors: FieldErrors;
+ name: keyof TFieldValues & string;
+ formHook: UseFormRegisterReturn;
+ label: string;
+ options?: string[];
+ placeHolder?: string;
+}
+
+/*
+const errors: FieldErrors<{
+ id: string;
+ title: string;
+ application_due: string;
+ type: string;
+ hourlyPay: number;
+ credits: never[];
+ description: string;
+ recommended_experience: string;
+ location: string;
+ years: string[];
+}>
+
+const errors: FieldErrors<{
+ years: never[];
+ credits: never[];
+ hourlyPay: number;
+ majors: never[];
+}>
+
+const errors: FieldErrors<{
+ id: string;
+ name: string;
+ email: string;
+ role: string;
+ description: string;
+ department: string;
+ researchCenter: string;
+}>
+
+*/
+
+const Input = ({
type,
errorMessage,
errors,
@@ -9,7 +54,7 @@ const Input = ({
label,
options,
placeHolder,
-}) => {
+}: InputProps) => {
// if (!formHook) {
// return FormHook Not Given
;
// }
@@ -28,8 +73,8 @@ const Input = ({
);
diff --git a/src/staff/components/LargeImageCard.js b/src/staff/components/LargeImageCard.tsx
similarity index 66%
rename from src/staff/components/LargeImageCard.js
rename to src/staff/components/LargeImageCard.tsx
index 77a5fbdd..7d790818 100644
--- a/src/staff/components/LargeImageCard.js
+++ b/src/staff/components/LargeImageCard.tsx
@@ -1,8 +1,13 @@
import React from "react";
import { Link } from "react-router-dom";
-import PropTypes from "prop-types";
-const LargeImageCard = ({ to, image, title }) => {
+interface LargeImageCardProps {
+ to: string;
+ image: string;
+ title: string;
+}
+
+const LargeImageCard = ({ to, image, title }: LargeImageCardProps) => {
return (
@@ -17,10 +22,4 @@ const LargeImageCard = ({ to, image, title }) => {
);
};
-LargeImageCard.propTypes = {
- to: PropTypes.string.isRequired,
- image: PropTypes.string.isRequired,
- title: PropTypes.string.isRequired,
-};
-
export default LargeImageCard;
diff --git a/src/style/general.css b/src/style/general.css
index 1ca835be..38aa235b 100644
--- a/src/style/general.css
+++ b/src/style/general.css
@@ -80,9 +80,6 @@
.jobs-categories {
@apply text-base flex gap-4 justify-items-center font-semibold;
}
-.postsfield-header {
- @apply border-t border-b grid grid-cols-9;
-}
.searchbar {
@apply flex p-2 px-3 border rounded-3xl align-items-center;
}