Allow mounting arbitrary columns (#3207)
* Allow mounting arbitrary columns * Refactor column headers, allow pinning/unpinning and moving columns around * Collapse animation * Re-introduce scroll to top * Save column settings properly, do not display pin options in single-column view, do not display collapse icon if there is nothing to collapse * Fix one instance of public timeline being closed closing the stream Fix back buttons inconsistently sending you back to / even if history exists * Getting started displays links to columns that are not mounted
This commit is contained in:
parent
20b647020b
commit
8ee2eb5d2e
21 changed files with 763 additions and 162 deletions
|
@ -1,13 +1,9 @@
|
|||
import React from 'react';
|
||||
import ColumnsArea from './components/columns_area';
|
||||
import NotificationsContainer from './containers/notifications_container';
|
||||
import PropTypes from 'prop-types';
|
||||
import LoadingBarContainer from './containers/loading_bar_container';
|
||||
import HomeTimeline from '../home_timeline';
|
||||
import Compose from '../compose';
|
||||
import TabsBar from './components/tabs_bar';
|
||||
import ModalContainer from './containers/modal_container';
|
||||
import Notifications from '../notifications';
|
||||
import { connect } from 'react-redux';
|
||||
import { isMobile } from '../../is_mobile';
|
||||
import { debounce } from 'lodash';
|
||||
|
@ -15,6 +11,7 @@ import { uploadCompose } from '../../actions/compose';
|
|||
import { refreshTimeline } from '../../actions/timelines';
|
||||
import { refreshNotifications } from '../../actions/notifications';
|
||||
import UploadArea from './components/upload_area';
|
||||
import ColumnsAreaContainer from './containers/columns_area_container';
|
||||
|
||||
const noOp = () => false;
|
||||
|
||||
|
@ -119,31 +116,10 @@ class UI extends React.PureComponent {
|
|||
const { width, draggingOver } = this.state;
|
||||
const { children } = this.props;
|
||||
|
||||
let mountedColumns;
|
||||
|
||||
if (isMobile(width)) {
|
||||
mountedColumns = (
|
||||
<ColumnsArea>
|
||||
{children}
|
||||
</ColumnsArea>
|
||||
);
|
||||
} else {
|
||||
mountedColumns = (
|
||||
<ColumnsArea>
|
||||
<Compose withHeader={true} />
|
||||
<HomeTimeline shouldUpdateScroll={noOp} />
|
||||
<Notifications shouldUpdateScroll={noOp} />
|
||||
<div className="column__wrapper">{children}</div>
|
||||
</ColumnsArea>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='ui' ref={this.setRef}>
|
||||
<TabsBar />
|
||||
|
||||
{mountedColumns}
|
||||
|
||||
<ColumnsAreaContainer singleColumn={isMobile(width)}>{children}</ColumnsAreaContainer>
|
||||
<NotificationsContainer />
|
||||
<LoadingBarContainer className="loading-bar" />
|
||||
<ModalContainer />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue