[MM-62650][MM-62651] Remove bootstrap/react-bootstrap from TabBar, MainPage (#3292)
This commit is contained in:
@@ -8,6 +8,9 @@ import React from 'react';
|
|||||||
import {Container, Row, Col} from 'react-bootstrap';
|
import {Container, Row, Col} from 'react-bootstrap';
|
||||||
import {FormattedMessage} from 'react-intl';
|
import {FormattedMessage} from 'react-intl';
|
||||||
|
|
||||||
|
// TODO: Will remove in https://mattermost.atlassian.net/browse/MM-62724
|
||||||
|
import 'bootstrap/dist/css/bootstrap.min.css';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
errorInfo?: string;
|
errorInfo?: string;
|
||||||
url?: string;
|
url?: string;
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import React, {Fragment} from 'react';
|
import React, {Fragment} from 'react';
|
||||||
import type {DropResult} from 'react-beautiful-dnd';
|
import type {DropResult} from 'react-beautiful-dnd';
|
||||||
import {Container, Row} from 'react-bootstrap';
|
|
||||||
import type {IntlShape} from 'react-intl';
|
import type {IntlShape} from 'react-intl';
|
||||||
import {injectIntl} from 'react-intl';
|
import {injectIntl} from 'react-intl';
|
||||||
|
|
||||||
@@ -433,7 +432,7 @@ class MainPage extends React.PureComponent<Props, State> {
|
|||||||
const activeServer = this.state.servers.find((srv) => srv.id === this.state.activeServerId);
|
const activeServer = this.state.servers.find((srv) => srv.id === this.state.activeServerId);
|
||||||
|
|
||||||
const topRow = (
|
const topRow = (
|
||||||
<Row
|
<div
|
||||||
className={topBarClassName}
|
className={topBarClassName}
|
||||||
onDoubleClick={this.handleDoubleClick}
|
onDoubleClick={this.handleDoubleClick}
|
||||||
>
|
>
|
||||||
@@ -489,7 +488,7 @@ class MainPage extends React.PureComponent<Props, State> {
|
|||||||
<span style={{width: `${window.innerWidth - (window.navigator.windowControlsOverlay?.getTitlebarAreaRect().width ?? 0)}px`}}/>
|
<span style={{width: `${window.innerWidth - (window.navigator.windowControlsOverlay?.getTitlebarAreaRect().width ?? 0)}px`}}/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Row>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
const views = () => {
|
const views = () => {
|
||||||
@@ -526,9 +525,9 @@ class MainPage extends React.PureComponent<Props, State> {
|
|||||||
|
|
||||||
const viewsRow = (
|
const viewsRow = (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<Row>
|
<div>
|
||||||
{views()}
|
{views()}
|
||||||
</Row>
|
</div>
|
||||||
</Fragment>);
|
</Fragment>);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -536,10 +535,10 @@ class MainPage extends React.PureComponent<Props, State> {
|
|||||||
className='MainPage'
|
className='MainPage'
|
||||||
onClick={this.focusOnWebView}
|
onClick={this.focusOnWebView}
|
||||||
>
|
>
|
||||||
<Container fluid={true}>
|
<div>
|
||||||
{topRow}
|
{topRow}
|
||||||
{viewsRow}
|
{viewsRow}
|
||||||
</Container>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,6 @@ import classNames from 'classnames';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import type {DraggingStyle, DropResult, NotDraggingStyle} from 'react-beautiful-dnd';
|
import type {DraggingStyle, DropResult, NotDraggingStyle} from 'react-beautiful-dnd';
|
||||||
import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd';
|
import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd';
|
||||||
import {Nav, NavItem, NavLink} from 'react-bootstrap';
|
|
||||||
import type {IntlShape} from 'react-intl';
|
import type {IntlShape} from 'react-intl';
|
||||||
import {FormattedMessage, injectIntl} from 'react-intl';
|
import {FormattedMessage, injectIntl} from 'react-intl';
|
||||||
|
|
||||||
@@ -119,9 +118,8 @@ class TabBar extends React.PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NavItem
|
<li
|
||||||
ref={provided.innerRef}
|
ref={provided.innerRef}
|
||||||
as='li'
|
|
||||||
id={`serverTabItem${index}`}
|
id={`serverTabItem${index}`}
|
||||||
draggable={false}
|
draggable={false}
|
||||||
title={this.props.intl.formatMessage({id: `common.tabs.${tab.name}`, defaultMessage: getViewDisplayName(tab.name as ViewType)})}
|
title={this.props.intl.formatMessage({id: `common.tabs.${tab.name}`, defaultMessage: getViewDisplayName(tab.name as ViewType)})}
|
||||||
@@ -133,14 +131,16 @@ class TabBar extends React.PureComponent<Props, State> {
|
|||||||
{...provided.dragHandleProps}
|
{...provided.dragHandleProps}
|
||||||
style={getStyle(provided.draggableProps.style)}
|
style={getStyle(provided.draggableProps.style)}
|
||||||
>
|
>
|
||||||
<NavLink
|
<a
|
||||||
eventKey={index}
|
|
||||||
draggable={false}
|
draggable={false}
|
||||||
active={this.props.activeTabId === tab.id}
|
onClick={() => {
|
||||||
disabled={this.props.tabsDisabled}
|
if (!this.props.tabsDisabled) {
|
||||||
onSelect={() => {
|
this.props.onSelect(tab.id!);
|
||||||
this.props.onSelect(tab.id!);
|
}
|
||||||
}}
|
}}
|
||||||
|
className={classNames({
|
||||||
|
disabled: this.props.tabsDisabled,
|
||||||
|
})}
|
||||||
>
|
>
|
||||||
<div className='TabBar-tabSeperator'>
|
<div className='TabBar-tabSeperator'>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
@@ -157,8 +157,8 @@ class TabBar extends React.PureComponent<Props, State> {
|
|||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</NavLink>
|
</a>
|
||||||
</NavItem>
|
</li>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Draggable>
|
</Draggable>
|
||||||
@@ -176,19 +176,18 @@ class TabBar extends React.PureComponent<Props, State> {
|
|||||||
direction='horizontal'
|
direction='horizontal'
|
||||||
>
|
>
|
||||||
{(provided) => (
|
{(provided) => (
|
||||||
<Nav
|
<div
|
||||||
ref={provided.innerRef}
|
ref={provided.innerRef}
|
||||||
className={classNames('TabBar', {
|
className={classNames('TabBar', {
|
||||||
darkMode: this.props.isDarkMode,
|
darkMode: this.props.isDarkMode,
|
||||||
})}
|
})}
|
||||||
id={this.props.id}
|
id={this.props.id}
|
||||||
variant='tabs'
|
|
||||||
{...provided.droppableProps}
|
{...provided.droppableProps}
|
||||||
>
|
>
|
||||||
{tabs}
|
{tabs}
|
||||||
{this.props.isMenuOpen ? <span className='TabBar-nonDrag'/> : null}
|
{this.props.isMenuOpen ? <span className='TabBar-nonDrag'/> : null}
|
||||||
{provided.placeholder}
|
{provided.placeholder}
|
||||||
</Nav>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Droppable>
|
</Droppable>
|
||||||
</DragDropContext>
|
</DragDropContext>
|
||||||
|
@@ -86,6 +86,7 @@
|
|||||||
top: -5px;
|
top: -5px;
|
||||||
right: -1px;
|
right: -1px;
|
||||||
border: 2px solid #efefef;
|
border: 2px solid #efefef;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ServerDropdownButton.darkMode {
|
.ServerDropdownButton.darkMode {
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
-webkit-app-region: drag;
|
-webkit-app-region: drag;
|
||||||
padding: 6px 8px;
|
padding: 6px 8px;
|
||||||
|
margin-bottom: 0;
|
||||||
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.TabBar-nonDrag {
|
.TabBar-nonDrag {
|
||||||
@@ -33,6 +35,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.TabBar>li>a {
|
.TabBar>li>a {
|
||||||
|
display: block;
|
||||||
|
cursor: pointer;
|
||||||
color: rgba(61,60,64,0.7);
|
color: rgba(61,60,64,0.7);
|
||||||
font-family: "Open Sans", sans-serif;
|
font-family: "Open Sans", sans-serif;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -43,12 +47,24 @@
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: none !important;
|
border: none !important;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.TabBar>li>a.disabled {
|
||||||
|
color: #6c757d;
|
||||||
|
background-color: transparent;
|
||||||
|
pointer-events: none;
|
||||||
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
|
||||||
.TabBar.darkMode>li>a {
|
.TabBar.darkMode>li>a {
|
||||||
color: rgba(221,221,221,0.64);
|
color: rgba(221,221,221,0.64);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.TabBar.darkMode>li>a.disabled {
|
||||||
|
color: #6c757d;
|
||||||
|
}
|
||||||
|
|
||||||
.TabBar>li>a:hover {
|
.TabBar>li>a:hover {
|
||||||
background-color: rgba(255,255,255,0.56);
|
background-color: rgba(255,255,255,0.56);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import 'bootstrap/dist/css/bootstrap.min.css';
|
|
||||||
import 'renderer/css/index.css';
|
import 'renderer/css/index.css';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
Reference in New Issue
Block a user