More code review suggestions.

This commit is contained in:
aforge
2021-09-25 20:33:26 +03:00
parent b1589a8790
commit b6abc76f3f
7 changed files with 23 additions and 39 deletions
-19
View File
@@ -393,22 +393,3 @@ export function replyFormatter(style, data, values, key) {
values = [React.createElement(LazyImage, attr, null), ' ', attr.alt];
return React.createElement(React.Fragment, {key: key}, values);
}
// Creates a "forward" icon fragment.
export function forwardedDecorator(context) {
return [<i key="fwd" className="material-icons">forward</i>];
}
// Returns a fully decorated ready for rendering representation of a drafty object.
export function formatDrafty(content, formatter, context, decorators) {
let tree = Drafty.format(content, formatter, context);
if (decorators) {
if (decorators.before) {
tree = decorators.before(context).concat(tree);
}
if (decorators.after) {
tree = tree.concat(decorators.after(context));
}
}
return tree;
}