diff options
author | Renaud Chaput <renchap@gmail.com> | 2023-02-25 14:34:32 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2023-02-25 14:35:31 +0100 |
commit | 81ef21a0c802f1d905f37a2a818544a8b400793c (patch) | |
tree | 33043286868ca9efb627ed38accab03c756adbcb /app/javascript/flavours/glitch/features/list_editor/components/account.js | |
parent | 859eb01aacc27fa01a8d4063f26a5a1f81e5d3a9 (diff) |
[Glitch] Rename JSX files with proper `.jsx` extension
Port 44a7d87cb1f5df953b6c14c16c59e2e4ead1bcb9 to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/list_editor/components/account.js')
-rw-r--r-- | app/javascript/flavours/glitch/features/list_editor/components/account.js | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/app/javascript/flavours/glitch/features/list_editor/components/account.js b/app/javascript/flavours/glitch/features/list_editor/components/account.js deleted file mode 100644 index 71a8b7673..000000000 --- a/app/javascript/flavours/glitch/features/list_editor/components/account.js +++ /dev/null @@ -1,56 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import Avatar from 'flavours/glitch/components/avatar'; -import DisplayName from 'flavours/glitch/components/display_name'; -import IconButton from 'flavours/glitch/components/icon_button'; -import { defineMessages } from 'react-intl'; - -const messages = defineMessages({ - remove: { id: 'lists.account.remove', defaultMessage: 'Remove from list' }, - add: { id: 'lists.account.add', defaultMessage: 'Add to list' }, -}); - -export default class Account extends ImmutablePureComponent { - - static propTypes = { - account: ImmutablePropTypes.map.isRequired, - intl: PropTypes.object.isRequired, - onRemove: PropTypes.func.isRequired, - onAdd: PropTypes.func.isRequired, - added: PropTypes.bool, - }; - - static defaultProps = { - added: false, - }; - - render () { - const { account, intl, onRemove, onAdd, added } = this.props; - - let button; - - if (added) { - button = <IconButton icon='times' title={intl.formatMessage(messages.remove)} onClick={onRemove} />; - } else { - button = <IconButton icon='plus' title={intl.formatMessage(messages.add)} onClick={onAdd} />; - } - - return ( - <div className='account'> - <div className='account__wrapper'> - <div className='account__display-name'> - <div className='account__avatar-wrapper'><Avatar account={account} size={36} /></div> - <DisplayName account={account} /> - </div> - - <div className='account__relationship'> - {button} - </div> - </div> - </div> - ); - } - -} |