Skip to content

Commit

Permalink
fix: show filter error message and set background color red
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed Nov 20, 2024
1 parent 29c5855 commit 54aae21
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"multiplet-analysis": "^2.1.2",
"nmr-correlation": "^2.3.3",
"nmr-load-save": "2.0.1-pre.1732054736",
"nmr-processing": "14.0.1-pre.1732056655",
"nmr-processing": "14.0.1-pre.1732082478",
"nmredata": "^0.9.11",
"numeral": "^2.0.6",
"openchemlib": "^8.17.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,11 @@ function FiltersInner(props: FiltersInnerProps) {
}

function getStyle(filter, index) {
const { id } = filter;
const { id, error } = filter;

if (error) {
return { backgroundColor: '#ea8f8f' };
}
if (activeFilterID === id) {
return { backgroundColor: '#c2ea8f' };
}
Expand Down Expand Up @@ -261,7 +264,7 @@ function FiltersInner(props: FiltersInnerProps) {
<Sections.Item
key={id}
id={name}
title={getFilterLabel(name)}
title={error || getFilterLabel(name)}
serial={index + 1}
onClick={(id) => {
toggleSection(id);
Expand Down

0 comments on commit 54aae21

Please sign in to comment.