Skip to content

Commit bd6ab00

Browse files
committed
chore: width style changes & removed double import
1 parent eb82411 commit bd6ab00

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

pkg/database/postgres.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/Code-Hex/dd"
1313
"github.com/MassBank/MassBank3/pkg/massbank"
1414
"github.com/lib/pq"
15-
_ "github.com/lib/pq"
1615
)
1716

1817
type Index struct {

web-frontend/src/elements/record/Resizable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import getLinkedAnnotations from '../../utils/getLinkedAnnotations';
1717
import LinkedPeakAnnotation from '../../types/peak/LinkedPeakAnnotation';
1818

1919
const sidebarWidth = 10;
20-
const defaultChartWidthRatio = 0.7;
20+
const defaultChartWidthRatio = 0.75;
2121

2222
type InputProps = {
2323
record: Record;

web-frontend/src/elements/routes/pages/search/SpectralHitsViewComponent.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ function SpectralHitsViewComponent({
2020
width,
2121
height,
2222
}: InputProps) {
23-
const spectralHitsViewComponent = useMemo(
24-
() => (
23+
const spectralHitsViewComponent = useMemo(() => {
24+
const widthResultInfo = width * 0.25;
25+
const widthResizable = width - widthResultInfo;
26+
27+
return (
2528
<div
2629
className="component-container"
2730
style={{
@@ -31,20 +34,23 @@ function SpectralHitsViewComponent({
3134
>
3235
<ResultInfo
3336
hit={hit}
34-
imageWidth={width * 0.3}
37+
imageWidth={widthResultInfo}
3538
imageHeight={height}
36-
style={{ width: width * 0.3, height, backgroundColor: 'lightyellow' }}
39+
style={{
40+
width: widthResultInfo,
41+
height,
42+
backgroundColor: 'lightyellow',
43+
}}
3744
/>
3845
<Resizable
3946
record={{ peak: { peak: { values: reference } } } as Record}
4047
record2={hit.record}
41-
width={width * 0.7}
48+
width={widthResizable}
4249
height={height}
4350
/>
4451
</div>
45-
),
46-
[height, hit, reference, width],
47-
);
52+
);
53+
}, [height, hit, reference, width]);
4854

4955
return spectralHitsViewComponent;
5056
}

0 commit comments

Comments
 (0)