From 28b5a8be1b395412dab871c1867548a06057d6e2 Mon Sep 17 00:00:00 2001 From: Gustav Andreasson Date: Tue, 19 Dec 2023 16:08:00 +0100 Subject: [PATCH] fix year 0 bug, fix disabled buttons --- frontend/src/components/RecordInfo/RecordInfo.component.js | 5 +++-- .../Settings/GridSettings/GridSettings.component.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/RecordInfo/RecordInfo.component.js b/frontend/src/components/RecordInfo/RecordInfo.component.js index 49423ed..fca0fa4 100644 --- a/frontend/src/components/RecordInfo/RecordInfo.component.js +++ b/frontend/src/components/RecordInfo/RecordInfo.component.js @@ -52,11 +52,12 @@ const RecordInfo = ({ .join(" ")} )} - {rec.year && ( + {(rec.year && (
handleYearClick(rec.year)}> {rec.year}
- )} + )) || + null} {rec.price && rate && (
{"(" + (rec.price * rate).toFixed(2) + " " + currency + ")"} diff --git a/frontend/src/components/Settings/GridSettings/GridSettings.component.js b/frontend/src/components/Settings/GridSettings/GridSettings.component.js index b16c24d..8b35d6e 100644 --- a/frontend/src/components/Settings/GridSettings/GridSettings.component.js +++ b/frontend/src/components/Settings/GridSettings/GridSettings.component.js @@ -21,13 +21,13 @@ const GridSettings = ({ gridView, gridColumns, setGridView, setGridColumns }) => type="button" className={"fas fa-grip-horizontal" + (!gridView ? " selected" : "")} onClick={() => setGridView(false)} - enabled={gridView.toString()} + disabled={!gridView} >
{gridView && (