Skip to content

Commit

Permalink
Add option to disable onClose/onClick functionality (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecalcc authored Jul 31, 2024
1 parent 1c9d130 commit 3a3b533
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
12 changes: 7 additions & 5 deletions app-typescript/components/Layouts/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,13 @@ class PanelHeader extends React.PureComponent<IPropsPanelHeader> {
&& this.props.iconButtons
}
{this.props.onClose != null
&& <IconButton
icon='close-small'
ariaValue='Close'
onClick={this.props.onClose}
/>
&& (
<IconButton
icon='close-small'
ariaValue='Close'
onClick={this.props.onClose}
/>
)
}
</ButtonGroup>
)
Expand Down
10 changes: 7 additions & 3 deletions app-typescript/components/Navigation/SideBarTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface IProps {
onActiveTabChange(val: string | null): void;
items: Array<ISideBarTab | 'divider'>;
side?: 'none' | 'left' | 'right';
disabled?: boolean;
}

export interface ISideBarTab {
Expand Down Expand Up @@ -53,12 +54,15 @@ export class SideBarTabs extends React.PureComponent<IProps> {
} else {
return (
<li key={index} data-sd-tooltip={item.tooltip} data-flow='left'>
<a
<button
disabled={this.props.disabled}
role='button'
aria-label={item.tooltip}
className={classNames(
'sd-sidetab-menu__btn',
{'sd-sidetab-menu__btn--active': item.id === this.props.activeTab},
{'sd-sidetab-menu__btn--active':
item.id === this.props.activeTab && this.props.disabled !== true,
},
)}
onClick={() => this.handleClick(item)}
>
Expand All @@ -71,7 +75,7 @@ export class SideBarTabs extends React.PureComponent<IProps> {
</span>

<i className='sd-sidetab-menu__helper-icon icon-close-small'></i>
</a>
</button>
</li>
);
}
Expand Down
2 changes: 1 addition & 1 deletion 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
@@ -1,6 +1,6 @@
{
"name": "superdesk-ui-framework",
"version": "3.1.16",
"version": "3.1.17",
"license": "AGPL-3.0",
"repository": {
"type": "git",
Expand Down

0 comments on commit 3a3b533

Please sign in to comment.