From 45c44989c8fb6e24badd18bb83ac5f68de0aceaf Mon Sep 17 00:00:00 2001 From: kibigo! Date: Fri, 17 Nov 2017 19:11:18 -0800 Subject: Forking glitch theme --- app/javascript/glitch/components/status/header.js | 146 ---------------------- 1 file changed, 146 deletions(-) delete mode 100644 app/javascript/glitch/components/status/header.js (limited to 'app/javascript/glitch/components/status/header.js') diff --git a/app/javascript/glitch/components/status/header.js b/app/javascript/glitch/components/status/header.js deleted file mode 100644 index f741950b1..000000000 --- a/app/javascript/glitch/components/status/header.js +++ /dev/null @@ -1,146 +0,0 @@ -/* - -`` -================ - -Originally a part of ``, but extracted into a separate -component for better documentation and maintainance by -@kibi@glitch.social as a part of glitch-soc/mastodon. - -*/ - -// * * * * * * * // - -// Imports -// ------- - -// Package imports. -import React from 'react'; -import PropTypes from 'prop-types'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import { defineMessages, injectIntl } from 'react-intl'; - -// Mastodon imports. -import Avatar from '../../../mastodon/components/avatar'; -import AvatarOverlay from '../../../mastodon/components/avatar_overlay'; -import DisplayName from '../../../mastodon/components/display_name'; -import IconButton from '../../../mastodon/components/icon_button'; -import VisibilityIcon from './visibility_icon'; - -// * * * * * * * // - -// Initial setup -// ------------- - -// Messages for use with internationalization stuff. -const messages = defineMessages({ - collapse: { id: 'status.collapse', defaultMessage: 'Collapse' }, - uncollapse: { id: 'status.uncollapse', defaultMessage: 'Uncollapse' }, - public: { id: 'privacy.public.short', defaultMessage: 'Public' }, - unlisted: { id: 'privacy.unlisted.short', defaultMessage: 'Unlisted' }, - private: { id: 'privacy.private.short', defaultMessage: 'Followers-only' }, - direct: { id: 'privacy.direct.short', defaultMessage: 'Direct' }, -}); - -// * * * * * * * // - -// The component -// ------------- - -@injectIntl -export default class StatusHeader extends React.PureComponent { - - static propTypes = { - status: ImmutablePropTypes.map.isRequired, - friend: ImmutablePropTypes.map, - mediaIcon: PropTypes.string, - collapsible: PropTypes.bool, - collapsed: PropTypes.bool, - parseClick: PropTypes.func.isRequired, - setExpansion: PropTypes.func.isRequired, - intl: PropTypes.object.isRequired, - }; - - // Handles clicks on collapsed button - handleCollapsedClick = (e) => { - const { collapsed, setExpansion } = this.props; - if (e.button === 0) { - setExpansion(collapsed ? null : false); - e.preventDefault(); - } - } - - // Handles clicks on account name/image - handleAccountClick = (e) => { - const { status, parseClick } = this.props; - parseClick(e, `/accounts/${+status.getIn(['account', 'id'])}`); - } - - // Rendering. - render () { - const { - status, - friend, - mediaIcon, - collapsible, - collapsed, - intl, - } = this.props; - - const account = status.get('account'); - - return ( -
- - { - friend ? ( - - ) : ( - - ) - } - - - - -
- {mediaIcon ? ( -