From 52cf1f78a41bb33db1c90d654e5ff1ff405879a7 Mon Sep 17 00:00:00 2001 From: danieldeng2 <danieldeng223@gmail.com> Date: Wed, 12 Aug 2020 17:05:15 +0100 Subject: [PATCH] Add real logic data to resources example --- frontend/src/assets/images/pdf-label.png | Bin 0 -> 4438 bytes .../src/components/atoms/FileCard/index.tsx | 6 +- .../atoms/FileCard/style.module.scss | 14 ++- .../molecules/QuickAccessView/index.tsx | 2 +- .../QuickAccessView/style.module.scss | 12 +-- .../pages/ModuleResources/index.tsx | 80 +++++++++++++----- 6 files changed, 78 insertions(+), 36 deletions(-) create mode 100755 frontend/src/assets/images/pdf-label.png diff --git a/frontend/src/assets/images/pdf-label.png b/frontend/src/assets/images/pdf-label.png new file mode 100755 index 0000000000000000000000000000000000000000..9b054ec504c387e0615012c6b375ad333a122eac GIT binary patch literal 4438 zcmcIo2{_bi+aFR%n>VSWMbmIZVHP2iF&MICrz}xp=8uV)VP=>m9h!0~i8n*Y8pf8T z2uG4A$B81M$yx}Fl5J{~rT0H=*E!#JzW4p!bG`3evpoOj`8~gTdG7mu?rY9F*jcQV z+ad>nK-OAWnmIurQW4<zuB<fp&5cq)fIq8(EZyl4$Z7@2M+$N!^#=%K`391U8^g`^ zAeulWYvYMjA3&Q$4g%2-h#{60geL?545$y_N1|Y0lQnfPD2a%H9oDr)*aqPMf08AK z1~_x<TnL;1f&meRHG&$l&>#UBVBn!Fav+6{W?^8TdC}llG7X18KSLM+7?_DfAk@v) z0g9v20I06Eo)!VQ7X{Tf&_?PZ3{ZPDp(q4WACAz6BXzV8NHjtZtz!WF`htPdXhdJM zli7i<vcM+{%%8ysLc`%qCR3ZKqfMpx!I1_A25<xljzVdH2rW9B!oah%D0G!?3}yhG zKqCb)NK^_`!ie{whA=QNP}46akb}O{Qs`gZ1Ud}P!Uw^T+6akBpMgZecU({iE%38& zA^{Er0%U-~po3WCcWjV9l|iNZQ~wX@@5_G>0J_%J_PdNf)rCy{E`rW54+YKm>X1K0 z(_Pp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@->WXxVo9ayQSfwu3hqK6Z;hAEPAvPD zsrtS8b2p<gbyacwfu6c0?<ou2BcBLa2qoo@?4w7YJ<@8u^{!CwX!l#rai`eW@edz7 z=RKl(JgD=_b|-ogc|;aMNvZ5|v5D4>@Y;j1(OdtPDRTJ%nsWidKYwrPztqM2)BA`2 zn^=pVbM|gSd|BAhFE?he$5Zt-Ub^(^axz$!!21!rY6+#i$Es!WqYO%FL$kk34OcML zy$25?N7&x;c0!G^NC>}a;u-(=Y=`qPlfv9zd&N1Tjgq~**Uu&@nfZom3$49dyF14# z$h>qF$t~>CD$e+6fI_*XETfMX2*%R)-F4)~gKY$Rz0n&A_3*WE{>u8;XBV&0W0xAj zXOx5{k}jgz+jSDV$gQdEpP_Y>zo;{8t1f*MKDvC2;+>lNC_x!YzukYL$fsS7JLeQ@ z<s%G6wT1RQCF{a#$KQroa^f{%#-#Fq+3F@`{YF!(g1MRH3XvTOK+;%sO4VH3ombf4 zh||kp@yG+5pEXe?NW%el&e)FN=YXU)vD;J-Hqc+zA3m)Z{>eFX_&CTO1-5M_@?QH6 zFTJ^UefC^(iVohLlU3xPt6O-rz5iDBXk=n7=EOu;n#io%JmQQ{STJ*`twAN@*ORrm zM=G-(-@n1HXq=tVacV9jw*)7Q6{Jp9P8P8T0jfAV^yFy~(cL1VkZTnOrgk4&^{vo) zMd|n-dr<OJ&;Gs`uj-io-A%ek*Hd8MdyoAmRrWv96Mu`Qg_Q@SG#DRqQc@-Vd{~*= KnU$Cx<NgCvvr;tx literal 0 HcmV?d00001 diff --git a/frontend/src/components/atoms/FileCard/index.tsx b/frontend/src/components/atoms/FileCard/index.tsx index 17ea3fbf8..bc1b5d5d7 100644 --- a/frontend/src/components/atoms/FileCard/index.tsx +++ b/frontend/src/components/atoms/FileCard/index.tsx @@ -3,7 +3,7 @@ import styles from "./style.module.scss"; import classNames from "classnames"; -import graphIllustration from "assets/images/graph-illustration.svg"; +import applicationPDF from "assets/images/pdf-label.png"; import Badge from "react-bootstrap/Badge"; import Card from "react-bootstrap/Card"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; @@ -32,9 +32,9 @@ const FileCard: React.FC<FileCardProps> = ({ }: FileCardProps) => { return ( <Card className={styles.quickViewCard} onClick={onClick}> - <Card.Img variant="top" src={graphIllustration} /> + <Card.Img variant="top" src={applicationPDF} /> <Card.Body> - <Card.Title className={"text-truncate"}>{title}</Card.Title> + <Card.Title style={{wordWrap: "break-word"}} >{title}</Card.Title> <FontAwesomeIcon style={{ fontSize: "1.125rem" }} icon={icon} diff --git a/frontend/src/components/atoms/FileCard/style.module.scss b/frontend/src/components/atoms/FileCard/style.module.scss index 4c3395e6c..74865272f 100644 --- a/frontend/src/components/atoms/FileCard/style.module.scss +++ b/frontend/src/components/atoms/FileCard/style.module.scss @@ -4,8 +4,7 @@ border-radius: 0.5rem; border-color: $gray-300; transition: transform 0.2s; - margin-top: 10px; - margin-bottom: 10px; + height: 96%; } .quickViewCard:hover { @@ -31,8 +30,15 @@ .quickViewCard :global(.card-title) { font-size: 1.125rem; - font-weight: 400; - margin-bottom: 0px; + font-weight: 400; + white-space: normal; + margin-bottom: 0px; + + overflow-wrap: break-word; + word-wrap: break-word; + -ms-word-break: break-all; + word-break: break-all; + word-break: break-word; } .quickViewCard :global(.card-img-top) { diff --git a/frontend/src/components/molecules/QuickAccessView/index.tsx b/frontend/src/components/molecules/QuickAccessView/index.tsx index f1041ed90..e2eeaf39c 100644 --- a/frontend/src/components/molecules/QuickAccessView/index.tsx +++ b/frontend/src/components/molecules/QuickAccessView/index.tsx @@ -132,7 +132,7 @@ class QuickAccessView extends React.Component<QuickAccessProps, MyState> { lg={4} xl={3} key={id} - style={{ marginBottom: ".5rem" }} + style={{ marginBottom: ".5rem", marginTop: ".5rem" }} > <FileCard title={title} diff --git a/frontend/src/components/molecules/QuickAccessView/style.module.scss b/frontend/src/components/molecules/QuickAccessView/style.module.scss index 00092d368..a43504ce7 100644 --- a/frontend/src/components/molecules/QuickAccessView/style.module.scss +++ b/frontend/src/components/molecules/QuickAccessView/style.module.scss @@ -4,6 +4,9 @@ scrollbar-width: thin; scrollbar-color: $white $white; margin-top: 10px; + overflow-y: visible; + overflow-x: auto; + height: fit-content; // margin-left: 0; // leave space before card } @@ -27,11 +30,4 @@ .quickAccessRow:hover::-webkit-scrollbar-thumb { background-color: $gray-400; -} - -.quickAccessRow { - overflow-y: visible; - overflow-x: auto; - white-space: nowrap; - height: max-content; -} +} \ No newline at end of file diff --git a/frontend/src/components/pages/ModuleResources/index.tsx b/frontend/src/components/pages/ModuleResources/index.tsx index 7f30c905d..3d021196a 100644 --- a/frontend/src/components/pages/ModuleResources/index.tsx +++ b/frontend/src/components/pages/ModuleResources/index.tsx @@ -13,68 +13,108 @@ import ResourcesFolderView from "components/molecules/ResourcesFolderView"; const ModuleResources: React.FC = () => { let folderItems = [ { - title: "Lecture Materials", + title: "Slides", id: 0, }, { - title: "Panopto Videos", - id: 1, - }, - { - title: "Tutorial Sheets", + title: "Logic Exercise", id: 2, }, { - title: "Code", + title: "Pandor Lab", id: 3, }, { - title: "Useful Links", + title: "Extra", id: 4, - }, - { - title: "Other", - id: 5, }, ]; - let quickAccessItems = [ + let ResourceItems = [ { - title: "My very very very very very long title", + title: "Syntax Semantics Propositional Logic", type: "File", tags:["new", "Week 1"], id: 0, }, { - title: "Slides 1 - 1UP", + title: "Classical First-Order Predicate Logic", type: "File", tags:["new", "Week 2"], id: 1, }, { - title: "Circuit simulator", + title: "Translation Validity", type: "Link", tags:["new", "Week 2"], id: 2, }, { - title: "C - Lecture 1", + title: "validityPL-part1", type: "Panopto", tags:["new"], id: 3, }, { - title: "Translation Validity", + title: "validityPL-part2", type: "Link", tags:["Week 2"], id: 4, }, { - title: "Revision Exercises", + title: "validityPL-part3", type: "File", tags:["Week 3"], id: 5, }, + { + title: "validityPL-part3", + type: "File", + tags:["Week 3"], + id: 6, + }, + { + title: "validityFOL-part2", + type: "File", + tags:["Week 3"], + id: 7, + }, + { + title: "Logic Exercise 1", + type: "File", + tags:["Week 3"], + id: 8, + }, + { + title: "Logic Exercise 2", + type: "File", + tags:["Week 3"], + id: 9, + }, + { + title: "Logic Exercise 3", + type: "File", + tags:["Week 3"], + id: 10, + }, + { + title: "Pandor Lab", + type: "File", + tags:["Week 3"], + id: 11, + }, + { + title: "Propositional Logic Exercises", + type: "File", + tags:["Week 3"], + id: 12, + }, + { + title: "Extra Logic Exercises", + type: "File", + tags:["Week 3"], + id: 13, + }, ] return ( @@ -93,7 +133,7 @@ const ModuleResources: React.FC = () => { </InputGroup.Append> </InputGroup> - <QuickAccessView quickAccessItems={quickAccessItems}/> + <QuickAccessView quickAccessItems={ResourceItems}/> <ResourcesFolderView folderItems={folderItems}/> </> ); -- GitLab