From 8b4e811512460f9c990e245d743c0fbe092620eb Mon Sep 17 00:00:00 2001
From: danieldeng2 <danieldeng223@gmail.com>
Date: Thu, 20 Aug 2020 00:11:57 +0100
Subject: [PATCH] Restructure folders

---
 .../molecules/DashboardButtonGroup/index.tsx  | 86 -------------------
 .../molecules/PageButtonGroup/index.tsx       | 43 ++++++++++
 .../components/SectionHeader}/index.tsx       |  0
 .../SectionHeader}/style.module.scss          |  0
 .../molecules/SelectionView/index.tsx         |  2 +-
 .../BottomBar}/BottomBarItem/index.tsx        |  0
 .../BottomBarItem/style.module.scss           |  0
 src/components/organisms/BottomBar/index.tsx  |  2 +-
 .../components}/NoticeItem/index.tsx          |  0
 .../components}/NoticeItem/style.module.scss  |  0
 .../organisms/NoticeBoard/index.tsx           |  2 +-
 .../TopBar/components}/NavBarBrand/index.tsx  |  0
 .../components}/NavBarBrand/style.module.scss |  0
 .../components}/NavBarTabGroup/index.tsx      |  2 +-
 .../NavBarTabGroup/style.module.scss          |  0
 .../components}/NavBarTabItem/index.tsx       |  0
 .../NavBarTabItem/style.module.scss           |  0
 src/components/organisms/TopBar/index.tsx     |  4 +-
 src/components/pages/Dashboard/index.tsx      | 56 +++++++++++-
 src/components/pages/ModuleOverview/index.tsx | 24 +-----
 20 files changed, 105 insertions(+), 116 deletions(-)
 delete mode 100644 src/components/molecules/DashboardButtonGroup/index.tsx
 create mode 100644 src/components/molecules/PageButtonGroup/index.tsx
 rename src/components/molecules/{ResourceSectionHeader => SelectionView/components/SectionHeader}/index.tsx (100%)
 rename src/components/molecules/{ResourceSectionHeader => SelectionView/components/SectionHeader}/style.module.scss (100%)
 rename src/components/{atoms => organisms/BottomBar}/BottomBarItem/index.tsx (100%)
 rename src/components/{atoms => organisms/BottomBar}/BottomBarItem/style.module.scss (100%)
 rename src/components/{atoms => organisms/NoticeBoard/components}/NoticeItem/index.tsx (100%)
 rename src/components/{atoms => organisms/NoticeBoard/components}/NoticeItem/style.module.scss (100%)
 rename src/components/{molecules => organisms/TopBar/components}/NavBarBrand/index.tsx (100%)
 rename src/components/{molecules => organisms/TopBar/components}/NavBarBrand/style.module.scss (100%)
 rename src/components/{molecules => organisms/TopBar/components}/NavBarTabGroup/index.tsx (89%)
 rename src/components/{molecules => organisms/TopBar/components}/NavBarTabGroup/style.module.scss (100%)
 rename src/components/{atoms => organisms/TopBar/components}/NavBarTabItem/index.tsx (100%)
 rename src/components/{atoms => organisms/TopBar/components}/NavBarTabItem/style.module.scss (100%)

