mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-26 18:54:11 +00:00
1 line
6.1 KiB
Plaintext
1 line
6.1 KiB
Plaintext
{"version":3,"sources":["webpack:///app/javascript/tank/sources/git/git.pleroma.social/pleroma/mastofe/app/javascript/flavours/glitch/features/followers/index.js"],"names":["Followers","connect","state","props","isAccount","getIn","params","accountId","accountIds","hasMore","column","scrollTop","e","target","scrollHeight","clientHeight","dispatch","expandFollowers","leading","c","componentWillMount","this","fetchAccount","fetchFollowers","componentWillReceiveProps","nextProps","render","multiColumn","emptyMessage","id","defaultMessage","ref","setRef","onClick","handleHeaderClick","scrollKey","onLoadMore","handleLoadMore","prepend","hideTabs","alwaysPrepend","bindToDocument","map","withNote","ImmutablePureComponent","PropTypes","object","isRequired","func","ImmutablePropTypes","list","bool"],"mappings":"gWAoBA,IAOMA,EADUC,mBANQ,SAACC,EAAOC,GAAR,MAAmB,CACzCC,YAAaF,EAAMG,MAAM,CAAC,WAAYF,EAAMG,OAAOC,YACnDC,WAAYN,EAAMG,MAAM,CAAC,aAAc,YAAaF,EAAMG,OAAOC,UAAW,UAC5EE,UAAWP,EAAMG,MAAM,CAAC,aAAc,YAAaF,EAAMG,OAAOC,UAAW,Y,oOA6BvD,WAClB,EAAKG,OAAOC,e,2CAGC,SAACC,GAAO,IAAD,EAC8BA,EAAEC,OADhC,EACZF,YADY,EACDG,aADC,EACaC,cAEgB,EAAKZ,MAAMM,SAC1D,EAAKN,MAAMa,SAASC,YAAgB,EAAKd,MAAMG,OAAOC,e,4CAIzC,KAAS,WACxB,EAAKJ,MAAMa,SAASC,YAAgB,EAAKd,MAAMG,OAAOC,cACrD,IAAK,CAAEW,SAAS,K,qCAEV,SAAAC,GACP,EAAKT,OAASS,K,6BA/BhBC,mBAAA,WACOC,KAAKlB,MAAMK,aACda,KAAKlB,MAAMa,SAASM,YAAaD,KAAKlB,MAAMG,OAAOC,YACnDc,KAAKlB,MAAMa,SAASO,YAAeF,KAAKlB,MAAMG,OAAOC,c,EAIzDiB,0BAAA,SAA2BC,GACrBA,EAAUnB,OAAOC,YAAcc,KAAKlB,MAAMG,OAAOC,WAAakB,EAAUnB,OAAOC,YACjFc,KAAKlB,MAAMa,SAASM,YAAaG,EAAUnB,OAAOC,YAClDc,KAAKlB,MAAMa,SAASO,YAAeE,EAAUnB,OAAOC,c,EAwBxDmB,OAAA,WAAW,IAAD,EACgDL,KAAKlB,MAArDK,EADA,EACAA,WAAYC,EADZ,EACYA,QAASL,EADrB,EACqBA,UAAWuB,EADhC,EACgCA,YAExC,IAAKvB,EACH,OACE,YAAC,IAAD,UACE,YAAC,IAAD,KAKN,IAAKI,EACH,OACE,YAAC,IAAD,UACE,YAAC,IAAD,KAKN,IAAMoB,EAAe,YAAC,IAAD,CAAkBC,GAAG,0BAA0BC,eAAe,kCAEnF,OACE,kBAAC,IAAD,CAAQC,IAAKV,KAAKW,QAChB,YAAC,IAAD,CAAqBC,QAASZ,KAAKa,kBAAmBP,YAAaA,IAEnE,YAAC,IAAD,CACEQ,UAAU,YACV1B,QAASA,EACT2B,WAAYf,KAAKgB,eACjBC,QAAS,YAAC,IAAD,CAAiB/B,UAAWc,KAAKlB,MAAMG,OAAOC,UAAWgC,UAAQ,IAC1EC,eAAa,EACbZ,aAAcA,EACda,gBAAiBd,QAPnB,EASGnB,EAAWkC,KAAI,SAAAb,GAAE,OAChB,YAAC,IAAD,CAA2BA,GAAIA,EAAIc,UAAU,GAAtBd,U,GAhFXe,K,0BAEH,CACjBtC,OAAQuC,IAAUC,OAAOC,WACzB/B,SAAU6B,IAAUG,KAAKD,WACzBvC,WAAYyC,IAAmBC,KAC/BzC,QAASoC,IAAUM,KACnB/C,UAAWyC,IAAUM,KACrBxB,YAAakB,IAAUM,O","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 { debounce } from 'lodash';\nimport LoadingIndicator from 'flavours/glitch/components/loading_indicator';\nimport {\n fetchAccount,\n fetchFollowers,\n expandFollowers,\n} from 'flavours/glitch/actions/accounts';\nimport { FormattedMessage } from 'react-intl';\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 ImmutablePureComponent from 'react-immutable-pure-component';\nimport MissingIndicator from 'flavours/glitch/components/missing_indicator';\nimport ScrollableList from 'flavours/glitch/components/scrollable_list';\n\nconst mapStateToProps = (state, props) => ({\n isAccount: !!state.getIn(['accounts', props.params.accountId]),\n accountIds: state.getIn(['user_lists', 'followers', props.params.accountId, 'items']),\n hasMore: !!state.getIn(['user_lists', 'followers', props.params.accountId, 'next']),\n});\n\nexport default @connect(mapStateToProps)\nclass 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 isAccount: PropTypes.bool,\n multiColumn: PropTypes.bool,\n };\n\n componentWillMount () {\n if (!this.props.accountIds) {\n this.props.dispatch(fetchAccount(this.props.params.accountId));\n this.props.dispatch(fetchFollowers(this.props.params.accountId));\n }\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 = debounce(() => {\n this.props.dispatch(expandFollowers(this.props.params.accountId));\n }, 300, { leading: true });\n\n setRef = c => {\n this.column = c;\n }\n\n render () {\n const { accountIds, hasMore, isAccount, multiColumn } = this.props;\n\n if (!isAccount) {\n return (\n <Column>\n <MissingIndicator />\n </Column>\n );\n }\n\n if (!accountIds) {\n return (\n <Column>\n <LoadingIndicator />\n </Column>\n );\n }\n\n const emptyMessage = <FormattedMessage id='account.followers.empty' defaultMessage='No one follows this user yet.' />;\n\n return (\n <Column ref={this.setRef}>\n <ProfileColumnHeader onClick={this.handleHeaderClick} multiColumn={multiColumn} />\n\n <ScrollableList\n scrollKey='followers'\n hasMore={hasMore}\n onLoadMore={this.handleLoadMore}\n prepend={<HeaderContainer accountId={this.props.params.accountId} hideTabs />}\n alwaysPrepend\n emptyMessage={emptyMessage}\n bindToDocument={!multiColumn}\n >\n {accountIds.map(id =>\n <AccountContainer key={id} id={id} withNote={false} />,\n )}\n </ScrollableList>\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""} |