From 1fb4bf87f7c946f5d2a6ae73f01380840330949f Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 27 May 2018 20:55:11 +0200 Subject: [Glitch] Add media timeline Port 7403e5d306d36c83bfb80cd900235373186cd51a to glitch-soc --- app/javascript/flavours/glitch/features/ui/index.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/javascript/flavours/glitch/features/ui') diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js index 510bb9540..79b4ce24c 100644 --- a/app/javascript/flavours/glitch/features/ui/index.js +++ b/app/javascript/flavours/glitch/features/ui/index.js @@ -467,7 +467,9 @@ export default class UI extends React.Component { + + -- cgit From 1a9e78b9bc6605b8822b7320aa355a8a3aa00f47 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 27 May 2018 21:22:17 +0200 Subject: [Glitch] Add exact attribute to WrappedRoute for community timeline Port 46061dc041b0a2a4a3907976cc3432abdb1d67ec to glitch-soc --- app/javascript/flavours/glitch/features/ui/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch/features/ui') diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js index 79b4ce24c..9892f3254 100644 --- a/app/javascript/flavours/glitch/features/ui/index.js +++ b/app/javascript/flavours/glitch/features/ui/index.js @@ -467,8 +467,8 @@ export default class UI extends React.Component { - - + + -- cgit From c03cbb9471be1437f3cf1671b7592966db9c5c0b Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 27 May 2018 21:23:56 +0200 Subject: [Glitch] Save onlyMedia prop when pinning column Port 5ea643b27908b14bd89ff068fc87e446e8cbcd32 to glitch-soc --- .../flavours/glitch/features/community_timeline/index.js | 13 +++++++++---- .../flavours/glitch/features/public_timeline/index.js | 13 +++++++++---- .../flavours/glitch/features/ui/components/columns_area.js | 3 ++- 3 files changed, 20 insertions(+), 9 deletions(-) (limited to 'app/javascript/flavours/glitch/features/ui') diff --git a/app/javascript/flavours/glitch/features/community_timeline/index.js b/app/javascript/flavours/glitch/features/community_timeline/index.js index 0bf0c1cd3..3efb4a32f 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/index.js +++ b/app/javascript/flavours/glitch/features/community_timeline/index.js @@ -1,7 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; -import { NavLink } from 'react-router-dom'; +import { NavLink, Link } from 'react-router-dom'; import PropTypes from 'prop-types'; import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container'; import Column from 'flavours/glitch/components/column'; @@ -37,12 +37,12 @@ export default class CommunityTimeline extends React.PureComponent { }; handlePin = () => { - const { columnId, dispatch } = this.props; + const { columnId, dispatch, onlyMedia } = this.props; if (columnId) { dispatch(removeColumn(columnId)); } else { - dispatch(addColumn('COMMUNITY', {})); + dispatch(addColumn('COMMUNITY', { other: { onlyMedia } })); } } @@ -83,7 +83,12 @@ export default class CommunityTimeline extends React.PureComponent { const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props; const pinned = !!columnId; - const headline = ( + const headline = pinned ? ( +
+ + +
+ ) : (
diff --git a/app/javascript/flavours/glitch/features/public_timeline/index.js b/app/javascript/flavours/glitch/features/public_timeline/index.js index daaa9b6ca..8e27bcd7c 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/index.js +++ b/app/javascript/flavours/glitch/features/public_timeline/index.js @@ -1,7 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; -import { NavLink } from 'react-router-dom'; +import { NavLink, Link } from 'react-router-dom'; import PropTypes from 'prop-types'; import StatusListContainer from 'flavours/glitch/features/ui/containers/status_list_container'; import Column from 'flavours/glitch/components/column'; @@ -37,12 +37,12 @@ export default class PublicTimeline extends React.PureComponent { }; handlePin = () => { - const { columnId, dispatch } = this.props; + const { columnId, dispatch, onlyMedia } = this.props; if (columnId) { dispatch(removeColumn(columnId)); } else { - dispatch(addColumn('PUBLIC', {})); + dispatch(addColumn('PUBLIC', { other: { onlyMedia } })); } } @@ -83,7 +83,12 @@ export default class PublicTimeline extends React.PureComponent { const { intl, columnId, hasUnread, multiColumn, onlyMedia } = this.props; const pinned = !!columnId; - const headline = ( + const headline = pinned ? ( +
+ + +
+ ) : (
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 71cb7e8c9..65a63294b 100644 --- a/app/javascript/flavours/glitch/features/ui/components/columns_area.js +++ b/app/javascript/flavours/glitch/features/ui/components/columns_area.js @@ -179,10 +179,11 @@ export default class ColumnsArea extends ImmutablePureComponent {
{columns.map(column => { const params = column.get('params', null) === null ? null : column.get('params').toJS(); + const other = params && params.other ? params.other : {}; return ( - {SpecificComponent => } + {SpecificComponent => } ); })} -- cgit From 490d8fff0b22919892a12128e6f2126444edcd4c Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Tue, 18 Dec 2018 19:06:58 +0100 Subject: Remove dead code --- app/javascript/flavours/glitch/features/public_timeline/index.js | 9 +-------- app/javascript/flavours/glitch/features/ui/index.js | 2 -- 2 files changed, 1 insertion(+), 10 deletions(-) (limited to 'app/javascript/flavours/glitch/features/ui') diff --git a/app/javascript/flavours/glitch/features/public_timeline/index.js b/app/javascript/flavours/glitch/features/public_timeline/index.js index ec552fb5d..477d3b8c7 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/index.js +++ b/app/javascript/flavours/glitch/features/public_timeline/index.js @@ -103,13 +103,6 @@ export default class PublicTimeline extends React.PureComponent { return !(location.state && location.state.mastodonModalOpen) } - handleSettingChanged = (key, checked) => { - const { columnId } = this.props; - if (!columnId && key[0] === 'other' && key[1] === 'onlyMedia') { - this.context.router.history.replace(`/timelines/public${checked ? '/media' : ''}`); - } - } - render () { const { intl, columnId, hasUnread, multiColumn, onlyMedia } = this.props; const pinned = !!columnId; @@ -126,7 +119,7 @@ export default class PublicTimeline extends React.PureComponent { pinned={pinned} multiColumn={multiColumn} > - + - - -- cgit From 056a8a8ee48e79993f42a910b86d70523aa9f0ae Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Tue, 27 Nov 2018 17:31:50 +0100 Subject: Allow disabling media confirmation from the confirmation dialog itself --- .../flavours/glitch/features/composer/index.js | 3 +++ .../features/ui/components/confirmation_modal.js | 30 +++++++++++++++++----- .../flavours/glitch/styles/components/modal.scss | 12 +++++++++ 3 files changed, 39 insertions(+), 6 deletions(-) (limited to 'app/javascript/flavours/glitch/features/ui') diff --git a/app/javascript/flavours/glitch/features/composer/index.js b/app/javascript/flavours/glitch/features/composer/index.js index a8f5a5c3c..eb0bc867b 100644 --- a/app/javascript/flavours/glitch/features/composer/index.js +++ b/app/javascript/flavours/glitch/features/composer/index.js @@ -30,6 +30,7 @@ import { closeModal, openModal, } from 'flavours/glitch/actions/modal'; +import { changeLocalSetting } from 'flavours/glitch/actions/local_settings'; // Components. import ComposerOptions from './options'; @@ -165,6 +166,8 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ message: intl.formatMessage(messages.missingDescriptionMessage), confirm: intl.formatMessage(messages.missingDescriptionConfirm), onConfirm: () => dispatch(submitCompose(routerHistory)), + onDoNotAsk: () => dispatch(changeLocalSetting(['confirm_missing_media_description'], false)), + onConfirm: () => dispatch(submitCompose()), })); }, onSubmit(routerHistory) { diff --git a/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js b/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js index d4d1e587e..07281f818 100644 --- a/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js @@ -11,6 +11,7 @@ export default class ConfirmationModal extends React.PureComponent { confirm: PropTypes.string.isRequired, onClose: PropTypes.func.isRequired, onConfirm: PropTypes.func.isRequired, + onDoNotAsk: PropTypes.func, intl: PropTypes.object.isRequired, }; @@ -21,6 +22,9 @@ export default class ConfirmationModal extends React.PureComponent { handleClick = () => { this.props.onClose(); this.props.onConfirm(); + if (this.props.onDoNotAsk && this.doNotAskCheckbox.checked) { + this.props.onDoNotAsk(); + } } handleCancel = () => { @@ -31,8 +35,12 @@ export default class ConfirmationModal extends React.PureComponent { this.button = c; } + setDoNotAskRef = (c) => { + this.doNotAskCheckbox = c; + } + render () { - const { message, confirm } = this.props; + const { message, confirm, onDoNotAsk } = this.props; return (
@@ -40,11 +48,21 @@ export default class ConfirmationModal extends React.PureComponent { {message}
-
- - +
); diff --git a/app/javascript/flavours/glitch/styles/components/modal.scss b/app/javascript/flavours/glitch/styles/components/modal.scss index 1bfedc383..dc26ca3b5 100644 --- a/app/javascript/flavours/glitch/styles/components/modal.scss +++ b/app/javascript/flavours/glitch/styles/components/modal.scss @@ -686,6 +686,18 @@ } } +.confirmation-modal__do_not_ask_again { + padding-left: 20px; + padding-right: 20px; + padding-bottom: 10px; + + font-size: 14px; + + label, input { + vertical-align: middle; + } +} + .confirmation-modal__container, .mute-modal__container, .report-modal__target { -- cgit