From a9efd9dc3a288e07d1b2bb5bd15331c30beedc73 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 13 Oct 2021 04:51:55 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Add=20an=20icon=20to=20`Resource?= =?UTF-8?q?DescriptionBox`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.tsx | 5 +++-- .../src/components/generic/ResourceDescriptionBox.tsx | 9 ++++++--- frontend/src/components/routing/ResourceRouter.tsx | 5 +---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index e0c420f..278d5da 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,3 +1,4 @@ +import {faProjectDiagram, faUsers} from "@fortawesome/free-solid-svg-icons" import * as Reach from "@reach/router" import {RouteComponentProps} from "@reach/router" import {Chapter, LayoutThreeCol} from "@steffo/bluelib-react" @@ -53,7 +54,7 @@ function App({..._}: RouteComponentProps) { } selectedRoute={({selection}) => <> - + } selectedRoute={({selection}) => <> - + { - resource: ManagedResource + resource: ManagedResource, + icon: IconDefinition, } -export function ResourceDescriptionBox({resource}: ResourceDescriptionBoxProps): JSX.Element { +export function ResourceDescriptionBox({resource, icon}: ResourceDescriptionBoxProps): JSX.Element { return React.useMemo( () => ( - About {resource.value.name} +  About {resource.value.name} {resource.value.description} diff --git a/frontend/src/components/routing/ResourceRouter.tsx b/frontend/src/components/routing/ResourceRouter.tsx index dce7776..ba82982 100644 --- a/frontend/src/components/routing/ResourceRouter.tsx +++ b/frontend/src/components/routing/ResourceRouter.tsx @@ -20,10 +20,7 @@ export interface ResourceRouterProps { * @warning Due to some particular memoization, changes to `unselectedRoute` and `selectedRoute` will apply **only** when `selection` changes. * @constructor */ -export function ResourceRouter({selection, unselectedRoute, selectedRoute}: ResourceRouterProps): JSX.Element { - const UnselectedRoute = unselectedRoute - const SelectedRoute = selectedRoute - +export function ResourceRouter({selection, unselectedRoute: UnselectedRoute, selectedRoute: SelectedRoute}: ResourceRouterProps): JSX.Element { return React.useMemo( () => { if(selection) {