mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-27 23:56:18 +00:00
13.0-fix click user notification tab (#7528)
This commit is contained in:
@@ -155,8 +155,8 @@ class UserNotificationsDialog extends React.Component {
|
|||||||
this.props.onNotificationDialogToggle();
|
this.props.onNotificationDialogToggle();
|
||||||
};
|
};
|
||||||
|
|
||||||
tabItemClick = (e) => {
|
tabItemClick = (tab) => {
|
||||||
let tab = e.target.getAttribute('value');
|
if (tab === this.state.activeTab) return;
|
||||||
this.setState({
|
this.setState({
|
||||||
activeTab: tab,
|
activeTab: tab,
|
||||||
currentPage: 1
|
currentPage: 1
|
||||||
@@ -217,15 +217,25 @@ class UserNotificationsDialog extends React.Component {
|
|||||||
<div className="notice-dialog-side">
|
<div className="notice-dialog-side">
|
||||||
<Nav pills className="flex-column w-100">
|
<Nav pills className="flex-column w-100">
|
||||||
<NavItem className="w-100" role="tab" aria-selected={activeTab === 'general'} aria-controls="general-notice-panel">
|
<NavItem className="w-100" role="tab" aria-selected={activeTab === 'general'} aria-controls="general-notice-panel">
|
||||||
<NavLink className={classname('w-100', 'mr-0', { 'active': activeTab === 'general' })} onClick={this.tabItemClick} tabIndex="0" value="general">
|
<NavLink
|
||||||
|
className={classname('w-100 mr-0', { 'active': activeTab === 'general' })}
|
||||||
|
onClick={() => this.tabItemClick('general')}
|
||||||
|
tabIndex="0"
|
||||||
|
value="general"
|
||||||
|
>
|
||||||
{gettext('General')}
|
{gettext('General')}
|
||||||
{generalNoticeListUnseen > 0 && <span>({generalNoticeListUnseen})</span>}
|
{generalNoticeListUnseen > 0 && <span className="pl-1">({generalNoticeListUnseen})</span>}
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</NavItem>
|
</NavItem>
|
||||||
<NavItem className="w-100" role="tab" aria-selected={activeTab === 'discussion'} aria-controls="discussion-notice-panel">
|
<NavItem className="w-100" role="tab" aria-selected={activeTab === 'discussion'} aria-controls="discussion-notice-panel">
|
||||||
<NavLink className={classname('w-100', 'mr-0', { 'active': activeTab === 'discussion' })} onClick={this.tabItemClick} tabIndex="1" value="discussion">
|
<NavLink
|
||||||
|
className={classname('w-100 mr-0', { 'active': activeTab === 'discussion' })}
|
||||||
|
onClick={() => this.tabItemClick('discussion')}
|
||||||
|
tabIndex="1"
|
||||||
|
value="discussion"
|
||||||
|
>
|
||||||
{gettext('Discussion')}
|
{gettext('Discussion')}
|
||||||
{discussionNoticeListUnseen > 0 && <span>({discussionNoticeListUnseen})</span>}
|
{discussionNoticeListUnseen > 0 && <span className="pl-1">({discussionNoticeListUnseen})</span>}
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</NavItem>
|
</NavItem>
|
||||||
</Nav>
|
</Nav>
|
||||||
|
Reference in New Issue
Block a user