1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 07:57:46 +02:00

Rename post preview component again

I want to reuse it for the reply placeholder as well, and that will
require injecting a composer state instance, so this naming seems to
make more sense.
This commit is contained in:
Franz Liedke
2020-09-11 17:06:27 +02:00
parent 691ae85e50
commit 0f99e7c015
3 changed files with 6 additions and 6 deletions

View File

@@ -61,7 +61,7 @@ import NotificationList from './components/NotificationList';
import WelcomeHero from './components/WelcomeHero'; import WelcomeHero from './components/WelcomeHero';
import SignUpModal from './components/SignUpModal'; import SignUpModal from './components/SignUpModal';
import CommentPost from './components/CommentPost'; import CommentPost from './components/CommentPost';
import TextFormatterPreview from './components/TextFormatterPreview'; import ComposerPostPreview from './components/ComposerPostPreview';
import ReplyComposer from './components/ReplyComposer'; import ReplyComposer from './components/ReplyComposer';
import NotificationsPage from './components/NotificationsPage'; import NotificationsPage from './components/NotificationsPage';
import PostStreamScrubber from './components/PostStreamScrubber'; import PostStreamScrubber from './components/PostStreamScrubber';
@@ -136,7 +136,7 @@ export default Object.assign(compat, {
'components/WelcomeHero': WelcomeHero, 'components/WelcomeHero': WelcomeHero,
'components/SignUpModal': SignUpModal, 'components/SignUpModal': SignUpModal,
'components/CommentPost': CommentPost, 'components/CommentPost': CommentPost,
'components/TextFormatterPreview': TextFormatterPreview, 'components/ComposerPostPreview': ComposerPostPreview,
'components/ReplyComposer': ReplyComposer, 'components/ReplyComposer': ReplyComposer,
'components/NotificationsPage': NotificationsPage, 'components/NotificationsPage': NotificationsPage,
'components/PostStreamScrubber': PostStreamScrubber, 'components/PostStreamScrubber': PostStreamScrubber,

View File

@@ -7,7 +7,7 @@ import EditPostComposer from './EditPostComposer';
import ItemList from '../../common/utils/ItemList'; import ItemList from '../../common/utils/ItemList';
import listItems from '../../common/helpers/listItems'; import listItems from '../../common/helpers/listItems';
import Button from '../../common/components/Button'; import Button from '../../common/components/Button';
import TextFormatterPreview from './TextFormatterPreview'; import ComposerPostPreview from './ComposerPostPreview';
/** /**
* The `CommentPost` component displays a standard `comment`-typed post. This * The `CommentPost` component displays a standard `comment`-typed post. This
@@ -51,7 +51,7 @@ export default class CommentPost extends Post {
<ul>{listItems(this.headerItems().toArray())}</ul> <ul>{listItems(this.headerItems().toArray())}</ul>
</header>, </header>,
<div className="Post-body"> <div className="Post-body">
{this.isEditing() ? <TextFormatterPreview content={() => app.composer.fields.content()} /> : m.trust(this.attrs.post.contentHtml())} {this.isEditing() ? <ComposerPostPreview content={() => app.composer.fields.content()} /> : m.trust(this.attrs.post.contentHtml())}
</div>, </div>,
]); ]);
} }

View File

@@ -3,7 +3,7 @@
import Component from '../../common/Component'; import Component from '../../common/Component';
/** /**
* The `TextFormatterPreview` component renders Markdown as HTML using the * The `ComposerPostPreview` component renders Markdown as HTML using the
* TextFormatter library, polling a data source for changes every 50ms. This is * TextFormatter library, polling a data source for changes every 50ms. This is
* done to prevent expensive redraws on e.g. every single keystroke, while * done to prevent expensive redraws on e.g. every single keystroke, while
* still retaining the perception of live updates for the user. * still retaining the perception of live updates for the user.
@@ -12,7 +12,7 @@ import Component from '../../common/Component';
* *
* - `content` A callback that retrieves the latest content that should be rendered. * - `content` A callback that retrieves the latest content that should be rendered.
*/ */
export default class TextFormatterPreview extends Component { export default class ComposerPostPreview extends Component {
view() { view() {
return <div className="Post-preview" />; return <div className="Post-preview" />;
} }