From bd94c4e8f04c75b0407dbca5ed18c79a960badfc Mon Sep 17 00:00:00 2001 From: Graham Mather Date: Tue, 28 Nov 2023 18:10:17 -0500 Subject: [PATCH] Bit of Restructure --- client/src/components/{ => Admin}/CollectionForm.tsx | 2 +- client/src/components/{ => Admin}/CollectionItem.tsx | 2 +- .../src/components/{ => Admin}/CollectionSelector.tsx | 2 +- client/src/components/{ => Admin}/GiftForm.tsx | 2 +- client/src/components/{ => Admin}/GiftItem.tsx | 2 +- client/src/components/{ => Admin}/Navbar.tsx | 0 client/src/components/{ => Admin}/RequestCard.tsx | 6 +++--- client/src/components/{ => Admin}/ResponseCard.tsx | 2 +- client/src/components/{ => Admin}/ResponseForm.tsx | 2 +- .../components/{ => Home}/CollectionItemUpdated.tsx | 2 +- client/src/components/{ => Home}/Filter.tsx | 2 +- client/src/components/{ => Home}/FilterSection.tsx | 0 client/src/components/{ => Home}/NavBarUpdated.tsx | 0 client/src/components/{ => Home}/SearchBar.tsx | 0 client/src/components/{ => Home}/UpdatedGiftItem.tsx | 2 +- client/src/components/{ => Login}/FormInput.tsx | 0 client/src/components/{ => Login}/LoginForm.tsx | 4 ++-- client/src/components/{ => Nav}/GiftSortNavBar.tsx | 2 +- client/src/data/formData.ts | 2 +- client/src/pages/CollectionsPage.tsx | 6 +++--- client/src/pages/GiftManagementPage.tsx | 6 +++--- client/src/pages/HomePage.tsx | 10 +++++----- client/src/pages/LoginPage.tsx | 2 +- client/src/pages/RequestsPage.tsx | 4 ++-- client/src/pages/SignUpPage.tsx | 2 +- 25 files changed, 32 insertions(+), 32 deletions(-) rename client/src/components/{ => Admin}/CollectionForm.tsx (98%) rename client/src/components/{ => Admin}/CollectionItem.tsx (93%) rename client/src/components/{ => Admin}/CollectionSelector.tsx (95%) rename client/src/components/{ => Admin}/GiftForm.tsx (99%) rename client/src/components/{ => Admin}/GiftItem.tsx (97%) rename client/src/components/{ => Admin}/Navbar.tsx (100%) rename client/src/components/{ => Admin}/RequestCard.tsx (93%) rename client/src/components/{ => Admin}/ResponseCard.tsx (92%) rename client/src/components/{ => Admin}/ResponseForm.tsx (97%) rename client/src/components/{ => Home}/CollectionItemUpdated.tsx (93%) rename client/src/components/{ => Home}/Filter.tsx (97%) rename client/src/components/{ => Home}/FilterSection.tsx (100%) rename client/src/components/{ => Home}/NavBarUpdated.tsx (100%) rename client/src/components/{ => Home}/SearchBar.tsx (100%) rename client/src/components/{ => Home}/UpdatedGiftItem.tsx (96%) rename client/src/components/{ => Login}/FormInput.tsx (100%) rename client/src/components/{ => Login}/LoginForm.tsx (95%) rename client/src/components/{ => Nav}/GiftSortNavBar.tsx (98%) diff --git a/client/src/components/CollectionForm.tsx b/client/src/components/Admin/CollectionForm.tsx similarity index 98% rename from client/src/components/CollectionForm.tsx rename to client/src/components/Admin/CollectionForm.tsx index ea4e6a0..8756939 100644 --- a/client/src/components/CollectionForm.tsx +++ b/client/src/components/Admin/CollectionForm.tsx @@ -1,5 +1,5 @@ import { useState, ChangeEvent, FormEvent } from 'react'; -import {Gift, GiftCollection} from "../types.tsx"; +import {Gift, GiftCollection} from "../../types.tsx"; diff --git a/client/src/components/CollectionItem.tsx b/client/src/components/Admin/CollectionItem.tsx similarity index 93% rename from client/src/components/CollectionItem.tsx rename to client/src/components/Admin/CollectionItem.tsx index d91a5fe..9c9d4db 100644 --- a/client/src/components/CollectionItem.tsx +++ b/client/src/components/Admin/CollectionItem.tsx @@ -1,5 +1,5 @@ //import Gift from "./Gift.tsx"; -import {Gift} from "../types.tsx"; +import {Gift} from "../../types.tsx"; type CollectionItemProps = { name: string; diff --git a/client/src/components/CollectionSelector.tsx b/client/src/components/Admin/CollectionSelector.tsx similarity index 95% rename from client/src/components/CollectionSelector.tsx rename to client/src/components/Admin/CollectionSelector.tsx index 6a209b8..ee2a755 100644 --- a/client/src/components/CollectionSelector.tsx +++ b/client/src/components/Admin/CollectionSelector.tsx @@ -1,6 +1,6 @@ import {useEffect} from "react"; import Select from "react-select"; -import { useAdmin } from '../Context/AdminContext'; +import { useAdmin } from '../../Context/AdminContext.tsx'; interface CollectionSelectorProps { selectedOption: Number | null; diff --git a/client/src/components/GiftForm.tsx b/client/src/components/Admin/GiftForm.tsx similarity index 99% rename from client/src/components/GiftForm.tsx rename to client/src/components/Admin/GiftForm.tsx index 4226863..c95f779 100644 --- a/client/src/components/GiftForm.tsx +++ b/client/src/components/Admin/GiftForm.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import axios from 'axios'; -import {Gift} from "../types.tsx"; +import {Gift} from "../../types.tsx"; const defaultGift: Gift = { diff --git a/client/src/components/GiftItem.tsx b/client/src/components/Admin/GiftItem.tsx similarity index 97% rename from client/src/components/GiftItem.tsx rename to client/src/components/Admin/GiftItem.tsx index d5dd9e9..c5c7d03 100644 --- a/client/src/components/GiftItem.tsx +++ b/client/src/components/Admin/GiftItem.tsx @@ -1,4 +1,4 @@ -import {Gift} from "../types.tsx"; +import {Gift} from "../../types.tsx"; diff --git a/client/src/components/Navbar.tsx b/client/src/components/Admin/Navbar.tsx similarity index 100% rename from client/src/components/Navbar.tsx rename to client/src/components/Admin/Navbar.tsx diff --git a/client/src/components/RequestCard.tsx b/client/src/components/Admin/RequestCard.tsx similarity index 93% rename from client/src/components/RequestCard.tsx rename to client/src/components/Admin/RequestCard.tsx index a1d10d6..c1d85a9 100644 --- a/client/src/components/RequestCard.tsx +++ b/client/src/components/Admin/RequestCard.tsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; -import ResponseCard from "./ResponseCard"; -import ResponseForm from "./ResponseForm"; -import { GiftRequest } from "../types"; +import ResponseCard from "./ResponseCard.tsx"; +import ResponseForm from "./ResponseForm.tsx"; +import { GiftRequest } from "../../types.tsx"; const RequestCard: React.FC = ({ ID, diff --git a/client/src/components/ResponseCard.tsx b/client/src/components/Admin/ResponseCard.tsx similarity index 92% rename from client/src/components/ResponseCard.tsx rename to client/src/components/Admin/ResponseCard.tsx index c0f4bc6..a3dd6f8 100644 --- a/client/src/components/ResponseCard.tsx +++ b/client/src/components/Admin/ResponseCard.tsx @@ -1,5 +1,5 @@ import React from "react"; -import { GiftResponse } from "../types"; +import { GiftResponse } from "../../types.tsx"; const ResponseCard: React.FC = ({ GiftCollection, diff --git a/client/src/components/ResponseForm.tsx b/client/src/components/Admin/ResponseForm.tsx similarity index 97% rename from client/src/components/ResponseForm.tsx rename to client/src/components/Admin/ResponseForm.tsx index 8f74657..aa96b15 100644 --- a/client/src/components/ResponseForm.tsx +++ b/client/src/components/Admin/ResponseForm.tsx @@ -1,4 +1,4 @@ -import CollectionSelector from "./CollectionSelector"; +import CollectionSelector from "./CollectionSelector.tsx"; import axios from "axios"; import React, {useState} from "react"; diff --git a/client/src/components/CollectionItemUpdated.tsx b/client/src/components/Home/CollectionItemUpdated.tsx similarity index 93% rename from client/src/components/CollectionItemUpdated.tsx rename to client/src/components/Home/CollectionItemUpdated.tsx index 3fcbc6d..2350d5f 100644 --- a/client/src/components/CollectionItemUpdated.tsx +++ b/client/src/components/Home/CollectionItemUpdated.tsx @@ -1,4 +1,4 @@ -import { Gift } from "../types.tsx"; +import { Gift } from "../../types.tsx"; type CollectionItemProps = { name: string; diff --git a/client/src/components/Filter.tsx b/client/src/components/Home/Filter.tsx similarity index 97% rename from client/src/components/Filter.tsx rename to client/src/components/Home/Filter.tsx index 1c16b2d..9f91e8f 100644 --- a/client/src/components/Filter.tsx +++ b/client/src/components/Home/Filter.tsx @@ -1,5 +1,5 @@ import React from "react"; -import FilterSection from "./FilterSection"; +import FilterSection from "./FilterSection.tsx"; const recipients = ["For Her", "For Him", "For Mom", "For Dad"]; const interests = ["Sports", "Cooking", "Games"]; diff --git a/client/src/components/FilterSection.tsx b/client/src/components/Home/FilterSection.tsx similarity index 100% rename from client/src/components/FilterSection.tsx rename to client/src/components/Home/FilterSection.tsx diff --git a/client/src/components/NavBarUpdated.tsx b/client/src/components/Home/NavBarUpdated.tsx similarity index 100% rename from client/src/components/NavBarUpdated.tsx rename to client/src/components/Home/NavBarUpdated.tsx diff --git a/client/src/components/SearchBar.tsx b/client/src/components/Home/SearchBar.tsx similarity index 100% rename from client/src/components/SearchBar.tsx rename to client/src/components/Home/SearchBar.tsx diff --git a/client/src/components/UpdatedGiftItem.tsx b/client/src/components/Home/UpdatedGiftItem.tsx similarity index 96% rename from client/src/components/UpdatedGiftItem.tsx rename to client/src/components/Home/UpdatedGiftItem.tsx index e587514..bc02d29 100644 --- a/client/src/components/UpdatedGiftItem.tsx +++ b/client/src/components/Home/UpdatedGiftItem.tsx @@ -1,4 +1,4 @@ -import { Gift } from "../types"; +import { Gift } from "../../types.tsx"; type GiftItemProps = { gift: Gift; diff --git a/client/src/components/FormInput.tsx b/client/src/components/Login/FormInput.tsx similarity index 100% rename from client/src/components/FormInput.tsx rename to client/src/components/Login/FormInput.tsx diff --git a/client/src/components/LoginForm.tsx b/client/src/components/Login/LoginForm.tsx similarity index 95% rename from client/src/components/LoginForm.tsx rename to client/src/components/Login/LoginForm.tsx index 3848424..cc87539 100644 --- a/client/src/components/LoginForm.tsx +++ b/client/src/components/Login/LoginForm.tsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { Link } from "react-router-dom"; -import FormInput, { FormInputProps } from "./FormInput"; -import { LoginInputs } from "../pages/LoginPage"; +import FormInput, { FormInputProps } from "./FormInput.tsx"; +import { LoginInputs } from "../../pages/LoginPage.tsx"; export type FormData = { title: string; diff --git a/client/src/components/GiftSortNavBar.tsx b/client/src/components/Nav/GiftSortNavBar.tsx similarity index 98% rename from client/src/components/GiftSortNavBar.tsx rename to client/src/components/Nav/GiftSortNavBar.tsx index 364b72a..288f5bd 100644 --- a/client/src/components/GiftSortNavBar.tsx +++ b/client/src/components/Nav/GiftSortNavBar.tsx @@ -1,5 +1,5 @@ import { useState } from "react"; -import Filter from "./Filter"; +import Filter from "../Home/Filter.tsx"; const GiftSortNavbar = () => { const [activeButton, setActiveButton] = useState(""); diff --git a/client/src/data/formData.ts b/client/src/data/formData.ts index 3ef4358..ec44a02 100644 --- a/client/src/data/formData.ts +++ b/client/src/data/formData.ts @@ -1,4 +1,4 @@ -import { FormData } from "../components/LoginForm"; +import { FormData } from "../components/Login/LoginForm.tsx"; export const loginFormData: FormData = { title: "Log In", diff --git a/client/src/pages/CollectionsPage.tsx b/client/src/pages/CollectionsPage.tsx index 6c63cb0..c158a82 100644 --- a/client/src/pages/CollectionsPage.tsx +++ b/client/src/pages/CollectionsPage.tsx @@ -1,7 +1,7 @@ import {useEffect, useState} from "react"; -import CollectionItem from "../components/CollectionItem"; -import EditForm from "../components/CollectionForm"; -import Navbar from "../components/Navbar"; +import CollectionItem from "../components/Admin/CollectionItem.tsx"; +import EditForm from "../components/Admin/CollectionForm.tsx"; +import Navbar from "../components/Admin/Navbar.tsx"; import {GiftCollection} from "../types.tsx"; import {useAdmin} from "../Context/AdminContext.tsx"; import axios from "axios"; diff --git a/client/src/pages/GiftManagementPage.tsx b/client/src/pages/GiftManagementPage.tsx index b211684..6e067b3 100644 --- a/client/src/pages/GiftManagementPage.tsx +++ b/client/src/pages/GiftManagementPage.tsx @@ -1,8 +1,8 @@ -import GiftItem from '../components/GiftItem' -import Navbar from "../components/Navbar"; +import GiftItem from '../components/Admin/GiftItem.tsx' +import Navbar from "../components/Admin/Navbar.tsx"; import {useAdmin} from "../Context/AdminContext.tsx"; import {useEffect, useState} from "react"; -import GiftForm from "../components/GiftForm.tsx"; +import GiftForm from "../components/Admin/GiftForm.tsx"; import {Gift} from "../types.tsx"; import axios from "axios"; diff --git a/client/src/pages/HomePage.tsx b/client/src/pages/HomePage.tsx index 2514d65..813714b 100644 --- a/client/src/pages/HomePage.tsx +++ b/client/src/pages/HomePage.tsx @@ -1,8 +1,8 @@ -import NavBar from "../components/NavBarUpdated"; -import CollectionItem from "../components/CollectionItemUpdated"; -import SearchBar from "../components/SearchBar"; -import GiftSortNavBar from "../components/GiftSortNavBar"; -import UpdatedGiftItem from "../components/UpdatedGiftItem"; +import NavBar from "../components/Home/NavBarUpdated.tsx"; +import CollectionItem from "../components/Home/CollectionItemUpdated.tsx"; +import SearchBar from "../components/Home/SearchBar.tsx"; +import GiftSortNavBar from "../components/Nav/GiftSortNavBar.tsx"; +import UpdatedGiftItem from "../components/Home/UpdatedGiftItem.tsx"; import axios from "axios"; import {useEffect, useState} from "react"; import {Gift, GiftCollection} from "../types.tsx"; diff --git a/client/src/pages/LoginPage.tsx b/client/src/pages/LoginPage.tsx index 10a54f0..f118bad 100644 --- a/client/src/pages/LoginPage.tsx +++ b/client/src/pages/LoginPage.tsx @@ -1,4 +1,4 @@ -import LoginForm from "../components/LoginForm"; +import LoginForm from "../components/Login/LoginForm.tsx"; import { loginFormData } from "../data/formData"; export type LoginInputs = { diff --git a/client/src/pages/RequestsPage.tsx b/client/src/pages/RequestsPage.tsx index 0dddf77..bbddb5a 100644 --- a/client/src/pages/RequestsPage.tsx +++ b/client/src/pages/RequestsPage.tsx @@ -1,5 +1,5 @@ -import Navbar from "../components/Navbar"; -import RequestCard from "../components/RequestCard"; +import Navbar from "../components/Admin/Navbar.tsx"; +import RequestCard from "../components/Admin/RequestCard.tsx"; import {useEffect, useState} from "react"; import Select, {ActionMeta} from "react-select"; import {GiftRequest} from "../types.tsx"; diff --git a/client/src/pages/SignUpPage.tsx b/client/src/pages/SignUpPage.tsx index 2f66152..34b1ec9 100644 --- a/client/src/pages/SignUpPage.tsx +++ b/client/src/pages/SignUpPage.tsx @@ -1,4 +1,4 @@ -import LoginForm from "../components/LoginForm"; +import LoginForm from "../components/Login/LoginForm.tsx"; import { LoginInputs } from "./LoginPage"; import { signUpFormData } from "../data/formData";