diff --git a/src/components/atoms/ModuleCard/index.tsx b/src/components/atoms/ModuleCard/index.tsx index 59059a7b0ee64ef80af6c5b350cb5193c41dccee..130d3b8892edda1064614e1fff34c2454e0a6c5a 100644 --- a/src/components/atoms/ModuleCard/index.tsx +++ b/src/components/atoms/ModuleCard/index.tsx @@ -6,12 +6,7 @@ import Col from "react-bootstrap/Col"; import { Link } from "react-router-dom"; import { faSun, faLeaf, faSeedling } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; - -export enum Term { - AUTUMN, - SPRING, - SUMMER -} +import { Term } from "constants/types"; export enum ProgressStatus { NOT_STARTED = "Not Started", diff --git a/src/components/molecules/CategoryList/index.tsx b/src/components/molecules/CategoryList/index.tsx index 9884daf02dd0202af936b17542c1e8396d4cf722..71b48684e754b48a68db5b6e4a4684fe0dc41624 100644 --- a/src/components/molecules/CategoryList/index.tsx +++ b/src/components/molecules/CategoryList/index.tsx @@ -1,8 +1,9 @@ import React from "react"; import { faSquare, faCheckSquare } from "@fortawesome/free-regular-svg-icons"; -import { Resource, resourceTypeToIcon } from "../../pages/ModuleResources/utils"; +import { resourceTypeToIcon } from "../../pages/ModuleResources/utils"; import { SelectionProps } from "components/molecules/SelectionView"; import FileListItem from "components/atoms/FileListItem"; +import { Resource } from "constants/types"; export interface CategoryListProps { categoryItems: Resource[]; diff --git a/src/components/pages/ModuleList/list.ts b/src/components/pages/ModuleList/list.ts index aa3b28f916674f924992d57c79db880e74b028a8..d97c5f437d7d59702eecac2c91e0acebbcf35fb6 100644 --- a/src/components/pages/ModuleList/list.ts +++ b/src/components/pages/ModuleList/list.ts @@ -8,7 +8,8 @@ import reasoningIllustration from "assets/images/reasoning-illustration.png"; import architectureIllustration from "assets/images/architecture-illustration.png"; import databaseIllustration from "assets/images/database-illustration.png"; -import { Term, ProgressStatus } from "components/atoms/ModuleCard"; +import { ProgressStatus } from "components/atoms/ModuleCard"; +import { Term } from "constants/types"; export const modulesList = [ { diff --git a/src/components/pages/ModuleOverview/index.tsx b/src/components/pages/ModuleOverview/index.tsx index 572ab3a34154ce1b9b51453ec97ebbfc103d207e..d8283b20b584f8804df321e6dc65465a26fed41b 100644 --- a/src/components/pages/ModuleOverview/index.tsx +++ b/src/components/pages/ModuleOverview/index.tsx @@ -10,12 +10,12 @@ import MyBreadcrumbs from "components/atoms/MyBreadcrumbs"; import FileListItem from "components/atoms/FileListItem"; import { resourceTypeToIcon, - Resource, openResource, tags, } from "../ModuleResources/utils"; import LoadingScreen from "components/molecules/LoadingScreen"; import { titleCase } from "utils/functions"; +import { Resource } from "constants/types"; export interface ModuleOverviewProps { year: string; diff --git a/src/components/pages/ModuleResources/components/CurrentDirectoryView.tsx b/src/components/pages/ModuleResources/components/CurrentDirectoryView.tsx index 234007cb1648a4e232aab37769a8dfdb39c953f7..863d69b4329581ac33b5eba49e169f15557a2d11 100644 --- a/src/components/pages/ModuleResources/components/CurrentDirectoryView.tsx +++ b/src/components/pages/ModuleResources/components/CurrentDirectoryView.tsx @@ -1,9 +1,9 @@ import React from "react"; -import { Resource } from "../utils"; import SelectionView, { SelectionProps } from "components/molecules/SelectionView"; import CurrentDirectoryRow from "components/molecules/CurrentDirectoryRow"; +import { Resource } from "constants/types"; export interface CurrentDirectoryViewProps { resources: Resource[]; diff --git a/src/components/pages/ModuleResources/components/FoldersView.tsx b/src/components/pages/ModuleResources/components/FoldersView.tsx index 7a35e17ef23ae8c7649449c7d5471cd6cf5b517d..dc8721ae23b85cd568e25ede52192c29003199a8 100644 --- a/src/components/pages/ModuleResources/components/FoldersView.tsx +++ b/src/components/pages/ModuleResources/components/FoldersView.tsx @@ -1,10 +1,10 @@ import React from "react"; -import { Folder } from "../utils"; import SelectionView, { SelectionProps } from "components/molecules/SelectionView"; import FoldersRow from "components/molecules/FoldersRow"; import { useHistory, useLocation } from "react-router-dom"; +import { Folder } from "constants/types"; export interface FoldersViewProps { folders: Folder[]; diff --git a/src/components/pages/ModuleResources/components/ListView.tsx b/src/components/pages/ModuleResources/components/ListView.tsx index 1f0dee1c894db14693aff75523a0c3d757ac7a8d..7ca236fb4d87811459dc9bf472e691aa0ca9cdaa 100644 --- a/src/components/pages/ModuleResources/components/ListView.tsx +++ b/src/components/pages/ModuleResources/components/ListView.tsx @@ -1,11 +1,11 @@ import React from "react"; -import { Resource, Folder } from "../utils"; import SelectionView, { SelectionProps } from "components/molecules/SelectionView"; import CategoryList from "components/molecules/CategoryList"; import CategoryHeader from "components/molecules/CategoryHeader"; import { faSquare, faCheckSquare } from "@fortawesome/free-regular-svg-icons"; +import { Folder, Resource } from "constants/types"; export interface ListViewProps { folders: Folder[]; diff --git a/src/components/pages/ModuleResources/components/QuickAccessView.tsx b/src/components/pages/ModuleResources/components/QuickAccessView.tsx index 8dda0dbda8406fc73290686bffb8997b4b3c039f..fcad4e9a58f1b42eac6e727c805dc804a1d8faf1 100644 --- a/src/components/pages/ModuleResources/components/QuickAccessView.tsx +++ b/src/components/pages/ModuleResources/components/QuickAccessView.tsx @@ -1,9 +1,9 @@ import React from "react"; -import { Resource } from "../utils"; import SelectionView, { SelectionProps, } from "components/molecules/SelectionView"; import QuickAccessRow from "components/molecules/QuickAccessRow"; +import { Resource } from "constants/types"; export interface QuickAccessViewProps { resources: Resource[]; diff --git a/src/components/pages/ModuleResources/components/StaffView.tsx b/src/components/pages/ModuleResources/components/StaffView.tsx index 937041e55d28caafbf51c7cb1ee7d9f2bb9dbddb..489b06fdf6c13565462e703b0ea196d96af61c6e 100644 --- a/src/components/pages/ModuleResources/components/StaffView.tsx +++ b/src/components/pages/ModuleResources/components/StaffView.tsx @@ -9,12 +9,12 @@ import { faDownload, faTrash, faUpload } from "@fortawesome/free-solid-svg-icons import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import UploadModal from "./UploadModal" import AlertModal from "../../../atoms/AlertModal" -import { Resource, Folder } from "../utils"; import CategoryList from "components/molecules/CategoryList"; import CategoryHeader from "components/molecules/CategoryHeader"; import { staffRequest, download } from "utils/api" import { api, methods } from "constants/routes" +import { Folder, Resource } from "constants/types"; export interface StaffViewProps { year: string; diff --git a/src/components/pages/ModuleResources/index.tsx b/src/components/pages/ModuleResources/index.tsx index ab5ef80aa8a0ae5f3bf027e7f6548356ea501bcc..342b6ef2db33625325238952fa3e53e492bef904 100644 --- a/src/components/pages/ModuleResources/index.tsx +++ b/src/components/pages/ModuleResources/index.tsx @@ -12,7 +12,8 @@ import StaffView from "./components/StaffView"; import MyBreadcrumbs from "components/atoms/MyBreadcrumbs"; import LoadingScreen from "components/molecules/LoadingScreen"; -import { Resource, openResource, tags, folders } from "./utils"; +import { openResource, tags, folders } from "./utils"; +import { Resource } from "constants/types"; export interface ResourcesProps { year: string; diff --git a/src/components/pages/ModuleResources/utils.ts b/src/components/pages/ModuleResources/utils.ts index b650b0ede180534519d8a2b52ce46d97d2d936ad..f94052093b1aa89b7907bab8eb15006ec28849fb 100644 --- a/src/components/pages/ModuleResources/utils.ts +++ b/src/components/pages/ModuleResources/utils.ts @@ -7,21 +7,7 @@ import { } from "@fortawesome/free-solid-svg-icons"; import { request } from "../../../utils/api"; import { api, methods } from "../../../constants/routes"; - -export interface Folder { - title: string; - id: number; -} - -export interface Resource { - title: string; - type: string; - tags: string[]; - folder: string; - id: number; - path?: string; - thumbnail?: string; -} +import { Resource, Folder } from "constants/types"; export function tags(resources: Resource[]) { let tagSet = new Set<string>(); diff --git a/src/components/pages/StandardView/index.tsx b/src/components/pages/StandardView/index.tsx index db364f6f9e75a16444b5bdec113505e626e9b2f5..143dd75f95a934ea8c55f422e969dbbec4761916 100644 --- a/src/components/pages/StandardView/index.tsx +++ b/src/components/pages/StandardView/index.tsx @@ -39,6 +39,7 @@ const StandardView: React.FC<StandardViewProps> = ({ initTimelineSideBar, }: StandardViewProps) => { const [modulesFilter, setModulesFilter] = useState("In Progress"); + const [timelineTerm, setTimelineTerm] = useState("In Progress"); return ( <div diff --git a/src/components/pages/Timeline/components/EventGrid/index.tsx b/src/components/pages/Timeline/components/EventGrid/index.tsx index 4a5284f0e8509b4b4cb191bf983ce4af855cf73c..ffb57d17bbc96b68e3197c1029da6d945e493d5a 100644 --- a/src/components/pages/Timeline/components/EventGrid/index.tsx +++ b/src/components/pages/Timeline/components/EventGrid/index.tsx @@ -1,6 +1,6 @@ import React from "react"; import styles from "./style.module.scss"; -import { TimelineEvent, ModuleTracks } from "../.."; +import { ModuleTracks } from "../.."; import TimelineEventCard from "../TimelineEventCard"; export interface EventGridProps { numWeeks: number; diff --git a/src/constants/types.ts b/src/constants/types.ts new file mode 100644 index 0000000000000000000000000000000000000000..1acb08ac56e6ea7d0e20174a8b52d60947b5cd61 --- /dev/null +++ b/src/constants/types.ts @@ -0,0 +1,20 @@ +export enum Term { + AUTUMN, + SPRING, + SUMMER +} + +export interface Folder { + title: string; + id: number; +} + +export interface Resource { + title: string; + type: string; + tags: string[]; + folder: string; + id: number; + path?: string; + thumbnail?: string; +} \ No newline at end of file