]> cat aescling's git repositories - mastodon.git/commitdiff
Rename flavours/glitch/features/drawer to flavours/glitch/features/compose
authorThibaut Girka <thib@sitedethib.com>
Fri, 19 Apr 2019 18:14:32 +0000 (20:14 +0200)
committerThibG <thib@sitedethib.com>
Mon, 22 Apr 2019 18:15:47 +0000 (20:15 +0200)
app/javascript/flavours/glitch/features/compose/account/index.js [moved from app/javascript/flavours/glitch/features/drawer/account/index.js with 100% similarity]
app/javascript/flavours/glitch/features/compose/header/index.js [moved from app/javascript/flavours/glitch/features/drawer/header/index.js with 100% similarity]
app/javascript/flavours/glitch/features/compose/index.js [moved from app/javascript/flavours/glitch/features/drawer/index.js with 79% similarity]
app/javascript/flavours/glitch/features/compose/results/index.js [moved from app/javascript/flavours/glitch/features/drawer/results/index.js with 100% similarity]
app/javascript/flavours/glitch/features/compose/search/index.js [moved from app/javascript/flavours/glitch/features/drawer/search/index.js with 100% similarity]
app/javascript/flavours/glitch/features/compose/search/popout/index.js [moved from app/javascript/flavours/glitch/features/drawer/search/popout/index.js with 100% similarity]
app/javascript/flavours/glitch/features/ui/components/columns_area.js
app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js
app/javascript/flavours/glitch/features/ui/index.js
app/javascript/flavours/glitch/theme.yml
app/javascript/flavours/glitch/util/async-components.js

similarity index 79%
rename from app/javascript/flavours/glitch/features/drawer/index.js
rename to app/javascript/flavours/glitch/features/compose/index.js
index c8121b8e559fba0132b1524e0225eceba21d59d8..cb261f9d63b9a8b92c2e4b987163201a5a575125 100644 (file)
@@ -1,8 +1,9 @@
 //  Package imports.
-import PropTypes from 'prop-types';
 import React from 'react';
+import { connect } from 'react-redux';
+import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
-import { defineMessages } from 'react-intl';
+import { injectIntl, defineMessages } from 'react-intl';
 import classNames from 'classnames';
 
 //  Actions.
@@ -69,12 +70,33 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
 });
 
 //  The component.
