From 604a639da51c99be329b13450cf7ba03502d8faa Mon Sep 17 00:00:00 2001 From: pratyush1718 Date: Tue, 21 May 2024 22:32:54 -0700 Subject: [PATCH] initial commit --- .../src/app/Profile Icon.png | Bin 0 -> 1569 bytes .../src/app/RightArrowComponent.tsx | 11 ++++ .../src/app/api/categories.tsx | 26 +++++++++ .../src/app/components/BlankPageComponent.tsx | 15 ++++++ .../src/app/components/VerticalNavBar.tsx | 50 ++++++++++++------ admin-portal-frontend/src/app/icons/Home.png | Bin 0 -> 765 bytes .../src/app/icons/gen principles.png | Bin 0 -> 355 bytes .../src/app/icons/ic_search.png | Bin 0 -> 768 bytes admin-portal-frontend/src/app/page.tsx | 23 ++++++-- admin-portal-frontend/src/app/pageStyles.tsx | 8 +++ 10 files changed, 113 insertions(+), 20 deletions(-) create mode 100644 admin-portal-frontend/src/app/Profile Icon.png create mode 100644 admin-portal-frontend/src/app/RightArrowComponent.tsx create mode 100644 admin-portal-frontend/src/app/api/categories.tsx create mode 100644 admin-portal-frontend/src/app/components/BlankPageComponent.tsx create mode 100644 admin-portal-frontend/src/app/icons/Home.png create mode 100644 admin-portal-frontend/src/app/icons/gen principles.png create mode 100644 admin-portal-frontend/src/app/icons/ic_search.png diff --git a/admin-portal-frontend/src/app/Profile Icon.png b/admin-portal-frontend/src/app/Profile Icon.png new file mode 100644 index 0000000000000000000000000000000000000000..33b031a8710f778051f546dd18df72a82adfb172 GIT binary patch literal 1569 zcmV++2HyFJP)3Pe{RQlobx6-25aPz7cx$hm^h&l*YI6&E&# zy1j1zga^MF4mAW0IQ;K!Z*TV?fPsO5fq{X(asVxJb#*ntuY5Eby?K6qp5ov1q2IEd zQx$*K2L}hMr>CcT{ChQ<&DPK&tq8=T6!@UW_?<%>6<+5S1-nDB6f{hu0--QDKFlS= ziy~2BFZ_r?RnQQP2-JcwyC}S0adB~R2Z>245DJrFML$7%!t7FVk5Z6`5hMb|Ash1< zx)X;u!8-i2TrU5FL`3%>Ho$YN*o8+inu%^{cEWEp9*T2PGn(n} zlf!1V%fOvQQ4}+XBuXF>hgu9amA63;U*hzBdwza?4*}r)rrZ!YxQVqwasP-Ja=`+z zy&-Wj%c0%r>Xw)>=VJ(D0#q;^!~J zY174GaRr`u4KW_~pTvvdkfIg^ziX0HNz-x;KYAsJO9qyf6Sv@jZOGvFjyMZs zvpc@xcsP~bM%E(IntQkc2b_nPWyUBy#hH3Il_cb6Dg%zNU6O{|#54+aaS{kC_W{37 zgu~Rr&JNjDPn>`|Fa8#l^(a$-Y`Ak8+TehbKv+4^xN-M)o~Z)Fsqt!gsuMYhAlKs( z9Iy(+N@v1N=03K8dtwIRIJZ1OGbz^u92$X>*re1{4XpBM_ z1wteDK{!-Fk1+Kj4yA~Q0@c|E;i5|jLqR-2OBl|I=r9g5QxB4cgNj&ZRS-|my*aQi z4YOmZoG6f?Q1BwuvY2#&Qa%ulR5p_ehyrm^?-f|V3IgF)tRNf}leyp!?<=HdB}_wX z;&T&MurjA0bae~l8NY)F&<=eO4h0F6X$y=-3L@ax4LzujNb8ue=@wGs1{vv0_v6{w z*%yd}j68)Lz-?Bm5(eO;M#-cCzd%QDZ#cr(&3pE@>WvHp9jmanmZ2FC;ht-ZDteXa zOrRPzy2(?Pnl~lka z(8}{Bdk-4@x56RO1)n8~^K$u~%E^%D`qXA_bw^p6wJbhD)8ty_ITu1(y3w zN<4@|j0;rSLYkF6Z=m{*X_8ATokAD++Efd1&Z{NN25IjAk4nBo!E2{Yi=HILW#ay zbBI>hcfM(u4xq)Cl#i>5qA-R~tV<2rH7XpM^gtY<06BCs2MbQSI}E+3&nWCYN4Ark z7ORF{)LUrdxyyM@0wstg?;E9SY}+~95fMw?H$g2t70`bl*a;_Bg2W8rAW+G@KdCx?OdKDq~b*QZb;64wx zmCu%69ZsIK4PH4rIbJQ2J+xV>NFff9qzBdT9%u@foj^BGn)) ( + + + +); + +export default RightArrowComponent; + + diff --git a/admin-portal-frontend/src/app/api/categories.tsx b/admin-portal-frontend/src/app/api/categories.tsx new file mode 100644 index 0000000..879dcc8 --- /dev/null +++ b/admin-portal-frontend/src/app/api/categories.tsx @@ -0,0 +1,26 @@ +export interface CategoriesData { + title: string; + items: [], + type: String + } + + const port = process.env.DEV_PORT || 3001; + const CATEGORIES_URL = `http://localhost:${port}/api/categories`; + + export const getAllCategories = async () => { + try { + const response = await fetch(CATEGORIES_URL, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + let data = await response.json(); + data = data.categories; + console.log(data); + return data; + } catch (error) { + console.log(error) + return []; + } + }; diff --git a/admin-portal-frontend/src/app/components/BlankPageComponent.tsx b/admin-portal-frontend/src/app/components/BlankPageComponent.tsx new file mode 100644 index 0000000..8187283 --- /dev/null +++ b/admin-portal-frontend/src/app/components/BlankPageComponent.tsx @@ -0,0 +1,15 @@ +import React, { FC } from 'react'; + +interface Props { + category?: string; + } + +const BlankPageComponent: FC = ({ category }) => { + return ( +
+

This is the blank page

+
+ ); +}; + +export default BlankPageComponent; diff --git a/admin-portal-frontend/src/app/components/VerticalNavBar.tsx b/admin-portal-frontend/src/app/components/VerticalNavBar.tsx index 523d548..2a0f607 100644 --- a/admin-portal-frontend/src/app/components/VerticalNavBar.tsx +++ b/admin-portal-frontend/src/app/components/VerticalNavBar.tsx @@ -2,14 +2,15 @@ import styles from './VerticalNavBarStyles'; import HomeComponent from './HomeComponent'; -import React, { ReactNode } from 'react'; +import React, { ReactNode, useEffect, useState } from 'react'; import Accordion from 'react-bootstrap/Accordion'; import 'bootstrap/dist/css/bootstrap.css'; import { Card } from 'react-bootstrap'; import GpComponent from './GPComponent'; import SearchComponent from './SearchComponent'; +import { getAllCategories } from '../api/categories'; +import { NavLink } from 'react-router-dom'; - const VerticalNavBar: React.FC = () => { interface CustomAccordionProps { @@ -26,6 +27,24 @@ import SearchComponent from './SearchComponent'; ); } + interface Category { + _id: string; + title: String; + items: []; + type: String; + } + + const [items, setItems] = useState([]); + useEffect(() => { + (async () => { + const categories = await getAllCategories(); + setItems(categories); + })(); + }, []); + + const generalPrinciples = items.filter(category => category.type === 'General Principle'); + + return ( @@ -82,19 +101,19 @@ import SearchComponent from './SearchComponent'; -
    -
  • All
  • -
  • Emergency Action Plan
  • -
  • Trauma Centers
  • -
  • Burn Centers
  • -
  • Stroke Centers
  • -
  • Serious On-Field Injury
  • -
  • Catastrophic Incident
  • -
  • Adminstering Medication
  • -
  • Muscle Injuries
  • -
  • Ligament Injuries
  • -
  • Dislocations/Sublaxations
  • -
  • Fractures
  • + +
      + {generalPrinciples.map(category => ( +
    • + { + return { + textDecoration: 'none', + fontWeight: isActive ? "bold" : "", + color: isActive ? "var(--DFM-Navy, #182B49)" : "var(--Neutral-Gray6, #484848)", + }; + }} className="active">{category.title} +
    • + ))}
    @@ -110,5 +129,6 @@ import SearchComponent from './SearchComponent'; ); }; + export default VerticalNavBar; \ No newline at end of file diff --git a/admin-portal-frontend/src/app/icons/Home.png b/admin-portal-frontend/src/app/icons/Home.png new file mode 100644 index 0000000000000000000000000000000000000000..445b9ae4d13f7fe63f11bc6b3ad42924b1c1ef53 GIT binary patch literal 765 zcmV3=cz^Y_2@J?CCz2q-11#l!a!rEo0K?6m3z1Q0?1 z#j<+V?86}uMF_w!sh>Ol@udbn}lP?S4L!RME zN-qN87);QB0jSo~HXz9#m9+N8>ztn878vQ>b%g+$lxv;reicvKz))E6YCxXXLCNS_ zOxvCY?=?iR)2V+yWDA{tawvrU3+Xo&nh_mSWJqh=AojJ)~%c&DNnVy`&Iu7Q8Aj-A4?); z`Q4XCwN1*%SH$4!uAsZi`u*00000NkvXXu0mjfIgwKl literal 0 HcmV?d00001 diff --git a/admin-portal-frontend/src/app/icons/gen principles.png b/admin-portal-frontend/src/app/icons/gen principles.png new file mode 100644 index 0000000000000000000000000000000000000000..573f28b07774bb76597bc08bd597e52804a4bf58 GIT binary patch literal 355 zcmV-p0i6DcP)IjE^M_w;2Ui0)W+J*H*tIt^(90rV`ph478YX{ts3GVs*iaDZ;8lcOe=$^azH4oeJ!B=6s%?7T zM)gbrFI6C2GrCE0OPcmwp1!{r4bohba(yWP3d<$rppXl>kPA7#Y!eLRx}g}|{ zBr77<)0)X+FPtDNp?q5V?MlCYe63C0ig||1&zv}E6oswLay;YhhVxf{_}y3`cZcIq z2igme7ry+#-BZHUPDD~6E0L&t_Z+v6s~{`JI|0nXO}i#i(zE~o002ovPDHLkV1k*k Bk469h literal 0 HcmV?d00001 diff --git a/admin-portal-frontend/src/app/icons/ic_search.png b/admin-portal-frontend/src/app/icons/ic_search.png new file mode 100644 index 0000000000000000000000000000000000000000..ae1752a4204e866be7beae53ae19933c3d63adce GIT binary patch literal 768 zcmV+b1ONPqP)0Tn8d>fXTY(yYP>nj63kn%tnApydRln-EqtH!u=}NFd}c z5JqKTqzVeHJp^Twa&&Ac}N3oUd7g`g>sT0sN56DuWY_*lh}|Mr$UfV>#-9m*r2G&QYD#_B&r(3|4QVBihUNuVLU354vM zXuc9H!kL&ANTd1g*TWfqQ4@p+zl z7t$K7E?@M?MB2-Mei8gysPDS|}DUq5)0h(H~ryB}HL(+PkQ= z6wr&E%dBbBHeC&UIH;DHa?!>k^3f+V+J0i+GrV{jDAVfj?%jo4lC3`8`b|m-B yuqWDp=$;R=TxEVK5)INyV>4HSv(Q3UM!x}(oAjX|uk9-U0000 { - return (
    -
    - -
    + +
    + + + + +
    + } /> + +
    + + +
    diff --git a/admin-portal-frontend/src/app/pageStyles.tsx b/admin-portal-frontend/src/app/pageStyles.tsx index 6c14721..31a36e4 100644 --- a/admin-portal-frontend/src/app/pageStyles.tsx +++ b/admin-portal-frontend/src/app/pageStyles.tsx @@ -11,6 +11,14 @@ const styles = { zIndex: 1, position: 'absolute' as const }, + blankPage: { + position: 'absolute' as const, + zIndex: 2, + backgroundColor: 'white', + top: '50vh', + left: '50vw', + bottom: '50vh', + }, }; export default styles;