Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Merging of CSS styles into new sidebar code #4998

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
PR feedback
  • Loading branch information
devinbinnie committed Feb 13, 2020
commit cf4f4ecb775f3e948c493ab5db3e81b137533f03
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class SidebarBaseChannel extends React.PureComponent<Props, State
}
}

return null;
return undefined;
}

getIcon = () => {
Expand Down Expand Up @@ -85,7 +85,7 @@ export default class SidebarBaseChannel extends React.PureComponent<Props, State
link={`/${currentTeamName}/channels/${channel.name}`}
label={channel.display_name}
ariaLabelPrefix={ariaLabelPrefix}
closeHandler={this.getCloseHandler()!}
closeHandler={this.getCloseHandler()}
icon={this.getIcon()!}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,44 +44,45 @@ export default class SidebarChannelClose extends React.PureComponent<Props, Stat
render() {
const {channel, closeHandler} = this.props;

let closeButton = null;

if (this.props.show && closeHandler) {
let removeTooltip = (
<Tooltip id='remove-dm-tooltip'>
<FormattedMessage
id='sidebar.removeList'
defaultMessage='Remove from list'
/>
</Tooltip>
if (!(this.props.show && closeHandler)) {
return;
}

let removeTooltipMessage = (
<FormattedMessage
id='sidebar.removeList'
defaultMessage='Remove from list'
/>
);

if (channel.type === Constants.OPEN_CHANNEL || channel.type === Constants.PRIVATE_CHANNEL) {
removeTooltipMessage = (
<FormattedMessage
id='sidebar.leave'
defaultMessage='Leave channel'
/>
);
}

if (channel.type === Constants.OPEN_CHANNEL || channel.type === Constants.PRIVATE_CHANNEL) {
removeTooltip = (
const closeButton = (
<OverlayTrigger
delayShow={1000}
placement='top'
overlay={(
<Tooltip id='remove-dm-tooltip'>
<FormattedMessage
id='sidebar.leave'
defaultMessage='Leave channel'
/>
{removeTooltipMessage}
</Tooltip>
);
}

closeButton = (
<OverlayTrigger
delayShow={1000}
placement='top'
overlay={removeTooltip}
)}
>
<span
onClick={this.handleLeaveChannel}
className='btn-close'
>
<span
onClick={this.handleLeaveChannel}
className='btn-close'
>
{'×'}
</span>
</OverlayTrigger>
);
}
{'×'}
</span>
</OverlayTrigger>
);

return closeButton;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,24 +164,22 @@ export default class SidebarChannelLink extends React.PureComponent<Props, State
let element;
if (isDesktopApp()) {
element = (
<div>
<CopyUrlContextMenu
link={this.props.link}
menuId={channel.id}
<CopyUrlContextMenu
link={this.props.link}
menuId={channel.id}
>
<button
className={'btn btn-link '}// TODO + rowClass}
aria-label={this.getAriaLabel()}
onClick={this.handleClick}
style={{
display: 'flex',
fontWeight: this.showChannelAsUnread() ? 'bold' : 'inherit', // TODO temp styling
}}
>
<button
className={'btn btn-link '}// TODO + rowClass}
aria-label={this.getAriaLabel()}
onClick={this.handleClick}
style={{
display: 'flex',
fontWeight: this.showChannelAsUnread() ? 'bold' : 'inherit', // TODO temp styling
}}
>
{content}
</button>
</CopyUrlContextMenu>
</div>
{content}
</button>
</CopyUrlContextMenu>
);
} else {
element = (
Expand Down Expand Up @@ -218,9 +216,7 @@ export default class SidebarChannelLink extends React.PureComponent<Props, State
placement='top'
overlay={displayNameToolTip}
>
<div>
{element}
</div>
{element}
</OverlayTrigger>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ export default class SidebarDirectChannel extends React.PureComponent<Props, Sta
const category = Constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW;

const currentUserId = this.props.currentUserId;
this.props.actions.savePreferences(currentUserId, [{user_id: currentUserId, category, name: id!, value: 'false'}]).then(
() => callback);
this.props.actions.savePreferences(currentUserId, [{user_id: currentUserId, category, name: id!, value: 'false'}]).then(callback);

trackEvent('ui', 'ui_direct_channel_x_button_clicked');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ export default class SidebarGroupChannel extends React.PureComponent<Props, Stat
const category = Constants.Preferences.CATEGORY_GROUP_CHANNEL_SHOW;

const currentUserId = this.props.currentUserId;
this.props.actions.savePreferences(currentUserId, [{user_id: currentUserId, category, name: id!, value: 'false'}]).then(
() => callback);
this.props.actions.savePreferences(currentUserId, [{user_id: currentUserId, category, name: id, value: 'false'}]).then(callback);

trackEvent('ui', 'ui_direct_channel_x_button_clicked');

Expand Down