diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-10-23 15:58:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-23 15:58:24 +0200 |
commit | 1fd6460b02d2e73c94e7c6b1fa8fdc4d2ae36241 (patch) | |
tree | 07f66e273bceb4eb9fd9bd4a9da047ea506c15d7 /app/javascript/mastodon/features/ui/components/columns_area.js | |
parent | c2c14331b2c04293d8c3f94950027cf9633fd18a (diff) |
Change floating action button to be a button in header in web UI (#19422)
- Fix theme color - Fix elephant being too big on error page on small screens - Remove "Follows and Followers" link from navigation panel
Diffstat (limited to 'app/javascript/mastodon/features/ui/components/columns_area.js')
-rw-r--r-- | app/javascript/mastodon/features/ui/components/columns_area.js | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/app/javascript/mastodon/features/ui/components/columns_area.js b/app/javascript/mastodon/features/ui/components/columns_area.js index 9ee6fca43..f4824f045 100644 --- a/app/javascript/mastodon/features/ui/components/columns_area.js +++ b/app/javascript/mastodon/features/ui/components/columns_area.js @@ -1,9 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePureComponent from 'react-immutable-pure-component'; -import { Link } from 'react-router-dom'; import BundleContainer from '../containers/bundle_container'; import ColumnLoading from './column_loading'; import DrawerLoading from './drawer_loading'; @@ -21,10 +19,8 @@ import { ListTimeline, Directory, } from '../../ui/util/async-components'; -import Icon from 'mastodon/components/icon'; import ComposePanel from './compose_panel'; import NavigationPanel from './navigation_panel'; - import { supportsPassiveEvents } from 'detect-passive-events'; import { scrollRight } from '../../../scroll'; @@ -43,22 +39,13 @@ const componentMap = { 'DIRECTORY': Directory, }; -const messages = defineMessages({ - publish: { id: 'compose_form.publish', defaultMessage: 'Publish' }, -}); - -const shouldHideFAB = path => path.match(/^\/statuses\/|^\/@[^/]+\/\d+|^\/publish|^\/explore|^\/getting-started|^\/start/); - -export default @(component => injectIntl(component, { withRef: true })) -class ColumnsArea extends ImmutablePureComponent { +export default class ColumnsArea extends ImmutablePureComponent { static contextTypes = { router: PropTypes.object.isRequired, - identity: PropTypes.object.isRequired, }; static propTypes = { - intl: PropTypes.object.isRequired, columns: ImmutablePropTypes.list.isRequired, isModalOpen: PropTypes.bool.isRequired, singleColumn: PropTypes.bool, @@ -143,17 +130,14 @@ class ColumnsArea extends ImmutablePureComponent { } renderError = (props) => { - return <BundleColumnError multiColumn {...props} />; + return <BundleColumnError multiColumn errorType='network' {...props} />; } render () { - const { columns, children, singleColumn, isModalOpen, intl } = this.props; + const { columns, children, singleColumn, isModalOpen } = this.props; const { renderComposePanel } = this.state; - const { signedIn } = this.context.identity; if (singleColumn) { - const floatingActionButton = (!signedIn || shouldHideFAB(this.context.router.history.location.pathname)) ? null : <Link key='floating-action-button' to='/publish' className='floating-action-button' aria-label={intl.formatMessage(messages.publish)}><Icon id='pencil' /></Link>; - return ( <div className='columns-area__panels'> <div className='columns-area__panels__pane columns-area__panels__pane--compositional'> @@ -162,7 +146,7 @@ class ColumnsArea extends ImmutablePureComponent { </div> </div> - <div className={`columns-area__panels__main ${floatingActionButton && 'with-fab'}`}> + <div className='columns-area__panels__main'> <div className='tabs-bar__wrapper'><div id='tabs-bar__portal' /></div> <div className='columns-area columns-area--mobile'>{children}</div> </div> @@ -172,8 +156,6 @@ class ColumnsArea extends ImmutablePureComponent { <NavigationPanel /> </div> </div> - - {floatingActionButton} </div> ); } |