From 14337e78394f30a3893429017fa78529f6bc693f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 7 Apr 2022 21:16:26 +0200 Subject: [PATCH] Missing description modal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikoล‚ajczak --- app/soapbox/features/direct_timeline/index.js | 1 + .../components/missing_description_modal.js | 52 ------------------- .../components/missing_description_modal.tsx | 50 ++++++++++++++++++ app/soapbox/locales/en-Shaw.json | 3 +- app/soapbox/locales/he.json | 3 +- app/soapbox/locales/pl.json | 3 +- app/soapbox/locales/zh-CN.json | 3 +- 7 files changed, 59 insertions(+), 56 deletions(-) delete mode 100644 app/soapbox/features/ui/components/missing_description_modal.js create mode 100644 app/soapbox/features/ui/components/missing_description_modal.tsx diff --git a/app/soapbox/features/direct_timeline/index.js b/app/soapbox/features/direct_timeline/index.js index 3c81c5d14..b09a58158 100644 --- a/app/soapbox/features/direct_timeline/index.js +++ b/app/soapbox/features/direct_timeline/index.js @@ -75,6 +75,7 @@ class DirectTimeline extends React.PureComponent { timelineId='direct' onLoadMore={this.handleLoadMore} emptyMessage={} + divideType='space' /> ); diff --git a/app/soapbox/features/ui/components/missing_description_modal.js b/app/soapbox/features/ui/components/missing_description_modal.js deleted file mode 100644 index d7b472bec..000000000 --- a/app/soapbox/features/ui/components/missing_description_modal.js +++ /dev/null @@ -1,52 +0,0 @@ -import PropTypes from 'prop-types'; -import React from 'react'; -import { injectIntl, FormattedMessage } from 'react-intl'; - -import { Button } from '../../../components/ui'; - -export default @injectIntl -class MissingDescriptionModal extends React.PureComponent { - - static propTypes = { - onClose: PropTypes.func, - onContinue: PropTypes.func.isRequired, - intl: PropTypes.object.isRequired, - }; - - componentDidMount() { - this.button.focus(); - } - - handleContinue = () => { - this.props.onClose(); - this.props.onContinue(); - } - - handleCancel = () => { - this.props.onClose(); - } - - setRef = (c) => { - this.button = c; - } - - render() { - return ( -
-
- -
- -
- - -
-
- ); - } - -} diff --git a/app/soapbox/features/ui/components/missing_description_modal.tsx b/app/soapbox/features/ui/components/missing_description_modal.tsx new file mode 100644 index 000000000..53fe240d0 --- /dev/null +++ b/app/soapbox/features/ui/components/missing_description_modal.tsx @@ -0,0 +1,50 @@ +import React from 'react'; +import { injectIntl, FormattedMessage, IntlShape, defineMessages } from 'react-intl'; + +import { Modal } from 'soapbox/components/ui'; + +const messages = defineMessages({ + modalTitle: { id: 'missing_description_modal.text', defaultMessage: 'You have not entered a description for all attachments.' }, + post: { id: 'missing_description_modal.continue', defaultMessage: 'Post' }, + cancel: { id: 'missing_description_modal.cancel', defaultMessage: 'Cancel' }, +}); + +interface IMissingDescriptionModal { + onClose: Function, + onContinue: Function, + intl: IntlShape, +} + +class MissingDescriptionModal extends React.PureComponent { + + handleContinue = () => { + this.props.onClose(); + this.props.onContinue(); + } + + handleCancel = () => { + this.props.onClose(); + } + + render() { + const { intl } = this.props; + + return ( + +

+ +

+
+ ); + } + +} + +export default injectIntl(MissingDescriptionModal); diff --git a/app/soapbox/locales/en-Shaw.json b/app/soapbox/locales/en-Shaw.json index ae0b73eb2..584c53c8d 100644 --- a/app/soapbox/locales/en-Shaw.json +++ b/app/soapbox/locales/en-Shaw.json @@ -595,7 +595,8 @@ "mfa.setup_warning": "๐‘ฎ๐‘ฒ๐‘‘ ๐‘ž๐‘ฐ๐‘Ÿ ๐‘’๐‘ด๐‘›๐‘Ÿ ๐‘›๐‘ฌ๐‘ฏ ๐‘น ๐‘•๐‘ฑ๐‘ ๐‘ž๐‘ง๐‘ฅ ๐‘•๐‘ณ๐‘ฅ๐‘ข๐‘บ ๐‘•๐‘ฆ๐‘’๐‘˜๐‘ซ๐‘ผ - ๐‘ณ๐‘ž๐‘ผ๐‘ข๐‘ฒ๐‘Ÿ ๐‘ฟ ๐‘ข๐‘ด๐‘ฏ๐‘‘ ๐‘•๐‘ฐ ๐‘ž๐‘ง๐‘ฅ ๐‘ฉ๐‘œ๐‘ฑ๐‘ฏ. ๐‘ฆ๐‘“ ๐‘ฟ ๐‘ค๐‘ต๐‘Ÿ ๐‘จ๐‘’๐‘•๐‘ง๐‘• ๐‘‘ ๐‘˜๐‘น 2FA ๐‘จ๐‘ ๐‘ฏ ๐‘ฎ๐‘ฆ๐‘’๐‘ณ๐‘๐‘ผ๐‘ฆ ๐‘’๐‘ด๐‘›๐‘Ÿ ๐‘ฟ๐‘ค ๐‘š๐‘ฐ ๐‘ค๐‘ช๐‘’๐‘‘ ๐‘ฌ๐‘‘ ๐‘ ๐‘˜๐‘น ๐‘ฉ๐‘’๐‘ฌ๐‘ฏ๐‘‘.", "missing_description_modal.cancel": "๐‘’๐‘จ๐‘ฏ๐‘•๐‘ฉ๐‘ค", "missing_description_modal.continue": "๐‘๐‘ด๐‘•๐‘‘", - "missing_description_modal.text": "๐‘ฟ ๐‘ฃ๐‘จ๐‘ ๐‘ฏ๐‘ช๐‘‘ ๐‘ง๐‘ฏ๐‘‘๐‘ผ๐‘› ๐‘ฉ ๐‘›๐‘ฆ๐‘•๐‘’๐‘ฎ๐‘ฆ๐‘๐‘–๐‘ฉ๐‘ฏ ๐‘“ ๐‘ท๐‘ค ๐‘ฉ๐‘‘๐‘จ๐‘—๐‘ฅ๐‘ฉ๐‘ฏ๐‘‘๐‘•. ๐‘’๐‘ฉ๐‘ฏ๐‘‘๐‘ฆ๐‘ฏ๐‘ฟ ๐‘ง๐‘ฏ๐‘ฆ๐‘ข๐‘ฑ?", + "missing_description_modal.description": "๐‘’๐‘ฉ๐‘ฏ๐‘‘๐‘ฆ๐‘ฏ๐‘ฟ ๐‘ง๐‘ฏ๐‘ฆ๐‘ข๐‘ฑ?", + "missing_description_modal.text": "๐‘ฟ ๐‘ฃ๐‘จ๐‘ ๐‘ฏ๐‘ช๐‘‘ ๐‘ง๐‘ฏ๐‘‘๐‘ผ๐‘› ๐‘ฉ ๐‘›๐‘ฆ๐‘•๐‘’๐‘ฎ๐‘ฆ๐‘๐‘–๐‘ฉ๐‘ฏ ๐‘“ ๐‘ท๐‘ค ๐‘ฉ๐‘‘๐‘จ๐‘—๐‘ฅ๐‘ฉ๐‘ฏ๐‘‘๐‘•.", "missing_indicator.label": "๐‘ฏ๐‘ช๐‘‘ ๐‘“๐‘ฌ๐‘ฏ๐‘›", "missing_indicator.sublabel": "๐‘ž๐‘ฆ๐‘• ๐‘ฎ๐‘ฆ๐‘Ÿ๐‘น๐‘• ๐‘’๐‘ซ๐‘› ๐‘ฏ๐‘ช๐‘‘ ๐‘š๐‘ฐ ๐‘“๐‘ฌ๐‘ฏ๐‘›", "morefollows.followers_label": "โ€ฆ๐‘ฏ {count} ๐‘ฅ๐‘น {count, plural, one {follower} other {followers}} ๐‘ช๐‘ฏ ๐‘ฎ๐‘ฆ๐‘ฅ๐‘ด๐‘‘ ๐‘•๐‘ฒ๐‘‘๐‘•.", diff --git a/app/soapbox/locales/he.json b/app/soapbox/locales/he.json index a454c56de..62c4fce07 100644 --- a/app/soapbox/locales/he.json +++ b/app/soapbox/locales/he.json @@ -598,7 +598,8 @@ "mfa.setup_warning": "ืจืฉื•ื ืืช ื”ืงื•ื“ื™ื ื”ืืœื” ืื• ืฉืžื•ืจ ืื•ืชื ื‘ืžืงื•ื ืžืื•ื‘ื˜ื— - ืื—ืจืช ืœื ืชืจืื” ืื•ืชื ืฉื•ื‘. ืื ืชืื‘ื“ ืืช ื”ื’ื™ืฉื” ืœืืคืœื™ืงืฆื™ื™ืช 2FA ื•ืœืงื•ื“ื™ ื”ืฉื—ื–ื•ืจ ืฉืœืš ืชื™ื ืขืœ ืžื—ื•ืฅ ืœื—ืฉื‘ื•ืŸ ืฉืœืš.", "missing_description_modal.cancel": "ื‘ื˜ืœ", "missing_description_modal.continue": "ืฉืœื—", - "missing_description_modal.text": "ืœื ื”ื–ื ืช ืชื™ืื•ืจ ืขื‘ื•ืจ ื›ืœ ื”ืงื‘ืฆื™ื ื”ืžืฆื•ืจืคื™ื. ื”ืžืฉืš ื‘ื›ืœ ื–ืืช?", + "missing_description_modal.description": "ื”ืžืฉืš ื‘ื›ืœ ื–ืืช?", + "missing_description_modal.text": "ืœื ื”ื–ื ืช ืชื™ืื•ืจ ืขื‘ื•ืจ ื›ืœ ื”ืงื‘ืฆื™ื ื”ืžืฆื•ืจืคื™ื.", "missing_indicator.label": "ืœื ื ืžืฆื", "missing_indicator.sublabel": "ืžืฉืื‘ ื–ื” ืœื ื ืžืฆื", "morefollows.followers_label": "ื•-{count} ืขื•ื“ {count, plural, one {ืขื•ืงื‘} other {ืขื•ืงื‘ื™ื}} ื‘ืืชืจื™ื ืžืจื•ื—ืงื™ื.", diff --git a/app/soapbox/locales/pl.json b/app/soapbox/locales/pl.json index ebb61e18e..d4feae868 100644 --- a/app/soapbox/locales/pl.json +++ b/app/soapbox/locales/pl.json @@ -640,7 +640,8 @@ "migration.submit": "Przenieล› obserwujฤ…cych", "missing_description_modal.cancel": "Anuluj", "missing_description_modal.continue": "Opublikuj", - "missing_description_modal.text": "Nie podaล‚eล›(-aล›) opisu dla wszystkich zaล‚ฤ…cznikรณw. Czy na pewno chcesz kontynuowaฤ‡?", + "missing_description_modal.description": "Czy na pewno chcesz kontynuowaฤ‡?", + "missing_description_modal.text": "Nie podaล‚eล›(-aล›) opisu dla wszystkich zaล‚ฤ…cznikรณw.", "missing_indicator.label": "Nie znaleziono", "missing_indicator.sublabel": "Nie moลผna odnaleลบฤ‡ tego zasobu", "morefollows.followers_label": "โ€ฆi {count} wiฤ™cej {count, plural, one {obserwujฤ…cy(-a)} few {obserwujฤ…cych} many {obserwujฤ…cych} other {obserwujฤ…cych}} na zdalnych stronach.", diff --git a/app/soapbox/locales/zh-CN.json b/app/soapbox/locales/zh-CN.json index 86e92a1c4..2a62dfa38 100644 --- a/app/soapbox/locales/zh-CN.json +++ b/app/soapbox/locales/zh-CN.json @@ -595,7 +595,8 @@ "mfa.setup_warning": "่ฏท็ซ‹ๅณๅฐ†ๆขๅคไปฃ็ ไฟๅญ˜ๆˆ–ๅ†™ๅˆฐ็บธไธŠ๏ผŒๅฆๅˆ™ไฝ ๅฏ่ƒฝๆ— ๆณ•็™ปๅฝ•ๅธๅทใ€‚", "missing_description_modal.cancel": "ๅ–ๆถˆ", "missing_description_modal.continue": "ๅ‘ๅธƒ", - "missing_description_modal.text": "้™„ไปถๆฒกๆœ‰ๆ่ฟฐไฟกๆฏ๏ผŒไป็„ถ็ปง็ปญๅ‘ๅธƒๅ—๏ผŸ", + "missing_description_modal.description": "ไป็„ถ็ปง็ปญๅ‘ๅธƒๅ—๏ผŸ", + "missing_description_modal.text": "้™„ไปถๆฒกๆœ‰ๆ่ฟฐไฟกๆฏใ€‚", "missing_indicator.label": "ๆ‰พไธๅˆฐๅ†…ๅฎน", "missing_indicator.sublabel": "ๆ— ๆณ•ๆ‰พๅˆฐๆญค่ต„ๆบ", "morefollows.followers_label": "ๅ’Œ{count} ๆฅ่‡ชๅ…ถไป–็ซ™็‚น็š„ {count, plural, one {ๅ…ณๆณจ่€…} other {ๅ…ณๆณจ่€…}} ใ€‚",