57328e420f779d3763c93b895c7f6a9c8926de6f
[akkoma] / priv / static / packs / flavours / glitch / async / followers.js.map
1 {"version":3,"sources":["webpack:///app/javascript/builds/pleroma/mastofe/app/javascript/flavours/glitch/features/followers/index.js"],"names":["Followers","connect","state","props","accountIds","getIn","params","accountId","hasMore","_this","column","scrollTop","e","_e$target","target","scrollHeight","clientHeight","dispatch","expandFollowers","preventDefault","prevRouterProps","_ref","location","mastodonModalOpen","c","componentWillMount","this","fetchAccount","fetchFollowers","componentWillReceiveProps","nextProps","render","_this$props","loadMore","Object","_babel_runtime_helpers_esm_jsx__WEBPACK_IMPORTED_MODULE_0__","flavours_glitch_components_load_more__WEBPACK_IMPORTED_MODULE_15__","onClick","handleLoadMore","react__WEBPACK_IMPORTED_MODULE_4___default","a","createElement","flavours_glitch_features_ui_components_column__WEBPACK_IMPORTED_MODULE_12__","ref","setRef","flavours_glitch_features_account_components_profile_column_header__WEBPACK_IMPORTED_MODULE_13__","handleHeaderClick","react_router_scroll_4__WEBPACK_IMPORTED_MODULE_10__","scrollKey","shouldUpdateScroll","className","onScroll","handleScroll","flavours_glitch_features_account_timeline_containers_header_container__WEBPACK_IMPORTED_MODULE_14__","hideTabs","map","id","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","bool"],"mappings":"sTAwBqBA,EADpBC,kBALuB,SAACC,EAAOC,GAAR,MAAmB,CACzCC,WAAYF,EAAMG,MAAM,CAAC,aAAc,YAAaF,EAAMG,OAAOC,UAAW,UAC5EC,UAAWN,EAAMG,MAAM,CAAC,aAAc,YAAaF,EAAMG,OAAOC,UAAW,mNAyBvD,WAClBE,EAAKC,OAAOC,wDAGC,SAACC,GAAM,IAAAC,EAC8BD,EAAEE,OADhCD,EACZF,YADYE,EACDE,aADCF,EACaG,cAEgBP,EAAKN,MAAMK,SAC1DC,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,OAAAC,EAAA,EAAAD,CAACmB,EAAA,EAAD,CAAiB9C,UAAWmB,KAAKvB,MAAMG,OAAOC,UAAW+C,UAAQ,IAChElD,EAAWmD,IAAI,SAAAC,GAAE,OAAItB,OAAAC,EAAA,EAAAD,CAACuB,EAAA,EAAD,CAA2BD,GAAIA,EAAIE,UAAU,GAAtBF,KAC5CvB,OAnBPC,OAAAC,EAAA,EAAAD,CAACQ,EAAA,EAAD,UACER,OAAAC,EAAA,EAAAD,CAACyB,EAAA,EAAD,SAvD6BC,+BAElB,CACjBtD,OAAQuD,IAAUC,OAAOC,WACzB9C,SAAU4C,IAAUG,KAAKD,WACzB3D,WAAY6D,IAAmBC,KAC/B1D,QAASqD,IAAUM","file":"flavours/glitch/async/followers.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 {\n fetchAccount,\n fetchFollowers,\n expandFollowers,\n} from 'flavours/glitch/actions/accounts';\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 ProfileColumnHeader from 'flavours/glitch/features/account/components/profile_column_header';\nimport HeaderContainer from 'flavours/glitch/features/account_timeline/containers/header_container';\nimport LoadMore from 'flavours/glitch/components/load_more';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\n\nconst mapStateToProps = (state, props) => ({\n accountIds: state.getIn(['user_lists', 'followers', props.params.accountId, 'items']),\n hasMore: !!state.getIn(['user_lists', 'followers', props.params.accountId, 'next']),\n});\n\n@connect(mapStateToProps)\nexport default class Followers extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.object.isRequired,\n dispatch: PropTypes.func.isRequired,\n accountIds: ImmutablePropTypes.list,\n hasMore: PropTypes.bool,\n };\n\n componentWillMount () {\n this.props.dispatch(fetchAccount(this.props.params.accountId));\n this.props.dispatch(fetchFollowers(this.props.params.accountId));\n }\n\n componentWillReceiveProps (nextProps) {\n if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) {\n this.props.dispatch(fetchAccount(nextProps.params.accountId));\n this.props.dispatch(fetchFollowers(nextProps.params.accountId));\n }\n }\n\n handleHeaderClick = () => {\n this.column.scrollTop();\n }\n\n handleScroll = (e) => {\n const { scrollTop, scrollHeight, clientHeight } = e.target;\n\n if (scrollTop === scrollHeight - clientHeight && this.props.hasMore) {\n this.props.dispatch(expandFollowers(this.props.params.accountId));\n }\n }\n\n handleLoadMore = (e) => {\n e.preventDefault();\n this.props.dispatch(expandFollowers(this.props.params.accountId));\n }\n\n shouldUpdateScroll = (prevRouterProps, { location }) => {\n if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;\n return !(location.state && location.state.mastodonModalOpen);\n }\n\n setRef = c => {\n this.column = c;\n }\n\n render () {\n const { accountIds, hasMore } = this.props;\n\n let loadMore = null;\n\n if (!accountIds) {\n return (\n <Column>\n <LoadingIndicator />\n </Column>\n );\n }\n\n if (hasMore) {\n loadMore = <LoadMore onClick={this.handleLoadMore} />;\n }\n\n return (\n <Column ref={this.setRef}>\n <ProfileColumnHeader onClick={this.handleHeaderClick} />\n\n <ScrollContainer scrollKey='followers' shouldUpdateScroll={this.shouldUpdateScroll}>\n <div className='scrollable' onScroll={this.handleScroll}>\n <div className='followers'>\n <HeaderContainer accountId={this.props.params.accountId} hideTabs />\n {accountIds.map(id => <AccountContainer key={id} id={id} withNote={false} />)}\n {loadMore}\n </div>\n </div>\n </ScrollContainer>\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""}