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 --- .../flavours/glitch/components/account.js | 186 --------------------- 1 file changed, 186 deletions(-) delete mode 100644 app/javascript/flavours/glitch/components/account.js (limited to 'app/javascript/flavours/glitch/components/account.js') diff --git a/app/javascript/flavours/glitch/components/account.js b/app/javascript/flavours/glitch/components/account.js deleted file mode 100644 index 7ce4b65aa..000000000 --- a/app/javascript/flavours/glitch/components/account.js +++ /dev/null @@ -1,186 +0,0 @@ -import React, { Fragment } from 'react'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import PropTypes from 'prop-types'; -import Avatar from './avatar'; -import DisplayName from './display_name'; -import Permalink from './permalink'; -import IconButton from './icon_button'; -import { defineMessages, injectIntl } from 'react-intl'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { me } from 'flavours/glitch/initial_state'; -import RelativeTimestamp from './relative_timestamp'; -import Skeleton from 'flavours/glitch/components/skeleton'; - -const messages = defineMessages({ - follow: { id: 'account.follow', defaultMessage: 'Follow' }, - unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, - requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' }, - unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' }, - unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' }, - mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' }, - unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'Unmute notifications from @{name}' }, - mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' }, - block: { id: 'account.block', defaultMessage: 'Block @{name}' }, -}); - -export default @injectIntl -class Account extends ImmutablePureComponent { - - static propTypes = { - size: PropTypes.number, - account: ImmutablePropTypes.map, - onFollow: PropTypes.func.isRequired, - onBlock: PropTypes.func.isRequired, - onMute: PropTypes.func.isRequired, - onMuteNotifications: PropTypes.func.isRequired, - intl: PropTypes.object.isRequired, - hidden: PropTypes.bool, - small: PropTypes.bool, - actionIcon: PropTypes.string, - actionTitle: PropTypes.string, - defaultAction: PropTypes.string, - onActionClick: PropTypes.func, - }; - - static defaultProps = { - size: 36, - }; - - handleFollow = () => { - this.props.onFollow(this.props.account); - }; - - handleBlock = () => { - this.props.onBlock(this.props.account); - }; - - handleMute = () => { - this.props.onMute(this.props.account); - }; - - handleMuteNotifications = () => { - this.props.onMuteNotifications(this.props.account, true); - }; - - handleUnmuteNotifications = () => { - this.props.onMuteNotifications(this.props.account, false); - }; - - handleAction = () => { - this.props.onActionClick(this.props.account); - }; - - render () { - const { - account, - hidden, - intl, - small, - onActionClick, - actionIcon, - actionTitle, - defaultAction, - size, - } = this.props; - - if (!account) { - return ( -
-
-
-
- -
-
-
- ); - } - - if (hidden) { - return ( - - {account.get('display_name')} - {account.get('username')} - - ); - } - - let buttons; - - if (onActionClick) { - if (actionIcon) { - buttons = ; - } - } else if (account.get('id') !== me && !small && account.get('relationship', null) !== null) { - const following = account.getIn(['relationship', 'following']); - const requested = account.getIn(['relationship', 'requested']); - const blocking = account.getIn(['relationship', 'blocking']); - const muting = account.getIn(['relationship', 'muting']); - - if (requested) { - buttons = ; - } else if (blocking) { - buttons = ; - } else if (muting) { - let hidingNotificationsButton; - if (account.getIn(['relationship', 'muting_notifications'])) { - hidingNotificationsButton = ; - } else { - hidingNotificationsButton = ; - } - buttons = ( - - - {hidingNotificationsButton} - - ); - } else if (defaultAction === 'mute') { - buttons = ; - } else if (defaultAction === 'block') { - buttons = ; - } else if (!account.get('moved') || following) { - buttons = ; - } - } - - let mute_expires_at; - if (account.get('mute_expires_at')) { - mute_expires_at =
; - } - - return small ? ( - -
- -
- -
- ) : ( -
-
- -
- {mute_expires_at} - -
- {buttons ? -
- {buttons} -
- : null} -
-
- ); - } - -} -- cgit