diff --git a/app/javascript/mastodon/features/compose/index.js b/app/javascript/mastodon/features/compose/index.js index 3ae236048..c90578ccf 100644 --- a/app/javascript/mastodon/features/compose/index.js +++ b/app/javascript/mastodon/features/compose/index.js @@ -18,6 +18,9 @@ import { mascot, treeRoot } from '../../initial_state'; import Icon from 'mastodon/components/icon'; import { logOut } from 'mastodon/utils/log_out'; +import { pinnedInfo } from '../../initial_state'; +import ReactHtmlParser, { processNodes, convertNodeToElement, htmlparser2 } from 'react-html-parser'; + const messages = defineMessages({ start: { id: 'getting_started.heading', defaultMessage: 'Getting started' }, home_timeline: { id: 'tabs_bar.home', defaultMessage: 'Home' }, @@ -50,6 +53,10 @@ class Compose extends React.PureComponent { intl: PropTypes.object.isRequired, }; + state = { + showPinned: true, + } + componentDidMount () { const { isSearchPage } = this.props; @@ -88,9 +95,14 @@ class Compose extends React.PureComponent { onBlur = () => { this.props.dispatch(changeComposing(false)); } + + handleClear = () => { + this.setState({ showPinned: false}); + } render () { const { multiColumn, showSearch, isSearchPage, intl } = this.props; + const { showPinned } = this.state; let header = ''; @@ -126,6 +138,15 @@ class Compose extends React.PureComponent { {(multiColumn || isSearchPage) && } + { pinnedInfo && showPinned && +
+ {ReactHtmlParser(pinnedInfo)} +
+ +
+
+ } +
{!isSearchPage &&
diff --git a/app/javascript/styles/closed-social/global.scss b/app/javascript/styles/closed-social/global.scss index de45f9c39..2290d9461 100644 --- a/app/javascript/styles/closed-social/global.scss +++ b/app/javascript/styles/closed-social/global.scss @@ -3,6 +3,7 @@ } .pinned-info { + position: relative; opacity: 0.85; font-size: 15px; padding: 10px 20px;