From 42f50049ff29ccdc484c22f8a5a19cda2dd03a5b Mon Sep 17 00:00:00 2001 From: kibigo! Date: Wed, 3 Jan 2018 12:36:21 -0800 Subject: WIP Refactor; 1000 tiny edits --- .../flavours/glitch/features/ui/components/actions_modal.js | 2 +- .../flavours/glitch/features/ui/components/columns_area.js | 4 ++-- app/javascript/flavours/glitch/features/ui/index.js | 12 +++++------- 3 files changed, 8 insertions(+), 10 deletions(-) (limited to 'app/javascript/flavours/glitch/features/ui') diff --git a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js index 020cc0dd6..c8b040f95 100644 --- a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js @@ -50,7 +50,7 @@ export default class ActionsModal extends ImmutablePureComponent { {function () { diff --git a/app/javascript/flavours/glitch/features/ui/components/columns_area.js b/app/javascript/flavours/glitch/features/ui/components/columns_area.js index 91d4df93f..e4556899d 100644 --- a/app/javascript/flavours/glitch/features/ui/components/columns_area.js +++ b/app/javascript/flavours/glitch/features/ui/components/columns_area.js @@ -11,13 +11,13 @@ import BundleContainer from '../containers/bundle_container'; import ColumnLoading from './column_loading'; import DrawerLoading from './drawer_loading'; import BundleColumnError from './bundle_column_error'; -import { Compose, Notifications, HomeTimeline, CommunityTimeline, PublicTimeline, HashtagTimeline, DirectTimeline, FavouritedStatuses, ListTimeline } from 'flavours/glitch/util/async-components'; +import { Drawer, Notifications, HomeTimeline, CommunityTimeline, PublicTimeline, HashtagTimeline, DirectTimeline, FavouritedStatuses, ListTimeline } from 'flavours/glitch/util/async-components'; import detectPassiveEvents from 'detect-passive-events'; import { scrollRight } from 'flavours/glitch/util/scroll'; const componentMap = { - 'COMPOSE': Compose, + 'COMPOSE': Drawer, 'HOME': HomeTimeline, 'NOTIFICATIONS': Notifications, 'PUBLIC': PublicTimeline, diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js index 5c80ea07b..fae705deb 100644 --- a/app/javascript/flavours/glitch/features/ui/index.js +++ b/app/javascript/flavours/glitch/features/ui/index.js @@ -17,7 +17,7 @@ import UploadArea from './components/upload_area'; import ColumnsAreaContainer from './containers/columns_area_container'; import classNames from 'classnames'; import { - Compose, + Drawer, Status, GettingStarted, KeyboardShortcuts, @@ -56,7 +56,6 @@ const messages = defineMessages({ }); const mapStateToProps = state => ({ - isComposing: state.getIn(['compose', 'is_composing']), hasComposingText: state.getIn(['compose', 'text']) !== '', layout: state.getIn(['local_settings', 'layout']), isWide: state.getIn(['local_settings', 'stretch']), @@ -120,9 +119,9 @@ export default class UI extends React.Component { }; handleBeforeUnload = (e) => { - const { intl, isComposing, hasComposingText } = this.props; + const { intl, hasComposingText } = this.props; - if (isComposing && hasComposingText) { + if (hasComposingText) { // Setting returnValue to any string causes confirmation dialog. // Many browsers no longer display this text to users, // but we set user-friendly message for other browsers, e.g. Edge. @@ -227,9 +226,8 @@ export default class UI extends React.Component { } shouldComponentUpdate (nextProps) { - if (nextProps.isComposing !== this.props.isComposing) { + if (nextProps.navbarUnder !== this.props.navbarUnder) { // Avoid expensive update just to toggle a class - this.node.classList.toggle('is-composing', nextProps.isComposing); this.node.classList.toggle('navbar-under', nextProps.navbarUnder); return false; @@ -427,7 +425,7 @@ export default class UI extends React.Component { - + -- cgit