[MM-62650][MM-62651] Remove bootstrap/react-bootstrap from TabBar, MainPage (#3292)

This commit is contained in:
Devin Binnie
2025-01-30 15:37:05 -05:00
committed by GitHub
parent 47cea9a217
commit f070b7068e
6 changed files with 39 additions and 22 deletions

View File

@@ -8,6 +8,9 @@ import React from 'react';
import {Container, Row, Col} from 'react-bootstrap';
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 = {
errorInfo?: string;
url?: string;

View File

@@ -5,7 +5,6 @@
import classNames from 'classnames';
import React, {Fragment} from 'react';
import type {DropResult} from 'react-beautiful-dnd';
import {Container, Row} from 'react-bootstrap';
import type {IntlShape} 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 topRow = (
<Row
<div
className={topBarClassName}
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`}}/>
)}
</div>
</Row>
</div>
);
const views = () => {
@@ -526,9 +525,9 @@ class MainPage extends React.PureComponent<Props, State> {
const viewsRow = (
<Fragment>
<Row>
<div>
{views()}
</Row>
</div>
</Fragment>);
return (
@@ -536,10 +535,10 @@ class MainPage extends React.PureComponent<Props, State> {
className='MainPage'
onClick={this.focusOnWebView}
>
<Container fluid={true}>
<div>
{topRow}
{viewsRow}
</Container>
</div>
</div>
);
}

View File

@@ -6,7 +6,6 @@ import classNames from 'classnames';
import React from 'react';
import type {DraggingStyle, DropResult, NotDraggingStyle} 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 {FormattedMessage, injectIntl} from 'react-intl';
@@ -119,9 +118,8 @@ class TabBar extends React.PureComponent<Props, State> {
}
return (
<NavItem
<li
ref={provided.innerRef}
as='li'
id={`serverTabItem${index}`}
draggable={false}
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}
style={getStyle(provided.draggableProps.style)}
>
<NavLink
eventKey={index}
<a
draggable={false}
active={this.props.activeTabId === tab.id}
disabled={this.props.tabsDisabled}
onSelect={() => {
this.props.onSelect(tab.id!);
onClick={() => {
if (!this.props.tabsDisabled) {
this.props.onSelect(tab.id!);
}
}}
className={classNames({
disabled: this.props.tabsDisabled,
})}
>
<div className='TabBar-tabSeperator'>
<FormattedMessage
@@ -157,8 +157,8 @@ class TabBar extends React.PureComponent<Props, State> {
</button>
}
</div>
</NavLink>
</NavItem>
</a>
</li>
);
}}
</Draggable>
@@ -176,19 +176,18 @@ class TabBar extends React.PureComponent<Props, State> {
direction='horizontal'
>
{(provided) => (
<Nav
<div
ref={provided.innerRef}
className={classNames('TabBar', {
darkMode: this.props.isDarkMode,
})}
id={this.props.id}
variant='tabs'
{...provided.droppableProps}
>
{tabs}
{this.props.isMenuOpen ? <span className='TabBar-nonDrag'/> : null}
{provided.placeholder}
</Nav>
</div>
)}
</Droppable>
</DragDropContext>