diff --git a/src/components/molecules/DashboardButtonGroup/index.tsx b/src/components/molecules/DashboardButtonGroup/index.tsx
deleted file mode 100644
index 8a782a13d..000000000
--- a/src/components/molecules/DashboardButtonGroup/index.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-import React from "react";
-import Row from "react-bootstrap/Row";
-import Col from "react-bootstrap/Col";
-import {
-  faGlobe,
-  faFileAlt,
-  faPrint,
-  faFileInvoice,
-  faDatabase,
-  faQuestionCircle,
-  faBug,
-} from "@fortawesome/free-solid-svg-icons";
-import Button from "react-bootstrap/Button";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-
-export interface ButtonGroupProps {
-	loginShort: string;
-}
-
-const DashboardButtonGroup: React.FC<ButtonGroupProps> = ({loginShort}: ButtonGroupProps) => {
-	const buttons = [
-		{
-			title: "My Record",
-			icon: faFileInvoice,
-			url: "https://cate.doc.ic.ac.uk/student.cgi?key=2019",
-		},
-		{
-			title: "My Website",
-			icon: faGlobe,
-			url: `https://www.doc.ic.ac.uk/~${loginShort}/`,
-		},
-		{
-			title: "My Imperial",
-			icon: faFileAlt,
-			url: "https://my.imperial.ac.uk/HomeScreen.aspx",
-		},
-		{
-			title: "TeachDB",
-			icon: faDatabase,
-			url: "https://teachdb.doc.ic.ac.uk/db/",
-		},
-		{
-			title: "ICT Guides",
-			icon: faQuestionCircle,
-			url: "https://www.imperial.ac.uk/admin-services/ict/self-service/",
-		},
-		{
-			title: "CSG Guides",
-			icon: faQuestionCircle,
-			url: "https://www.imperial.ac.uk/computing/csg/guides/",
-		},
-		{
-			title: "Printing",
-			icon: faPrint,
-			url: "https://ictprintservice.imperial.ac.uk/safecom/webuser.dll/login",
-		},
-		{
-			title: "Report Bugs",
-			icon: faBug,
-			url: "https://gitlab.doc.ic.ac.uk/edtech/scientia/-/issues/new",
-		},
-	];
-	
-  return (
-    <>
-      <Row style={{ marginTop: "45px" }}>
-        {buttons.map(({ title, icon, url }, i) => (
-          <Col xs={6} sm={6} md={4} lg={4} xl={3} key={i} style={{ paddingRight: "10px", paddingLeft:"10px"}}>
-            <Button
-              href={url}
-              target="_blank"
-            >
-              {title}
-              <FontAwesomeIcon
-                style={{ fontSize: "1.125rem" }}
-                icon={icon}
-              />
-            </Button>
-          </Col>
-        ))}
-      </Row>
-    </>
-  );
-};
-
-export default DashboardButtonGroup;
\ No newline at end of file
diff --git a/src/components/molecules/PageButtonGroup/index.tsx b/src/components/molecules/PageButtonGroup/index.tsx
new file mode 100644
index 000000000..389f6800b
--- /dev/null
+++ b/src/components/molecules/PageButtonGroup/index.tsx
@@ -0,0 +1,43 @@
+import React from "react";
+import Row from "react-bootstrap/Row";
+import Col from "react-bootstrap/Col";
+import Button from "react-bootstrap/Button";
+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { IconDefinition } from "@fortawesome/free-solid-svg-icons";
+
+export interface ButtonGroupProps {
+  buttons: {
+    title: string;
+    icon: IconDefinition;
+    url: string;
+  }[];
+}
+
+const PageButtonGroup: React.FC<ButtonGroupProps> = ({
+  buttons,
+}: ButtonGroupProps) => {
+  return (
+    <>
+      <Row style={{ marginTop: "45px" }}>
+        {buttons.map(({ title, icon, url }, i) => (
+          <Col
+            xs={6}
+            sm={6}
+            md={4}
+            lg={4}
+            xl={3}
+            key={i}
+            style={{ paddingRight: "10px", paddingLeft: "10px" }}
+          >
+            <Button href={url} target="_blank">
+              {title}
+              <FontAwesomeIcon style={{ fontSize: "1.125rem" }} icon={icon} />
+            </Button>
+          </Col>
+        ))}
+      </Row>
+    </>
+  );
+};
+
+export default PageButtonGroup;
diff --git a/src/components/molecules/ResourceSectionHeader/index.tsx b/src/components/molecules/SelectionView/components/SectionHeader/index.tsx
similarity index 100%
rename from src/components/molecules/ResourceSectionHeader/index.tsx
rename to src/components/molecules/SelectionView/components/SectionHeader/index.tsx
diff --git a/src/components/molecules/ResourceSectionHeader/style.module.scss b/src/components/molecules/SelectionView/components/SectionHeader/style.module.scss
similarity index 100%
rename from src/components/molecules/ResourceSectionHeader/style.module.scss
rename to src/components/molecules/SelectionView/components/SectionHeader/style.module.scss
diff --git a/src/components/molecules/SelectionView/index.tsx b/src/components/molecules/SelectionView/index.tsx
index 869d7af83..6033e533c 100644
--- a/src/components/molecules/SelectionView/index.tsx
+++ b/src/components/molecules/SelectionView/index.tsx
@@ -1,5 +1,5 @@
 import React from "react";
