2020-01-22 15:00:23 +00:00
|
|
|
{"version":3,"sources":["webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/favourites/index.js"],"names":["messages","defineMessages","heading","Favourites","connect","state","props","accountIds","getIn","params","statusId","injectIntl","column","scrollTop","c","componentWillMount","this","dispatch","fetchFavourites","componentWillReceiveProps","nextProps","render","intl","emptyMessage","id","defaultMessage","ref","setRef","icon","title","formatMessage","onClick","handleHeaderClick","showBackButton","scrollKey","map","withNote","ImmutablePureComponent","PropTypes","object","isRequired","func","ImmutablePropTypes","list"],"mappings":"2SAaMA,EAAWC,YAAe,CAC9BC,QAAQ,CAAD,4DASHC,EAFUC,kBAJQ,SAACC,EAAOC,GAAR,MAAmB,CACzCC,WAAYF,EAAMG,MAAM,CAAC,aAAc,gBAAiBF,EAAMG,OAAOC,a,GAItEC,a,sMAsBqB,WAClB,EAAKC,OAAOC,c,oCAGL,SAAAC,GACP,EAAKF,OAASE,I,8CAjBhBC,mBAAA,WACOC,KAAKV,MAAMC,YACdS,KAAKV,MAAMW,SAASC,YAAgBF,KAAKV,MAAMG,OAAOC,Y,EAI1DS,0BAAA,SAA2BC,GACrBA,EAAUX,OAAOC,WAAaM,KAAKV,MAAMG,OAAOC,UAAYU,EAAUX,OAAOC,UAC/EM,KAAKV,MAAMW,SAASC,YAAgBE,EAAUX,OAAOC,Y,EAYzDW,OAAA,WAAW,IAAD,EACqBL,KAAKV,MAA1BgB,EADA,EACAA,KAAMf,EADN,EACMA,WAEd,IAAKA,EACH,OACE,YAAC,IAAD,UACE,YAAC,IAAD,KAKN,IAAMgB,EAAe,YAAC,IAAD,CAAkBC,GAAG,0BAA0BC,eAAe,oFAEnF,OACE,kBAAC,IAAD,CAAQC,IAAKV,KAAKW,QAChB,YAAC,IAAD,CACEC,KAAK,OACLC,MAAOP,EAAKQ,cAAc9B,EAASE,SACnC6B,QAASf,KAAKgB,kBACdC,gBAAc,IAEhB,YAAC,IAAD,CACEC,UAAU,aACVX,aAAcA,QAFhB,EAIGhB,EAAW4B,IAAI,SAAAX,GAAE,OAChB,YAAC,IAAD,CAA2BA,GAAIA,EAAIY,UAAU,GAAtBZ,Q,GAvDVa,K,0BAEJ,CACjB5B,OAAQ6B,IAAUC,OAAOC,WACzBvB,SAAUqB,IAAUG,KAAKD,WACzBjC,WAAYmC,IAAmBC,KAC/BrB,KAAMgB,IAAUC,OAAOC,a","file":"flavours/glitch/async/favourites.js","sourcesContent":["import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport LoadingIndicator from 'flavours/glitch/components/loading_indicator';\nimport { fetchFavourites } from 'flavours/glitch/actions/interactions';\nimport AccountContainer from 'flavours/glitch/containers/account_container';\nimport Column from 'flavours/glitch/features/ui/components/column';\nimport ColumnHeader from 'flavours/glitch/components/column_header';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ScrollableList from '../../components/scrollable_list';\n\nconst messages = defineMessages({\n heading: { id: 'column.favourited_by', defaultMessage: 'Favourited by' },\n});\n\nconst mapStateToProps = (state, props) => ({\n accountIds: state.getIn(['user_lists', 'favourited_by', props.params.statusId]),\n});\n\nexport default @connect(mapStateToProps)\n@injectIntl\nclass Favourites extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.object.isRequired,\n dispatch: PropTypes.func.isRequired,\n accountIds: ImmutablePropTypes.list,\n intl: PropTypes.object.isRequired,\n };\n\n componentWillMount () {\n if (!this.props.accountIds) {\n this.props.dispatch(fetchFavourites(this.props.params.statusId));\n }\n }\n\n componentWillReceiveProps (nextProps) {\n if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {\n this.props.dispatch(fetchFavourites(nextProps.params.statusId));\n }\n }\n\n handleHeaderClick = () => {\n this.column.scrollTop();\n }\n\n setRef = c => {\n this.column = c;\n }\n\n render () {\n const { intl, accountIds } = this.props;\n\n if (!accountIds) {\n return (\n <Column>\n <LoadingIndicator />\n </Column>\n );\n }\n\n const emptyMessage = <FormattedMessage id='empty_column.favourites' defaultMessage='No one has favourited this toot yet. When someone does, they will show up here.' />;\n\n return (\n <Column ref={this.setRef}>\n <ColumnHeader\n icon='star'\n title={intl.formatMessage(messages.heading)}\n onClick={this.handleHeaderClick}\n
|