Skip to content

Commit

Permalink
Move categories APIs into separate directory
Browse files Browse the repository at this point in the history
  • Loading branch information
LillianHo5 committed May 28, 2024
1 parent 5b933ba commit b7b7881
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion admin-portal-frontend/src/app/all-page/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useEffect, useState } from "react";
import FilterIcon from "../icons/filter.svg";

import { deletePage, getAllCategories } from "../components/categoryRoutes";
import { deletePage, getAllCategories } from "../api/Categories";
import PageContainer from "../components/PageContainer";
import Toast from "../components/Toast";

Expand Down
12 changes: 6 additions & 6 deletions admin-portal-frontend/src/app/components/CategoryContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import EditIcon from "../icons/edit.svg";
import TrashIcon from "../icons/trash.svg";

import DeleteConfirmationPopup from "./DeletePopup";
import { Category } from "./categoryRoutes";
import { Category } from "../api/Categories";

type IconProps = {
'content-type': string,
src: string
}
"content-type": string;
src: string;
};

type CategoryItemProps = {
id: string;
Expand Down Expand Up @@ -69,11 +69,11 @@ const CategoryItem: React.FC<CategoryItemProps> = ({ id, title, pages, onDeleteC
setAllowEdits(!allowEdits);
}}
>
<img src={( EditIcon as IconProps ).src} alt="Edit" className="w-4 h-4" />
<img src={(EditIcon as IconProps).src} alt="Edit" className="w-4 h-4" />
</button>
<button className="bg-[#E5EFF5] p-2 rounded-full border border-black">
<img
src={( TrashIcon as IconProps ).src}
src={(TrashIcon as IconProps).src}
alt="Delete"
className="w-4 h-4"
onClick={() => {
Expand Down
2 changes: 1 addition & 1 deletion admin-portal-frontend/src/app/components/PageContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import TrashIcon from "../icons/trash.svg";

import DeleteConfirmationPopup from "./DeletePopup";

import { Category } from "./categoryRoutes";
import { Category } from "../api/Categories";

type IconProps = {
"content-type": string;
Expand Down
2 changes: 1 addition & 1 deletion admin-portal-frontend/src/app/emergencies/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEffect, useState } from "react";

import { CategoryContainer } from "../components/CategoryContainer";
import Toast from "../components/Toast";
import { deleteCategory, getAllCategories } from "../components/categoryRoutes";
import { deleteCategory, getAllCategories } from "../api/Categories";

export default function CategoriesPage() {
const [categories, setCategories] = useState([]);
Expand Down
2 changes: 1 addition & 1 deletion admin-portal-frontend/src/app/general-principles/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useEffect, useState } from "react";

import { CategoryContainer } from "../components/CategoryContainer";
import Toast from "../components/Toast";
import { deleteCategory, getAllCategories } from "../components/categoryRoutes";
import { deleteCategory, getAllCategories } from "../api/Categories";

export default function CategoriesPage() {
const [categories, setCategories] = useState([]);
Expand Down
6 changes: 4 additions & 2 deletions admin-portal-frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ import React from "react";
import HorizontalNavBar from "./components/HorizontalNavbar";
import VerticalNavBar from "./components/VerticalNavBar";
import styles from "./pageStyles";
import AllPage from "./all-page/page";

const AnotherPage: React.FC = () => {
return (
<div>
<div style={styles.verticalNavBar}>
{/* <div style={styles.verticalNavBar}>
<VerticalNavBar />
</div>
<div style={styles.horizontalNavBar}>
<HorizontalNavBar />
</div>
</div> */}
<AllPage />
</div>
);
};
Expand Down

0 comments on commit b7b7881

Please sign in to comment.