-import ResourceSectionHeader from "../ResourceSectionHeader";
+import ResourceSectionHeader from "./components/SectionHeader";
 import { faSquare, faCheckSquare } from "@fortawesome/free-regular-svg-icons";
 
 interface SelectionItem {
diff --git a/src/components/atoms/BottomBarItem/index.tsx b/src/components/organisms/BottomBar/BottomBarItem/index.tsx
similarity index 100%
rename from src/components/atoms/BottomBarItem/index.tsx
rename to src/components/organisms/BottomBar/BottomBarItem/index.tsx
diff --git a/src/components/atoms/BottomBarItem/style.module.scss b/src/components/organisms/BottomBar/BottomBarItem/style.module.scss
similarity index 100%
rename from src/components/atoms/BottomBarItem/style.module.scss
rename to src/components/organisms/BottomBar/BottomBarItem/style.module.scss
diff --git a/src/components/organisms/BottomBar/index.tsx b/src/components/organisms/BottomBar/index.tsx
index e646a000f..4c0c2a3e6 100644
--- a/src/components/organisms/BottomBar/index.tsx
+++ b/src/components/organisms/BottomBar/index.tsx
@@ -2,7 +2,7 @@ import React from "react";
 import Navbar from "react-bootstrap/Navbar";
 import ButtonGroup from "react-bootstrap/ButtonGroup";
 import { IconDefinition } from "@fortawesome/free-solid-svg-icons";
-import BottomBarItem from "components/atoms/BottomBarItem";
+import BottomBarItem from "components/organisms/BottomBar/BottomBarItem";
 import styles from "./style.module.scss"
 
 export interface BottomBarProps {
diff --git a/src/components/atoms/NoticeItem/index.tsx b/src/components/organisms/NoticeBoard/components/NoticeItem/index.tsx
similarity index 100%
rename from src/components/atoms/NoticeItem/index.tsx
rename to src/components/organisms/NoticeBoard/components/NoticeItem/index.tsx
diff --git a/src/components/atoms/NoticeItem/style.module.scss b/src/components/organisms/NoticeBoard/components/NoticeItem/style.module.scss
similarity index 100%
rename from src/components/atoms/NoticeItem/style.module.scss
rename to src/components/organisms/NoticeBoard/components/NoticeItem/style.module.scss
diff --git a/src/components/organisms/NoticeBoard/index.tsx b/src/components/organisms/NoticeBoard/index.tsx
index 307b667aa..abdc6acfe 100644
--- a/src/components/organisms/NoticeBoard/index.tsx
+++ b/src/components/organisms/NoticeBoard/index.tsx
@@ -1,5 +1,5 @@
 import React from "react";
-import NoticeItem from "components/atoms/NoticeItem";
+import NoticeItem from "components/organisms/NoticeBoard/components/NoticeItem";
 
 const NoticeBoard: React.FC = () => {
   return (
diff --git a/src/components/molecules/NavBarBrand/index.tsx b/src/components/organisms/TopBar/components/NavBarBrand/index.tsx
similarity index 100%
rename from src/components/molecules/NavBarBrand/index.tsx
rename to src/components/organisms/TopBar/components/NavBarBrand/index.tsx
diff --git a/src/components/molecules/NavBarBrand/style.module.scss b/src/components/organisms/TopBar/components/NavBarBrand/style.module.scss
similarity index 100%
rename from src/components/molecules/NavBarBrand/style.module.scss
rename to src/components/organisms/TopBar/components/NavBarBrand/style.module.scss
diff --git a/src/components/molecules/NavBarTabGroup/index.tsx b/src/components/organisms/TopBar/components/NavBarTabGroup/index.tsx
similarity index 89%
rename from src/components/molecules/NavBarTabGroup/index.tsx
rename to src/components/organisms/TopBar/components/NavBarTabGroup/index.tsx
index 219e2d6be..fedf9ecd0 100644
--- a/src/components/molecules/NavBarTabGroup/index.tsx
+++ b/src/components/organisms/TopBar/components/NavBarTabGroup/index.tsx
@@ -1,7 +1,7 @@
 import React from "react";
 import Navbar from "react-bootstrap/Navbar";
 import Nav from "react-bootstrap/Nav";
-import NavBarTabItem from "components/atoms/NavBarTabItem";
+import NavBarTabItem from "components/organisms/TopBar/components/NavBarTabItem";
 import styles from "./style.module.scss"
 import cx from "classnames";
 
diff --git a/src/components/molecules/NavBarTabGroup/style.module.scss b/src/components/organisms/TopBar/components/NavBarTabGroup/style.module.scss
similarity index 100%
rename from src/components/molecules/NavBarTabGroup/style.module.scss
rename to src/components/organisms/TopBar/components/NavBarTabGroup/style.module.scss
diff --git a/src/components/atoms/NavBarTabItem/index.tsx b/src/components/organisms/TopBar/components/NavBarTabItem/index.tsx
similarity index 100%
rename from src/components/atoms/NavBarTabItem/index.tsx
rename to src/components/organisms/TopBar/components/NavBarTabItem/index.tsx
diff --git a/src/components/atoms/NavBarTabItem/style.module.scss b/src/components/organisms/TopBar/components/NavBarTabItem/style.module.scss
similarity index 100%
rename from src/components/atoms/NavBarTabItem/style.module.scss
rename to src/components/organisms/TopBar/components/NavBarTabItem/style.module.scss
diff --git a/src/components/organisms/TopBar/index.tsx b/src/components/organisms/TopBar/index.tsx
index 096685faf..dc0926e5b 100644
--- a/src/components/organisms/TopBar/index.tsx
+++ b/src/components/organisms/TopBar/index.tsx
@@ -2,8 +2,8 @@ import React from "react";
 import Container from "react-bootstrap/Container";
 import Navbar from "react-bootstrap/Navbar";
 import userPic from "assets/images/user.png";
-import NavBarTabGroup from "components/molecules/NavBarTabGroup";
-import NavBarBrand from "components/molecules/NavBarBrand";
+import NavBarTabGroup from "components/organisms/TopBar/components/NavBarTabGroup";
+import NavBarBrand from "components/organisms/TopBar/components/NavBarBrand";
 import styles from "./style.module.scss";
 
 export interface TopBarProps {
diff --git a/src/components/pages/Dashboard/index.tsx b/src/components/pages/Dashboard/index.tsx
index 3e743224e..436364184 100644
--- a/src/components/pages/Dashboard/index.tsx
+++ b/src/components/pages/Dashboard/index.tsx
@@ -3,16 +3,25 @@ import MyBreadcrumbs from "components/atoms/MyBreadcrumbs";
 import Row from "react-bootstrap/Row";
 import Col from "react-bootstrap/Col";
 import PersonCard from "components/atoms/PersonCard";
-import DashboardButtonGroup from "components/molecules/DashboardButtonGroup";
+import DashboardButtonGroup from "components/molecules/PageButtonGroup";
 import TutorCardGroup from "components/molecules/TutorCardGroup";
 import NoticeBoard from "components/organisms/NoticeBoard";
+import {
+  faGlobe,
+  faFileAlt,
+  faPrint,
+  faFileInvoice,
+  faDatabase,
+  faQuestionCircle,
+  faBug,
+} from "@fortawesome/free-solid-svg-icons";
 
 const Dashboard: React.FC = () => {
   return (
     <>
       <MyBreadcrumbs />
       <PersonCard />
-      <DashboardButtonGroup loginShort="br819"/>
+      <DashboardButtonGroup buttons={buttons}/>
       <Row>
         <Col xs={12} sm={12} md={12} lg={6} style={{ marginTop: "30px", paddingRight: "10px", paddingLeft: "10px"}}>
           <TutorCardGroup />
@@ -25,4 +34,47 @@ const Dashboard: React.FC = () => {
   );
 };
 
+const buttons = [
+	{
+		title: "My Record",
+		icon: faFileInvoice,
+		url: "https://cate.doc.ic.ac.uk/student.cgi?key=2019",
+	},
+	{
+		title: "My Website",
+		icon: faGlobe,
+		url: `https://www.doc.ic.ac.uk/~br819/`,
+	},
+	{
+		title: "My Imperial",
+		icon: faFileAlt,
+		url: "https://my.imperial.ac.uk/HomeScreen.aspx",
+	},
+	{
+		title: "TeachDB",
+		icon: faDatabase,
+		url: "https://teachdb.doc.ic.ac.uk/db/",
+	},
+	{
+		title: "ICT Guides",
+		icon: faQuestionCircle,
+		url: "https://www.imperial.ac.uk/admin-services/ict/self-service/",
+	},
+	{
+		title: "CSG Guides",
+		icon: faQuestionCircle,
+		url: "https://www.imperial.ac.uk/computing/csg/guides/",
+	},
+	{
+		title: "Printing",
+		icon: faPrint,
+		url: "https://ictprintservice.imperial.ac.uk/safecom/webuser.dll/login",
+	},
+	{
+		title: "Report Bugs",
+		icon: faBug,
+		url: "https://gitlab.doc.ic.ac.uk/edtech/scientia/-/issues/new",
+	},
+];
+
 export default Dashboard;
diff --git a/src/components/pages/ModuleOverview/index.tsx b/src/components/pages/ModuleOverview/index.tsx
index cdb663165..f112b0dca 100644
--- a/src/components/pages/ModuleOverview/index.tsx
+++ b/src/components/pages/ModuleOverview/index.tsx
@@ -2,12 +2,9 @@ import React from "react";
 import Dandruff from "components/molecules/Dandruff";
 import { useParams } from "react-router-dom";
 import styles from "./style.module.scss";
-import Row from "react-bootstrap/Row";
-import Col from "react-bootstrap/Col";
-import Button from "react-bootstrap/Button";
 import classNames from "classnames";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
 import { faGlobe, faLink } from "@fortawesome/free-solid-svg-icons";
+import PageButtonGroup from "components/molecules/PageButtonGroup";
 
 const ModuleOverview: React.FC = () => {
   let { id } = useParams();
@@ -91,24 +88,7 @@ const ModuleOverview: React.FC = () => {
       </p>
 
       <h4 className={classNames(styles.moduleSectionHeader)}>Links</h4>
-      <Row style={{ marginTop: "1.25rem" }}>
-        {buttons.map(({ title, icon, url }, i) => (
-          <Col
-            xs={6}
-            sm={6}
-            md={4}
-            lg={4}
-            xl={3}
-            key={i}
-            style={{ paddingRight: "10px", paddingLeft: "10px" }}
-          >
-            <Button href={url} target="_blank">
-              {title}
-              <FontAwesomeIcon style={{ fontSize: "1.125rem" }} icon={icon} />
-            </Button>
-          </Col>
-        ))}
-      </Row>
+      <PageButtonGroup buttons={buttons}/>
     </>
   );
 };
-- 
GitLab