Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove unused white space #247

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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