From edc2c367568fb51826ec27f21793370a537b914c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi <256895@studenti.unimore.it> Date: Sat, 24 Apr 2021 04:23:23 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Add=20WIP=20RepositorySummary=20?= =?UTF-8?q?component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/RepositorySummary.js | 39 +++++++++ .../components/RepositorySummary.module.css | 82 +++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 code/frontend/src/components/RepositorySummary.js create mode 100644 code/frontend/src/components/RepositorySummary.module.css diff --git a/code/frontend/src/components/RepositorySummary.js b/code/frontend/src/components/RepositorySummary.js new file mode 100644 index 0000000..5ef84c5 --- /dev/null +++ b/code/frontend/src/components/RepositorySummary.js @@ -0,0 +1,39 @@ +import React from "react" +import Style from "./RepositorySummary.module.css" +import classNames from "classnames" +import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" +import Button from "./Button" +import { faArchive, faPencilAlt, faTrash } from "@fortawesome/free-solid-svg-icons" + + +export default function RepositorySummary({ className, icon, title, details, buttons, startDate, canDelete, canEdit, canArchive, ...props }) { + return ( +
+
+
+ +
+
+ {title} +
+
+ {startDate} +
+
+
+ {details} +
+
+ {canDelete ? + + : null} + {canEdit ? + + : null} + {canArchive ? + + : null} +
+
+ ) +} diff --git a/code/frontend/src/components/RepositorySummary.module.css b/code/frontend/src/components/RepositorySummary.module.css new file mode 100644 index 0000000..34a94fe --- /dev/null +++ b/code/frontend/src/components/RepositorySummary.module.css @@ -0,0 +1,82 @@ +.RepositorySummary { + width: 100%; + height: 60px; + + margin: 10px 0; + + display: flex; +} + + +.Left { + width: 250px; + height: 60px; + + display: grid; + grid-template-areas: + "a b" + "a c" + "a d" + "a e" + ; + grid-template-columns: auto 1fr; + grid-template-rows: 5px 1fr 1fr 5px; + + background-color: var(--bg-accent); + border-radius: 30px 0 0 30px; +} + +.IconContainer { + margin-top: 5px; + margin-right: 15px; + margin-left: 5px; + margin-bottom: 5px; + width: 50px; + height: 50px; + border-radius: 50px; + + display: flex; + justify-content: center; + align-items: center; + + background-color: var(--bg-light); + color: var(--fg-primary); + + font-size: x-large; + + grid-area: a; +} + +.Title { + grid-area: c; + + align-self: flex-end; +} + +.StartDate { + grid-area: d; + font-size: small; + + align-self: flex-start; +} + +.Middle { + flex-grow: 1; + + height: 60px; + + background-color: var(--bg-light); +} + +.Right { + width: 261px; + height: 60px; + padding: 5px; + + background-color: var(--bg-accent); + border-radius: 0 30px 30px 0; + + display: flex; + justify-content: flex-end; + align-items: center; +}