From 18ab4e62b98c53a6d2695e19b78fc050d9fb2565 Mon Sep 17 00:00:00 2001 From: danieldeng2 <danieldeng223@gmail.com> Date: Tue, 18 Aug 2020 13:13:07 +0100 Subject: [PATCH] Remove initial example page --- .../components/pages/StandardView/index.tsx | 4 +- .../src/components/pages/Timeline/index.tsx | 12 ++++++ .../pages/Timeline/style.module.scss | 0 .../templates/ExamplePage/ExampleButtons.tsx | 37 ------------------- .../templates/ExamplePage/ExampleToasts.tsx | 26 ------------- .../templates/ExamplePage/index.tsx | 29 --------------- 6 files changed, 14 insertions(+), 94 deletions(-) create mode 100644 frontend/src/components/pages/Timeline/index.tsx create mode 100644 frontend/src/components/pages/Timeline/style.module.scss delete mode 100644 frontend/src/components/templates/ExamplePage/ExampleButtons.tsx delete mode 100644 frontend/src/components/templates/ExamplePage/ExampleToasts.tsx delete mode 100644 frontend/src/components/templates/ExamplePage/index.tsx diff --git a/frontend/src/components/pages/StandardView/index.tsx b/frontend/src/components/pages/StandardView/index.tsx index e8666b8cd..d067af860 100644 --- a/frontend/src/components/pages/StandardView/index.tsx +++ b/frontend/src/components/pages/StandardView/index.tsx @@ -1,6 +1,6 @@ import React, { useState } from "react"; import { Route, Switch, Redirect } from "react-router-dom"; -import ExamplePage from "components/templates/ExamplePage"; +import Timeline from "components/pages/Timeline"; import ModuleOverview from "components/pages/ModuleOverview"; import Dashboard from "components/pages/Dashboard"; import Exams from "components/pages/Exams"; @@ -82,7 +82,7 @@ const StandardView: React.FC<StandardViewProps> = ({ <Route path="/modules/:id/feedback" component={ModuleFeedback} /> <Route path="/timeline"> - <ExamplePage name="Timeline" /> + <Timeline/> </Route> <Route path="/exams/overview"> diff --git a/frontend/src/components/pages/Timeline/index.tsx b/frontend/src/components/pages/Timeline/index.tsx new file mode 100644 index 000000000..a86a366c3 --- /dev/null +++ b/frontend/src/components/pages/Timeline/index.tsx @@ -0,0 +1,12 @@ +import React from "react"; +import Dandruff from "components/molecules/Dandruff"; + +const Timeline: React.FC = () => { + return ( + <> + <Dandruff heading="Timeline" /> + </> + ); +}; + +export default Timeline; diff --git a/frontend/src/components/pages/Timeline/style.module.scss b/frontend/src/components/pages/Timeline/style.module.scss new file mode 100644 index 000000000..e69de29bb diff --git a/frontend/src/components/templates/ExamplePage/ExampleButtons.tsx b/frontend/src/components/templates/ExamplePage/ExampleButtons.tsx deleted file mode 100644 index 6a3366b67..000000000 --- a/frontend/src/components/templates/ExamplePage/ExampleButtons.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from "react"; - -import Button from "react-bootstrap/Button"; - -const ButtonsShowcase: React.FC = () => ( - <div className="p-1"> - <Button variant="primary" className="mr-1"> - Primary - </Button> - <Button variant="secondary" className="mr-1"> - Secondary - </Button> - <Button variant="success" className="mr-1"> - Success - </Button> - <Button variant="warning" className="mr-1"> - Warning - </Button> - <Button variant="danger" className="mr-1"> - Danger - </Button> - <Button variant="info" className="mr-1"> - Info - </Button> - <Button variant="light" className="mr-1"> - Light - </Button> - <Button variant="dark" className="mr-1"> - Dark - </Button> - <Button variant="link" className="mr-1"> - Link - </Button> - </div> -); - -export default ButtonsShowcase; diff --git a/frontend/src/components/templates/ExamplePage/ExampleToasts.tsx b/frontend/src/components/templates/ExamplePage/ExampleToasts.tsx deleted file mode 100644 index 076c3689c..000000000 --- a/frontend/src/components/templates/ExamplePage/ExampleToasts.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React, { useState } from "react"; - -import Toast from "react-bootstrap/Toast"; -import Button from "react-bootstrap/Button"; - -const ToastsShowcase: React.FC = () => { - const [show, toggleShow] = useState(false); - - return ( - <> - {!show && <Button onClick={() => toggleShow(true)}>Show Toast</Button>} - {/* - // @ts-ignore */} - <Toast show={show} onClose={() => toggleShow(false)}> - <Toast.Header> - <img src="holder.js/20x20?text=%20" className="rounded mr-2" alt="" /> - <strong className="mr-auto">Bootstrap</strong> - <small>11 mins ago</small> - </Toast.Header> - <Toast.Body>Hello, world! This is a toast message.</Toast.Body> - </Toast> - </> - ); -}; - -export default ToastsShowcase; diff --git a/frontend/src/components/templates/ExamplePage/index.tsx b/frontend/src/components/templates/ExamplePage/index.tsx deleted file mode 100644 index 35212e2cf..000000000 --- a/frontend/src/components/templates/ExamplePage/index.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from "react"; - -import Jumbotron from "react-bootstrap/Jumbotron"; - -import ButtonsShowcase from "components/templates/ExamplePage/ExampleButtons"; -import ToastsShowcase from "components/templates/ExamplePage/ExampleToasts"; - -export interface ExamplePageProps { - name: string; -} - - -const ExamplePage: React.FC<ExamplePageProps> = ({name} : ExamplePageProps) => { - return ( - <> - <Jumbotron> - <h1 className="header"> - Welcome To {name} - </h1> - </Jumbotron> - <h2>Buttons</h2> - <ButtonsShowcase /> - <h2>Toasts</h2> - <ToastsShowcase /> - </> - ); -}; - -export default ExamplePage; -- GitLab