-class Drawer extends React.Component {
-
-  //  Constructor.
-  constructor (props) {
-    super(props);
-  }
+export default @connect(mapStateToProps, mapDispatchToProps)
+@injectIntl
+class Compose extends React.PureComponent {
+  static propTypes = {
+    intl: PropTypes.object.isRequired,
+    isSearchPage: PropTypes.bool,
+    multiColumn: PropTypes.bool,
+
+    //  State props.
+    account: ImmutablePropTypes.map,
+    columns: ImmutablePropTypes.list,
+    results: ImmutablePropTypes.map,
+    elefriend: PropTypes.number,
+    searchHidden: PropTypes.bool,
+    searchValue: PropTypes.string,
+    submitted: PropTypes.bool,
+    unreadNotifications: PropTypes.number,
+    showNotificationsBadge: PropTypes.bool,
+
+    //  Dispatch props.
+    onChange: PropTypes.func,
+    onClear: PropTypes.func,
+    onClickElefriend: PropTypes.func,
+    onShow: PropTypes.func,
+    onSubmit: PropTypes.func,
+    onOpenSettings: PropTypes.func,
+  };
 
   //  Rendering.
   render () {
@@ -103,7 +125,7 @@ class Drawer extends React.Component {
     //  The result.
     return (
       <div className={computedClass} role='region' aria-label={intl.formatMessage(messages.compose)}>
-        {multiColumn ? (
+        {multiColumn && (
           <DrawerHeader
             columns={columns}
             unreadNotifications={unreadNotifications}
@@ -111,7 +133,7 @@ class Drawer extends React.Component {
             intl={intl}
             onSettingsClick={onOpenSettings}
           />
-        ) : null}
+        )}
         {(multiColumn || isSearchPage) && <DrawerSearch
             intl={intl}
             onChange={onChange}
@@ -141,35 +163,4 @@ class Drawer extends React.Component {
       </div>
     );
   }
-
 }
-
-//  Props.
-Drawer.propTypes = {
-  intl: PropTypes.object.isRequired,
-  isSearchPage: PropTypes.bool,
-  multiColumn: PropTypes.bool,
-
-  //  State props.
-  account: ImmutablePropTypes.map,
-  columns: ImmutablePropTypes.list,
-  results: ImmutablePropTypes.map,
-  elefriend: PropTypes.number,
-  searchHidden: PropTypes.bool,
-  searchValue: PropTypes.string,
-  submitted: PropTypes.bool,
-  unreadNotifications: PropTypes.number,
-  showNotificationsBadge: PropTypes.bool,
-
-  //  Dispatch props.
-  onChange: PropTypes.func,
-  onClear: PropTypes.func,
-  onClickElefriend: PropTypes.func,
-  onShow: PropTypes.func,
-  onSubmit: PropTypes.func,
-  onOpenSettings: PropTypes.func,
-};
-
-//  Connecting and export.
-export { Drawer as WrappedComponent };
-export default wrap(Drawer, mapStateToProps, mapDispatchToProps, true);
index 83b797305790b0fd24be1dde10b35fd68f4d704d..0fe580b9b249b73a73135f2970a37d054caa2bc4 100644 (file)
@@ -12,13 +12,13 @@ import BundleContainer from '../containers/bundle_container';
 import ColumnLoading from './column_loading';
 import DrawerLoading from './drawer_loading';
 import BundleColumnError from './bundle_column_error';
-import { Drawer, Notifications, HomeTimeline, CommunityTimeline, PublicTimeline, HashtagTimeline, DirectTimeline, FavouritedStatuses, BookmarkedStatuses, ListTimeline } from 'flavours/glitch/util/async-components';
+import { Compose, Notifications, HomeTimeline, CommunityTimeline, PublicTimeline, HashtagTimeline, DirectTimeline, FavouritedStatuses, BookmarkedStatuses, ListTimeline } from 'flavours/glitch/util/async-components';
 
 import detectPassiveEvents from 'detect-passive-events';
 import { scrollRight } from 'flavours/glitch/util/scroll';
 
 const componentMap = {
-  'COMPOSE': Drawer,
+  'COMPOSE': Compose,
   'HOME': HomeTimeline,
   'NOTIFICATIONS': Notifications,
   'PUBLIC': PublicTimeline,
index 16355a44628bd5a17e6b0bdc1597042592c0035b..e9c634a505d5125d08adcef4d6675e33a6a78dcd 100644 (file)
@@ -7,8 +7,8 @@ import ReactSwipeableViews from 'react-swipeable-views';
 import classNames from 'classnames';
 import Permalink from 'flavours/glitch/components/permalink';
 import { WrappedComponent as RawComposer } from 'flavours/glitch/features/composer';
-import DrawerAccount from 'flavours/glitch/features/drawer/account';
-import DrawerSearch from 'flavours/glitch/features/drawer/search';
+import DrawerAccount from 'flavours/glitch/features/compose/account';
+import DrawerSearch from 'flavours/glitch/features/compose/search';
 import ColumnHeader from './column_header';
 import { me } from 'flavours/glitch/util/initial_state';
 
index 348125c97e630bec0ad04b557313d700c0f29b5e..dd527d528685e06b30984aa534647bab8eac67d7 100644 (file)
@@ -19,7 +19,7 @@ import ColumnsAreaContainer from './containers/columns_area_container';
 import classNames from 'classnames';
 import Favico from 'favico.js';
 import {
-  Drawer,
+  Compose,
   Status,
   GettingStarted,
   KeyboardShortcuts,
@@ -488,9 +488,9 @@ export default class UI extends React.Component {
               <WrappedRoute path='/bookmarks' component={BookmarkedStatuses} content={children} />
               <WrappedRoute path='/pinned' component={PinnedStatuses} content={children} />
 
-              <WrappedRoute path='/search' component={Drawer} content={children} componentParams={{ isSearchPage: true }} />
+              <WrappedRoute path='/search' component={Compose} content={children} componentParams={{ isSearchPage: true }} />
 
-              <WrappedRoute path='/statuses/new' component={Drawer} content={children} />
+              <WrappedRoute path='/statuses/new' component={Compose} content={children} />
               <WrappedRoute path='/statuses/:statusId' exact component={Status} content={children} />
               <WrappedRoute path='/statuses/:statusId/reblogs' component={Reblogs} content={children} />
               <WrappedRoute path='/statuses/:statusId/favourites' component={Favourites} content={children} />
index 587cc0f1ed41172760c9e911d18a6f75b131d8ed..06e26ade26eec1e5ac300f7160245c73a3553b07 100644 (file)
@@ -11,7 +11,7 @@ pack:
   home:
     filename: packs/home.js
     preload:
-    - flavours/glitch/async/drawer
+    - flavours/glitch/async/compose
     - flavours/glitch/async/getting_started
     - flavours/glitch/async/home_timeline
     - flavours/glitch/async/notifications
index e96af845f049d1ff4f70a59c7bdc1e7f7b885449..09495220451b95eae9d1c08d8cb43702b5733aff 100644 (file)
@@ -2,8 +2,8 @@ export function EmojiPicker () {
   return import(/* webpackChunkName: "flavours/glitch/async/emoji_picker" */'flavours/glitch/util/emoji/emoji_picker');
 }
 
-export function Drawer () {
-  return import(/* webpackChunkName: "flavours/glitch/async/drawer" */'flavours/glitch/features/drawer');
+export function Compose () {
+  return import(/* webpackChunkName: "flavours/glitch/async/compose" */'flavours/glitch/features/compose');
 }
 
 export function Notifications () {