diff --git a/code/frontend/src/components/base/Summary.js b/code/frontend/src/components/base/Summary.js new file mode 100644 index 0000000..82ce30e --- /dev/null +++ b/code/frontend/src/components/base/Summary.js @@ -0,0 +1,42 @@ +import React from "react" +import Style from "./Summary.module.css" +import classNames from "classnames" +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" + + +export default function Summary( + { title, subtitle, upperLabel, upperValue, lowerLabel, lowerValue, buttons, className, ...props }, +) { + return ( +
+
+
+ +
+
+ {title} +
+
+ {subtitle} +
+
+
+
+ {upperLabel} +
+
+ {upperValue} +
+
+ {lowerLabel} +
+
+ {lowerValue} +
+
+
+ {buttons} +
+
+ ) +} diff --git a/code/frontend/src/components/base/Summary.module.css b/code/frontend/src/components/base/Summary.module.css new file mode 100644 index 0000000..01bfc87 --- /dev/null +++ b/code/frontend/src/components/base/Summary.module.css @@ -0,0 +1,98 @@ +.Summary { + 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: 5px 15px 5px 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; + font-size: large; + align-self: flex-end; +} + +.Subtitle { + grid-area: d; + font-size: small; + align-self: flex-start; +} + +.Middle { + flex-grow: 1; + height: 60px; + padding: 5px; + + background-color: var(--bg-light); + + display: grid; + grid-template-columns: auto 1fr; + grid-template-rows: 1fr 1fr; + +} + +.Middle .Label { + grid-column: 1; +} + +.Middle .Value { + grid-column: 2; +} + +.Middle .Upper { + grid-row: 1; +} + +.Middle .Lower { + grid-row: 2; +} + +.Right { + width: 250px; + height: 60px; + padding: 5px; + + background-color: var(--bg-accent); + border-radius: 0 30px 30px 0; + + display: flex; + justify-content: flex-end; + align-items: center; +} diff --git a/code/frontend/src/components/interactive/BoxRepositoriesActive.js b/code/frontend/src/components/interactive/BoxRepositoriesActive.js index 87c8ba9..274cf5f 100644 --- a/code/frontend/src/components/interactive/BoxRepositoriesActive.js +++ b/code/frontend/src/components/interactive/BoxRepositoriesActive.js @@ -1,6 +1,6 @@ import React, { useContext } from "react" import BoxFull from "../base/BoxFull" -import RepositorySummaryBase from "./RepositorySummaryBase" +import SummaryRepository from "./SummaryRepository" import { faSearch } from "@fortawesome/free-solid-svg-icons" import ContextUser from "../../contexts/ContextUser" @@ -20,9 +20,9 @@ export default function BoxRepositoriesActive({ repositories, refresh, ...props let contents if(repositories.length > 0) { contents = repositories.map(repo => ( - 0) { contents = repositories.map(repo => ( - { - history.push(`/repositories/${id}/edit`) + const onEditClick = () => { + history.push(`/repositories/${repo.id}/edit`) } - const onArchiveClick = async event => { + const onArchiveClick = async () => { await archiveThis() await refresh() } - const onUnarchiveClick = async event => { + const onUnarchiveClick = async () => { await unarchiveThis() await refresh() } - const onDeleteClick = async event => { + const onDeleteClick = async () => { await deletThis() await refresh() } @@ -60,13 +54,15 @@ export default function RepositorySummaryBase(
- +
- {name} + {repo.name}
- {owner["username"]} + {repo.owner.username}
@@ -74,13 +70,13 @@ export default function RepositorySummaryBase( Start:
- {start} + {repo.start}
End:
- {end} + {repo.end}
@@ -106,9 +102,9 @@ export default function RepositorySummaryBase( : null}