mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-11 10:33:09 +00:00
1 line
5.1 KiB
Plaintext
1 line
5.1 KiB
Plaintext
{"version":3,"sources":["webpack:///app/javascript/builds/pleroma/mastofe/app/javascript/flavours/glitch/features/favourites/index.js"],"names":["messages","defineMessages","heading","id","defaultMessage","Favourites","connect","state","props","accountIds","getIn","params","statusId","injectIntl","prevRouterProps","_ref","location","mastodonModalOpen","_this","column","scrollTop","c","componentWillMount","this","dispatch","fetchFavourites","componentWillReceiveProps","nextProps","render","_this$props","intl","react__WEBPACK_IMPORTED_MODULE_4___default","a","createElement","flavours_glitch_features_ui_components_column__WEBPACK_IMPORTED_MODULE_12__","ref","setRef","Object","_babel_runtime_helpers_esm_jsx__WEBPACK_IMPORTED_MODULE_0__","flavours_glitch_components_column_header__WEBPACK_IMPORTED_MODULE_13__","icon","title","formatMessage","onClick","handleHeaderClick","showBackButton","react_router_scroll_4__WEBPACK_IMPORTED_MODULE_10__","scrollKey","shouldUpdateScroll","className","map","flavours_glitch_containers_account_container__WEBPACK_IMPORTED_MODULE_11__","withNote","flavours_glitch_components_loading_indicator__WEBPACK_IMPORTED_MODULE_8__","ImmutablePureComponent","PropTypes","object","isRequired","func","ImmutablePropTypes","list"],"mappings":"2SAaMA,EAAWC,YAAe,CAC9BC,QAAO,CAAAC,GAAA,uBAAAC,eAAA,mBASYC,EAFpBC,kBAJuB,SAACC,EAAOC,GAAR,MAAmB,CACzCC,WAAYF,EAAMG,MAAM,CAAC,aAAc,gBAAiBF,EAAMG,OAAOC,gBAItEC,oNAoBsB,SAACC,EAADC,GAAmC,IAAfC,EAAeD,EAAfC,SACvC,UAAOF,GAAmB,IAAIE,UAAY,IAAIT,OAAS,IAAIU,qBAClDD,EAAST,OAASS,EAAST,MAAMU,oEAGxB,WAClBC,EAAKC,OAAOC,kDAGL,SAAAC,GACPH,EAAKC,OAASE,kDApBhBC,mBAAA,WACEC,KAAKf,MAAMgB,SAASC,YAAgBF,KAAKf,MAAMG,OAAOC,cAGxDc,0BAAA,SAA2BC,GACrBA,EAAUhB,OAAOC,WAAaW,KAAKf,MAAMG,OAAOC,UAAYe,EAAUhB,OAAOC,UAC/EW,KAAKf,MAAMgB,SAASC,YAAgBE,EAAUhB,OAAOC,cAiBzDgB,OAAA,WAAU,IAAAC,EACqBN,KAAKf,MAA1BsB,EADAD,EACAC,KAAMrB,EADNoB,EACMpB,WAEd,OAAKA,EASHsB,EAAAC,EAAAC,cAACC,EAAA,EAAD,CAAQC,IAAKZ,KAAKa,QAChBC,OAAAC,EAAA,EAAAD,CAACE,EAAA,EAAD,CACEC,KAAK,OACLC,MAAOX,EAAKY,cAAc1C,EAASE,SACnCyC,QAASpB,KAAKqB,kBACdC,gBAAc,IAGhBR,OAAAC,EAAA,EAAAD,CAACS,EAAA,EAAD,CAAiBC,UAAU,aAAaC,mBAAoBzB,KAAKyB,yBAAjE,EACEX,OAAAC,EAAA,EAAAD,CAAA,OAAKY,UAAU,mBAAf,EACGxC,EAAWyC,IAAI,SAAA/C,GAAE,OAAIkC,OAAAC,EAAA,EAAAD,CAACc,EAAA,EAAD,CAA2BhD,GAAIA,EAAIiD,UAAU,GAAtBjD,QAjBjDkC,OAAAC,EAAA,EAAAD,CAACH,EAAA,EAAD,UACEG,OAAAC,EAAA,EAAAD,CAACgB,EAAA,EAAD,SAtC8BC,+BAEnB,CACjB3C,OAAQ4C,IAAUC,OAAOC,WACzBjC,SAAU+B,IAAUG,KAAKD,WACzBhD,WAAYkD,IAAmBC,KAC/B9B,KAAMyB,IAAUC,OAAOC","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 { ScrollContainer } from 'react-router-scroll-4';\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 } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\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\n@connect(mapStateToProps)\n@injectIntl\nexport default class 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 this.props.dispatch(fetchFavourites(this.props.params.statusId));\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 shouldUpdateScroll = (prevRouterProps, { location }) => {\n if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;\n return !(location.state && location.state.mastodonModalOpen);\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 return (\n <Column ref={this.setRef}>\n <ColumnHeader\n icon='star'\n title={intl.formatMessage(messages.heading)}\n onClick={this.handleHeaderClick}\n showBackButton\n />\n\n <ScrollContainer scrollKey='favourites' shouldUpdateScroll={this.shouldUpdateScroll}>\n <div className='scrollable'>\n {accountIds.map(id => <AccountContainer key={id} id={id} withNote={false} />)}\n </div>\n </ScrollContainer>\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""} |