From 81ef21a0c802f1d905f37a2a818544a8b400793c Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Sat, 25 Feb 2023 14:34:32 +0100 Subject: [Glitch] Rename JSX files with proper `.jsx` extension Port 44a7d87cb1f5df953b6c14c16c59e2e4ead1bcb9 to glitch-soc Signed-off-by: Claire --- .../glitch/features/report/components/option.js | 60 ---------------------- .../glitch/features/report/components/option.jsx | 60 ++++++++++++++++++++++ .../features/report/components/status_check_box.js | 60 ---------------------- .../report/components/status_check_box.jsx | 60 ++++++++++++++++++++++ 4 files changed, 120 insertions(+), 120 deletions(-) delete mode 100644 app/javascript/flavours/glitch/features/report/components/option.js create mode 100644 app/javascript/flavours/glitch/features/report/components/option.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/components/status_check_box.js create mode 100644 app/javascript/flavours/glitch/features/report/components/status_check_box.jsx (limited to 'app/javascript/flavours/glitch/features/report/components') diff --git a/app/javascript/flavours/glitch/features/report/components/option.js b/app/javascript/flavours/glitch/features/report/components/option.js deleted file mode 100644 index 6ecfc7a24..000000000 --- a/app/javascript/flavours/glitch/features/report/components/option.js +++ /dev/null @@ -1,60 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import classNames from 'classnames'; -import Check from 'flavours/glitch/components/check'; - -export default class Option extends React.PureComponent { - - static propTypes = { - name: PropTypes.string.isRequired, - value: PropTypes.string.isRequired, - checked: PropTypes.bool, - label: PropTypes.node, - description: PropTypes.node, - onToggle: PropTypes.func, - multiple: PropTypes.bool, - labelComponent: PropTypes.node, - }; - - handleKeyPress = e => { - const { value, checked, onToggle } = this.props; - - if (e.key === 'Enter' || e.key === ' ') { - e.stopPropagation(); - e.preventDefault(); - onToggle(value, !checked); - } - }; - - handleChange = e => { - const { value, onToggle } = this.props; - onToggle(value, e.target.checked); - }; - - render () { - const { name, value, checked, label, labelComponent, description, multiple } = this.props; - - return ( - - ); - } - -} diff --git a/app/javascript/flavours/glitch/features/report/components/option.jsx b/app/javascript/flavours/glitch/features/report/components/option.jsx new file mode 100644 index 000000000..6ecfc7a24 --- /dev/null +++ b/app/javascript/flavours/glitch/features/report/components/option.jsx @@ -0,0 +1,60 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import classNames from 'classnames'; +import Check from 'flavours/glitch/components/check'; + +export default class Option extends React.PureComponent { + + static propTypes = { + name: PropTypes.string.isRequired, + value: PropTypes.string.isRequired, + checked: PropTypes.bool, + label: PropTypes.node, + description: PropTypes.node, + onToggle: PropTypes.func, + multiple: PropTypes.bool, + labelComponent: PropTypes.node, + }; + + handleKeyPress = e => { + const { value, checked, onToggle } = this.props; + + if (e.key === 'Enter' || e.key === ' ') { + e.stopPropagation(); + e.preventDefault(); + onToggle(value, !checked); + } + }; + + handleChange = e => { + const { value, onToggle } = this.props; + onToggle(value, e.target.checked); + }; + + render () { + const { name, value, checked, label, labelComponent, description, multiple } = this.props; + + return ( + + ); + } + +} diff --git a/app/javascript/flavours/glitch/features/report/components/status_check_box.js b/app/javascript/flavours/glitch/features/report/components/status_check_box.js deleted file mode 100644 index 2231fc0ce..000000000 --- a/app/javascript/flavours/glitch/features/report/components/status_check_box.js +++ /dev/null @@ -1,60 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import StatusContent from 'flavours/glitch/components/status_content'; -import Avatar from 'flavours/glitch/components/avatar'; -import DisplayName from 'flavours/glitch/components/display_name'; -import RelativeTimestamp from 'flavours/glitch/components/relative_timestamp'; -import Option from './option'; -import MediaAttachments from 'flavours/glitch/components/media_attachments'; -import VisibilityIcon from 'flavours/glitch/components/status_visibility_icon'; - -export default class StatusCheckBox extends React.PureComponent { - - static propTypes = { - id: PropTypes.string.isRequired, - status: ImmutablePropTypes.map.isRequired, - checked: PropTypes.bool, - onToggle: PropTypes.func.isRequired, - }; - - handleStatusesToggle = (value, checked) => { - const { onToggle } = this.props; - onToggle(value, checked); - }; - - render () { - const { status, checked } = this.props; - - if (status.get('reblog')) { - return null; - } - - const labelComponent = ( -
-
-
- -
- -
·
-
- - } /> -
- ); - - return ( -