From 8713659dffc884c65376091d3731c8074ac581e4 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Wed, 27 Dec 2017 14:28:41 -0800 Subject: WIP Refactor; ed. --- .../features/ui/components/onboarding_modal.js | 58 ++++++++-------------- 1 file changed, 21 insertions(+), 37 deletions(-) (limited to 'app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js') diff --git a/app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js b/app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js index 21f1addea..749bbbd86 100644 --- a/app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js @@ -6,14 +6,10 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ReactSwipeableViews from 'react-swipeable-views'; import classNames from 'classnames'; import Permalink from 'flavours/glitch/components/permalink'; -import ComposeForm from 'flavours/glitch/features/compose/components/compose_form'; -import Search from 'flavours/glitch/features/compose/components/search'; -import NavigationBar from 'flavours/glitch/features/compose/components/navigation_bar'; +import { WrappedComponent as RawComposer } from 'flavours/glitch/features/composer'; +import DrawerPagerAccount from 'flavours/glitch/features/drawer/pager/account'; +import DrawerSearch from 'flavours/glitch/features/drawer/search'; import ColumnHeader from './column_header'; -import { - List as ImmutableList, - Map as ImmutableMap, -} from 'immutable'; import { me } from 'flavours/glitch/util/initial_state'; const noop = () => { }; @@ -44,29 +40,21 @@ PageOne.propTypes = { domain: PropTypes.string.isRequired, }; -const PageTwo = ({ myAccount }) => ( +const composerState = { + showSearch: true, + text: 'Awoo! #introductions', +}; + +const PageTwo = ({ intl, myAccount }) => (
- + +
-

@@ -74,22 +62,17 @@ const PageTwo = ({ myAccount }) => ( ); PageTwo.propTypes = { + intl: PropTypes.object.isRequired, myAccount: ImmutablePropTypes.map.isRequired, }; -const PageThree = ({ myAccount }) => ( +const PageThree = ({ intl, myAccount }) => (
- +
- +
@@ -99,6 +82,7 @@ const PageThree = ({ myAccount }) => ( ); PageThree.propTypes = { + intl: PropTypes.object.isRequired, myAccount: ImmutablePropTypes.map.isRequired, }; @@ -192,8 +176,8 @@ export default class OnboardingModal extends React.PureComponent { const { myAccount, admin, domain, intl } = this.props; this.pages = [ , - , - , + , + , , , ]; -- cgit From 083170bec755920b80c64f9cca2cc419831f66c8 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Fri, 29 Dec 2017 14:55:06 -0800 Subject: WIP Refactor; SCSS ed. --- app/javascript/flavours/glitch/actions/compose.js | 8 - .../flavours/glitch/components/avatar.js | 18 +- .../flavours/glitch/components/display_name.js | 12 +- .../glitch/features/composer/options/index.js | 7 +- .../glitch/features/composer/publisher/index.js | 3 +- .../glitch/features/composer/reply/index.js | 9 +- .../glitch/features/composer/textarea/index.js | 3 +- .../composer/textarea/suggestions/index.js | 8 +- .../composer/textarea/suggestions/item/index.js | 4 +- .../features/composer/upload_form/item/index.js | 1 + .../glitch/features/drawer/account/index.js | 70 +++ .../flavours/glitch/features/drawer/index.js | 33 +- .../glitch/features/drawer/pager/account/index.js | 70 --- .../flavours/glitch/features/drawer/pager/index.js | 43 -- .../features/ui/components/onboarding_modal.js | 8 +- app/javascript/flavours/glitch/reducers/compose.js | 3 - .../flavours/glitch/styles/components/compose.scss | 0 .../glitch/styles/components/composer.scss | 315 ++++++++++ .../flavours/glitch/styles/components/drawer.scss | 234 +++++++ .../flavours/glitch/styles/components/index.scss | 695 +-------------------- 20 files changed, 694 insertions(+), 850 deletions(-) create mode 100644 app/javascript/flavours/glitch/features/drawer/account/index.js delete mode 100644 app/javascript/flavours/glitch/features/drawer/pager/account/index.js delete mode 100644 app/javascript/flavours/glitch/features/drawer/pager/index.js delete mode 100644 app/javascript/flavours/glitch/styles/components/compose.scss create mode 100644 app/javascript/flavours/glitch/styles/components/composer.scss (limited to 'app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js') diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js index d87786008..31866d223 100644 --- a/app/javascript/flavours/glitch/actions/compose.js +++ b/app/javascript/flavours/glitch/actions/compose.js @@ -38,7 +38,6 @@ export const COMPOSE_SPOILERNESS_CHANGE = 'COMPOSE_SPOILERNESS_CHANGE'; export const COMPOSE_SPOILER_TEXT_CHANGE = 'COMPOSE_SPOILER_TEXT_CHANGE'; export const COMPOSE_VISIBILITY_CHANGE = 'COMPOSE_VISIBILITY_CHANGE'; export const COMPOSE_LISTABILITY_CHANGE = 'COMPOSE_LISTABILITY_CHANGE'; -export const COMPOSE_COMPOSING_CHANGE = 'COMPOSE_COMPOSING_CHANGE'; export const COMPOSE_EMOJI_INSERT = 'COMPOSE_EMOJI_INSERT'; @@ -382,10 +381,3 @@ export function insertEmojiCompose(position, emoji) { emoji, }; }; - -export function changeComposing(value) { - return { - type: COMPOSE_COMPOSING_CHANGE, - value, - }; -} diff --git a/app/javascript/flavours/glitch/components/avatar.js b/app/javascript/flavours/glitch/components/avatar.js index 82ab0f45a..c5e9072c4 100644 --- a/app/javascript/flavours/glitch/components/avatar.js +++ b/app/javascript/flavours/glitch/components/avatar.js @@ -1,3 +1,4 @@ +import classNames from 'classnames'; import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; @@ -7,6 +8,7 @@ export default class Avatar extends React.PureComponent { static propTypes = { account: ImmutablePropTypes.map.isRequired, + className: PropTypes.string, size: PropTypes.number.isRequired, style: PropTypes.object, inline: PropTypes.bool, @@ -34,17 +36,19 @@ export default class Avatar extends React.PureComponent { } render () { - const { account, size, animate, inline } = this.props; + const { + account, + animate, + className, + inline, + size, + } = this.props; const { hovering } = this.state; const src = account.get('avatar'); const staticSrc = account.get('avatar_static'); - let className = 'account__avatar'; - - if (inline) { - className = className + ' account__avatar-inline'; - } + const computedClass = classNames('account__avatar', { 'account__avatar-inline': inline }, className); const style = { ...this.props.style, @@ -61,7 +65,7 @@ export default class Avatar extends React.PureComponent { return (
+ @{this.props.account.get('acct')} ); diff --git a/app/javascript/flavours/glitch/features/composer/options/index.js b/app/javascript/flavours/glitch/features/composer/options/index.js index ee633e865..ea998a421 100644 --- a/app/javascript/flavours/glitch/features/composer/options/index.js +++ b/app/javascript/flavours/glitch/features/composer/options/index.js @@ -236,7 +236,12 @@ export default class ComposerOptions extends React.PureComponent { }} > {({ scale }) => ( -
+
{diff} {sideArm && sideArm !== 'none' ? (