From e433386545e53f84a47f5c1b09a7c0aaafa978a3 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Fri, 14 Jun 2019 12:59:59 +0200 Subject: Fix replying not automatically switching to compose form on mobile --- .../features/compose/components/compose_form.js | 18 --------------- .../compose/containers/compose_form_container.js | 10 -------- .../flavours/glitch/features/compose/index.js | 27 ++++++++++++++++++++++ 3 files changed, 27 insertions(+), 28 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index b4b43785a..5e73d7651 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -66,8 +66,6 @@ class ComposeForm extends ImmutablePureComponent { preselectOnReply: PropTypes.bool, onChangeSpoilerness: PropTypes.func, onChangeVisibility: PropTypes.func, - onMount: PropTypes.func, - onUnmount: PropTypes.func, onPaste: PropTypes.func, onMediaDescriptionConfirm: PropTypes.func, }; @@ -196,22 +194,6 @@ class ComposeForm extends ImmutablePureComponent { } } - // Tells our state the composer has been mounted. - componentDidMount () { - const { onMount } = this.props; - if (onMount) { - onMount(); - } - } - - // Tells our state the composer has been unmounted. - componentWillUnmount () { - const { onUnmount } = this.props; - if (onUnmount) { - onUnmount(); - } - } - handleFocus = () => { if (this.composeForm) { this.composeForm.scrollIntoView(); diff --git a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js index 814f9a97a..199d43913 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js @@ -9,10 +9,8 @@ import { clearComposeSuggestions, fetchComposeSuggestions, insertEmojiCompose, - mountCompose, selectComposeSuggestion, submitCompose, - unmountCompose, uploadCompose, } from 'flavours/glitch/actions/compose'; import { @@ -114,14 +112,6 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ dispatch(changeComposeVisibility(value)); }, - onMount() { - dispatch(mountCompose()); - }, - - onUnmount() { - dispatch(unmountCompose()); - }, - onMediaDescriptionConfirm(routerHistory) { dispatch(openModal('CONFIRM', { message: intl.formatMessage(messages.missingDescriptionMessage), diff --git a/app/javascript/flavours/glitch/features/compose/index.js b/app/javascript/flavours/glitch/features/compose/index.js index d3070a199..cb6c54a48 100644 --- a/app/javascript/flavours/glitch/features/compose/index.js +++ b/app/javascript/flavours/glitch/features/compose/index.js @@ -4,6 +4,7 @@ import NavigationContainer from './containers/navigation_container'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; +import { mountCompose, unmountCompose } from 'flavours/glitch/actions/compose'; import { injectIntl, defineMessages } from 'react-intl'; import classNames from 'classnames'; import SearchContainer from './containers/search_container'; @@ -27,6 +28,14 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ onClickElefriend () { dispatch(cycleElefriendCompose()); }, + + onMount () { + dispatch(mountCompose()); + }, + + onUnmount () { + dispatch(unmountCompose()); + }, }); export default @connect(mapStateToProps, mapDispatchToProps) @@ -38,9 +47,27 @@ class Compose extends React.PureComponent { isSearchPage: PropTypes.bool, elefriend: PropTypes.number, onClickElefriend: PropTypes.func, + onMount: PropTypes.func, + onUnmount: PropTypes.func, intl: PropTypes.object.isRequired, }; + componentDidMount () { + const { isSearchPage } = this.props; + + if (!isSearchPage) { + this.props.onMount(); + } + } + + componentWillUnmount () { + const { isSearchPage } = this.props; + + if (!isSearchPage) { + this.props.onUnmount(); + } + } + render () { const { elefriend, -- cgit From b6f76d130600ded7f0f2cb585d8b9732e7aa1cff Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 8 Jun 2019 15:30:06 +0200 Subject: [Glitch] Change full logo to use primary text color of the given theme Port 20dda5cca0a4015a743250b4e584a3101e7675f2 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/styles/about.scss | 3 ++- app/javascript/flavours/glitch/styles/containers.scss | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/styles/about.scss b/app/javascript/flavours/glitch/styles/about.scss index d4ead07a1..0e910693d 100644 --- a/app/javascript/flavours/glitch/styles/about.scss +++ b/app/javascript/flavours/glitch/styles/about.scss @@ -662,7 +662,8 @@ $small-breakpoint: 960px; align-items: center; padding: 50px; - img { + svg { + fill: $primary-text-color; height: 52px; } diff --git a/app/javascript/flavours/glitch/styles/containers.scss b/app/javascript/flavours/glitch/styles/containers.scss index b0c187eab..dc60dd14b 100644 --- a/app/javascript/flavours/glitch/styles/containers.scss +++ b/app/javascript/flavours/glitch/styles/containers.scss @@ -21,7 +21,8 @@ justify-content: center; align-items: center; - img { + svg { + fill: $primary-text-color; height: 42px; margin-right: 10px; } @@ -258,12 +259,13 @@ display: block; padding: 15px; - img { + svg { display: block; height: 18px; width: auto; position: relative; bottom: -2px; + fill: $primary-text-color; @media screen and (max-width: $no-gap-breakpoint) { height: 20px; -- cgit From a29ab6f1bdd13262d206e41c66dea15ed4dc3f22 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 16 Jun 2019 15:18:53 +0200 Subject: Fix composer buttons overflowing the composer box in single-column --- app/javascript/flavours/glitch/styles/components/composer.scss | 1 + 1 file changed, 1 insertion(+) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/styles/components/composer.scss b/app/javascript/flavours/glitch/styles/components/composer.scss index 62eca49a1..c06d79ffc 100644 --- a/app/javascript/flavours/glitch/styles/components/composer.scss +++ b/app/javascript/flavours/glitch/styles/components/composer.scss @@ -586,6 +586,7 @@ white-space: nowrap; overflow: hidden; justify-content: flex-end; + flex: 0 0 auto; & > .count { display: inline-block; -- cgit From 01e362316c5273ab5ae6acaa44834260b731fe57 Mon Sep 17 00:00:00 2001 From: ThibG Date: Sun, 16 Jun 2019 18:46:55 +0200 Subject: Do not scroll in the compose panel on single-column (#11093) --- app/javascript/mastodon/features/compose/components/compose_form.js | 3 ++- app/javascript/mastodon/features/ui/components/compose_panel.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index 60d6ce673..c846ad6e7 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -60,6 +60,7 @@ class ComposeForm extends ImmutablePureComponent { onPickEmoji: PropTypes.func.isRequired, showSearch: PropTypes.bool, anyMedia: PropTypes.bool, + singleColumn: PropTypes.bool, }; static defaultProps = { @@ -115,7 +116,7 @@ class ComposeForm extends ImmutablePureComponent { } handleFocus = () => { - if (this.composeForm) { + if (this.composeForm && !this.props.singleColumn) { this.composeForm.scrollIntoView(); } } diff --git a/app/javascript/mastodon/features/ui/components/compose_panel.js b/app/javascript/mastodon/features/ui/components/compose_panel.js index a05fbbe39..c7821f473 100644 --- a/app/javascript/mastodon/features/ui/components/compose_panel.js +++ b/app/javascript/mastodon/features/ui/components/compose_panel.js @@ -8,7 +8,7 @@ const ComposePanel = () => (
- +
); -- cgit From d3aaacb6d48ab815a79cc4feb6b2c9a1ffc41717 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 16 Jun 2019 16:02:26 +0200 Subject: Do not scroll in the compose panel on single-column --- .../flavours/glitch/features/compose/components/compose_form.js | 6 ++++-- .../flavours/glitch/features/ui/components/compose_panel.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index 5e73d7651..cbce675d5 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -55,6 +55,7 @@ class ComposeForm extends ImmutablePureComponent { onPickEmoji: PropTypes.func, showSearch: PropTypes.bool, anyMedia: PropTypes.bool, + singleColumn: PropTypes.bool, advancedOptions: ImmutablePropTypes.map, layout: PropTypes.string, @@ -195,7 +196,7 @@ class ComposeForm extends ImmutablePureComponent { } handleFocus = () => { - if (this.composeForm) { + if (this.composeForm && !this.props.singleColumn) { this.composeForm.scrollIntoView(); } } @@ -219,6 +220,7 @@ class ComposeForm extends ImmutablePureComponent { preselectDate, text, preselectOnReply, + singleColumn, } = this.props; let selectionEnd, selectionStart; @@ -238,7 +240,7 @@ class ComposeForm extends ImmutablePureComponent { if (textarea) { textarea.setSelectionRange(selectionStart, selectionEnd); textarea.focus(); - textarea.scrollIntoView(); + if (!singleColumn) textarea.scrollIntoView(); } // Refocuses the textarea after submitting. diff --git a/app/javascript/flavours/glitch/features/ui/components/compose_panel.js b/app/javascript/flavours/glitch/features/ui/components/compose_panel.js index f5eefee0d..498f09ab6 100644 --- a/app/javascript/flavours/glitch/features/ui/components/compose_panel.js +++ b/app/javascript/flavours/glitch/features/ui/components/compose_panel.js @@ -8,7 +8,7 @@ const ComposePanel = () => (
- +
); -- cgit From f57a0f89a8b2b894d028de8e75caddcf3a8c904e Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 16 Jun 2019 20:41:03 +0200 Subject: Fix styling of poll options on public pages in glitch flavour --- app/javascript/flavours/glitch/styles/polls.scss | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/styles/polls.scss b/app/javascript/flavours/glitch/styles/polls.scss index 50bb45e7c..5261f17f4 100644 --- a/app/javascript/flavours/glitch/styles/polls.scss +++ b/app/javascript/flavours/glitch/styles/polls.scss @@ -2,6 +2,12 @@ margin-top: 16px; font-size: 14px; + ul, + .e-content & ul { + margin: 0; + list-style: none; + } + li { margin-bottom: 10px; position: relative; -- cgit