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/notifications/components/filter_bar.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/notifications/components/filter_bar.js')
-rw-r--r-- | app/javascript/flavours/glitch/features/notifications/components/filter_bar.js | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.js b/app/javascript/flavours/glitch/features/notifications/components/filter_bar.js deleted file mode 100644 index c1de0f90e..000000000 --- a/app/javascript/flavours/glitch/features/notifications/components/filter_bar.js +++ /dev/null @@ -1,110 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; -import Icon from 'flavours/glitch/components/icon'; - -const tooltips = defineMessages({ - mentions: { id: 'notifications.filter.mentions', defaultMessage: 'Mentions' }, - favourites: { id: 'notifications.filter.favourites', defaultMessage: 'Favourites' }, - boosts: { id: 'notifications.filter.boosts', defaultMessage: 'Boosts' }, - polls: { id: 'notifications.filter.polls', defaultMessage: 'Poll results' }, - follows: { id: 'notifications.filter.follows', defaultMessage: 'Follows' }, - statuses: { id: 'notifications.filter.statuses', defaultMessage: 'Updates from people you follow' }, -}); - -export default @injectIntl -class FilterBar extends React.PureComponent { - - static propTypes = { - selectFilter: PropTypes.func.isRequired, - selectedFilter: PropTypes.string.isRequired, - advancedMode: PropTypes.bool.isRequired, - intl: PropTypes.object.isRequired, - }; - - onClick (notificationType) { - return () => this.props.selectFilter(notificationType); - } - - render () { - const { selectedFilter, advancedMode, intl } = this.props; - const renderedElement = !advancedMode ? ( - <div className='notification__filter-bar'> - <button - className={selectedFilter === 'all' ? 'active' : ''} - onClick={this.onClick('all')} - > - <FormattedMessage - id='notifications.filter.all' - defaultMessage='All' - /> - </button> - <button - className={selectedFilter === 'mention' ? 'active' : ''} - onClick={this.onClick('mention')} - > - <FormattedMessage - id='notifications.filter.mentions' - defaultMessage='Mentions' - /> - </button> - </div> - ) : ( - <div className='notification__filter-bar'> - <button - className={selectedFilter === 'all' ? 'active' : ''} - onClick={this.onClick('all')} - > - <FormattedMessage - id='notifications.filter.all' - defaultMessage='All' - /> - </button> - <button - className={selectedFilter === 'mention' ? 'active' : ''} - onClick={this.onClick('mention')} - title={intl.formatMessage(tooltips.mentions)} - > - <Icon id='reply-all' fixedWidth /> - </button> - <button - className={selectedFilter === 'favourite' ? 'active' : ''} - onClick={this.onClick('favourite')} - title={intl.formatMessage(tooltips.favourites)} - > - <Icon id='star' fixedWidth /> - </button> - <button - className={selectedFilter === 'reblog' ? 'active' : ''} - onClick={this.onClick('reblog')} - title={intl.formatMessage(tooltips.boosts)} - > - <Icon id='retweet' fixedWidth /> - </button> - <button - className={selectedFilter === 'poll' ? 'active' : ''} - onClick={this.onClick('poll')} - title={intl.formatMessage(tooltips.polls)} - > - <Icon id='tasks' fixedWidth /> - </button> - <button - className={selectedFilter === 'status' ? 'active' : ''} - onClick={this.onClick('status')} - title={intl.formatMessage(tooltips.statuses)} - > - <Icon id='home' fixedWidth /> - </button> - <button - className={selectedFilter === 'follow' ? 'active' : ''} - onClick={this.onClick('follow')} - title={intl.formatMessage(tooltips.follows)} - > - <Icon id='user-plus' fixedWidth /> - </button> - </div> - ); - return renderedElement; - } - -} |