Skip to content

Commit

Permalink
feat: remove unused white space (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrokohler authored Oct 29, 2024
1 parent 00a8eda commit 155e001
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/components/SlideItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class SlideItem extends React.Component<SlideItemProps, SlideItemState> {
attributes={attributes}
selectable
>
<div style={{ height: '100px' }} ref={this.overviewViewportRef} />
{(this.overviewViewportRef.current != null) && <div style={{ height: '100px' }} ref={this.overviewViewportRef} />}
</Description>
</Menu.Item>
)
Expand Down
61 changes: 36 additions & 25 deletions src/components/SlideViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3670,21 +3670,25 @@ class SlideViewer extends React.Component<SlideViewerProps, SlideViewerState> {
>
<Space align='start' direction='vertical'>
<InputNumber
placeholder={(
placeholder={
'[' +
`${this.state.validXCoordinateRange[0]}` +
', ' +
`${this.state.validXCoordinateRange[1]}` +
']'
)}
}
prefix='X Coordinate [mm]'
onChange={this.handleXCoordinateSelection}
onPressEnter={this.handleXCoordinateSelection}
controls={false}
addonAfter={
this.state.isSelectedXCoordinateValid
? <CheckOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
: <StopOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
? (
<CheckOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
)
: (
<StopOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
)
}
/>
<InputNumber
Expand All @@ -3701,8 +3705,12 @@ class SlideViewer extends React.Component<SlideViewerProps, SlideViewerState> {
controls={false}
addonAfter={
this.state.isSelectedYCoordinateValid
? <CheckOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
: <StopOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
? (
<CheckOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
)
: (
<StopOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
)
}
/>
<InputNumber
Expand All @@ -3713,8 +3721,12 @@ class SlideViewer extends React.Component<SlideViewerProps, SlideViewerState> {
controls={false}
addonAfter={
this.state.isSelectedMagnificationValid
? <CheckOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
: <StopOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
? (
<CheckOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
)
: (
<StopOutlined style={{ color: 'rgba(0,0,0,.45)' }} />
)
}
/>
</Space>
Expand Down Expand Up @@ -3749,24 +3761,23 @@ class SlideViewer extends React.Component<SlideViewerProps, SlideViewerState> {
forceSubMenuRender
onOpenChange={() => {
// Give menu item time to render before updating viewer size
setTimeout(
() => {
if (this.labelViewer != null) {
this.labelViewer.resize()
}
},
100
)
setTimeout(() => {
if (this.labelViewer != null) {
this.labelViewer.resize()
}
}, 100)
}}
>
<Menu.SubMenu key='label' title='Slide label'>
<Menu.Item style={{ height: '100%' }} key='image'>
<div
style={{ height: '220px' }}
ref={this.labelViewportRef}
/>
</Menu.Item>
</Menu.SubMenu>
{this.labelViewportRef.current != null && (
<Menu.SubMenu key='label' title='Slide label'>
<Menu.Item style={{ height: '100%' }} key='image'>
<div
style={{ height: '220px' }}
ref={this.labelViewportRef}
/>
</Menu.Item>
</Menu.SubMenu>
)}
{specimenMenu}
{equipmentMenu}
{opticalPathMenu}
Expand Down Expand Up @@ -3798,7 +3809,7 @@ class SlideViewer extends React.Component<SlideViewerProps, SlideViewerState> {
</Menu>
</Layout.Sider>
{this.state.isHoveredRoiTooltipVisible &&
(this.state.hoveredRoiAttributes.length > 0)
this.state.hoveredRoiAttributes.length > 0
? (
<HoveredRoiTooltip
xPosition={this.state.hoveredRoiTooltipX}
Expand Down

0 comments on commit 155e001

Please sign in to comment.