Admin permission required ..
+ );
+};
+
+export default Admin;
diff --git a/src/pages/admin/admin_pages/new_event/NewEvent.tsx b/src/pages/admin/admin_pages/new_event/NewEvent.tsx
new file mode 100644
index 00000000..84186fc5
--- /dev/null
+++ b/src/pages/admin/admin_pages/new_event/NewEvent.tsx
@@ -0,0 +1,213 @@
+import React, { createElement, useState } from "react";
+import { _Event, _EventCreateData } from "../../../../utils/types";
+import { createEvent } from "../../../../apis/adminApi";
+import { useToast } from "../../../../components/toast/useToast";
+
+const NewEvent: React.FC = () => {
+ const [formData, setFormData] = useState<_EventCreateData>({
+ name: "",
+ description: "",
+ details: "",
+ date: "",
+ type: "",
+ image: null,
+ reg_link: null,
+ venue: "",
+ gctian_only: false,
+ is_reg: true,
+ closed: false,
+ });
+ const { setToastStatus } = useToast();
+ const handleChange = (
+ e: React.ChangeEvent<
+ HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement
+ >
+ ) => {
+ console.log(e.target.id, e.target.value);
+ setFormData({
+ ...formData,
+ [e.target.id]: e.target.value,
+ });
+ };
+
+ const handleSubmit = async (event: React.FormEvent) => {
+ event.preventDefault();
+ console.log("Form submitted!");
+ console.log(formData);
+ await createEvent(formData, setToastStatus);
+ };
+
+ return (
+
+
+ Create New Event
+
+
+
+ );
+};
+
+export default NewEvent;
diff --git a/src/utils/types.tsx b/src/utils/types.tsx
index 9613cc88..2c4905de 100644
--- a/src/utils/types.tsx
+++ b/src/utils/types.tsx
@@ -90,3 +90,17 @@ export type _UserStep2 = {
year: number;
gctian: boolean | null;
};
+
+export type _EventCreateData = {
+ name: string;
+ description: string;
+ details: string;
+ type: string;
+ date: string;
+ reg_link: string | null;
+ image: string | null;
+ venue: string;
+ closed: boolean;
+ gctian_only: boolean;
+ is_reg: boolean;
+};