diff --git a/apps/comments-ui/src/App.js b/apps/comments-ui/src/App.js index dbd5e78d72..286e47afde 100644 --- a/apps/comments-ui/src/App.js +++ b/apps/comments-ui/src/App.js @@ -23,13 +23,13 @@ function AuthFrame({adminUrl, onLoad}) { ); } -function CommentsBoxContainer({done, colorScheme, avatarSaturation}) { +function CommentsBoxContainer({done}) { if (!done) { return null; } return ( - + ); } @@ -276,6 +276,9 @@ export default class App extends React.Component { comments, pagination, postId, + colorScheme: this.props.colorScheme, + avatarSaturation: this.props.avatarSaturation, + accentColor: this.props.accentColor, dispatchAction: (_action, data) => this.dispatchAction(_action, data), /** @@ -297,7 +300,7 @@ export default class App extends React.Component { return ( - + diff --git a/apps/comments-ui/src/components/Comment.js b/apps/comments-ui/src/components/Comment.js index 85a047e043..97c8286392 100644 --- a/apps/comments-ui/src/components/Comment.js +++ b/apps/comments-ui/src/components/Comment.js @@ -21,7 +21,7 @@ const Comment = (props) => { setIsInReplyMode(current => !current); }; - const {admin} = useContext(AppContext); + const {admin, avatarSaturation} = useContext(AppContext); const comment = props.comment; const hasReplies = comment.replies && comment.replies.length > 0; const isNotPublished = comment.status !== 'published'; @@ -45,7 +45,7 @@ const Comment = (props) => {
- +

{comment.member.name}

@@ -71,12 +71,12 @@ const Comment = (props) => { leaveTo="opacity-0" >
-
+
{hasReplies &&
- +
} diff --git a/apps/comments-ui/src/components/CommentsBox.js b/apps/comments-ui/src/components/CommentsBox.js index 7f4f2e5c18..f900f1a29e 100644 --- a/apps/comments-ui/src/components/CommentsBox.js +++ b/apps/comments-ui/src/components/CommentsBox.js @@ -31,9 +31,9 @@ class CommentsBox extends React.Component { } darkMode() { - if (this.props.colorScheme === 'light') { + if (this.context.colorScheme === 'light') { return false; - } else if (this.props.colorScheme === 'dark') { + } else if (this.context.colorScheme === 'dark') { return true; } else { const containerColor = getComputedStyle(document.querySelector('#ghost-comments-root').parentNode).getPropertyValue('color'); @@ -48,7 +48,7 @@ class CommentsBox extends React.Component { } render() { - const comments = !this.context.comments ? 'Loading...' : this.context.comments.slice().reverse().map(comment => ); + const comments = !this.context.comments ? 'Loading...' : this.context.comments.slice().reverse().map(comment => ); const containerClass = this.darkMode() ? 'dark' : ''; const commentsCount = comments.length; @@ -60,7 +60,7 @@ class CommentsBox extends React.Component { {comments}
- { this.context.member ? : } + { this.context.member ? : }
); diff --git a/apps/comments-ui/src/components/Form.js b/apps/comments-ui/src/components/Form.js index 35434aa8e1..07be331400 100644 --- a/apps/comments-ui/src/components/Form.js +++ b/apps/comments-ui/src/components/Form.js @@ -6,7 +6,7 @@ import {useEditor, EditorContent} from '@tiptap/react'; import {getEditorConfig} from '../utils/editor'; const Form = (props) => { - const {member, postId, dispatchAction, onAction} = useContext(AppContext); + const {member, postId, dispatchAction, onAction, avatarSaturation} = useContext(AppContext); let config; if (props.isReply) { @@ -128,7 +128,7 @@ const Form = (props) => {
- + { return (
- {comment.replies.map((reply => ))} + {comment.replies.map((reply => ))}
); };