Skip to content

Commit

Permalink
Merge pull request #3707 from coralproject/develop
Browse files Browse the repository at this point in the history
Release v6.15.1
  • Loading branch information
nick-funk authored Sep 8, 2021
2 parents 377be30 + af7a9de commit 1f068c7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coralproject/talk",
"version": "6.15.0",
"version": "6.15.1",
"author": "The Coral Project",
"homepage": "https://coralproject.net/",
"sideEffects": [
Expand Down
2 changes: 1 addition & 1 deletion src/core/client/stream/tabs/Comments/Comment/InReplyTo.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ $commentsInReplyToIconColor: var(--palette-text-100);
font-weight: var(--font-weight-secondary-bold);
font-size: var(--font-size-3);
line-height: 1;

color: $commentsInReplyToUsernameColor;
}

Expand All @@ -26,4 +25,5 @@ $commentsInReplyToIconColor: var(--palette-text-100);

.button {
display: block;
vertical-align: baseline;
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { ReplyCommentFormContainer_comment as CommentData } from "coral-stream/_
import { ReplyCommentFormContainer_settings as SettingsData } from "coral-stream/__generated__/ReplyCommentFormContainer_settings.graphql";
import { ReplyCommentFormContainer_story as StoryData } from "coral-stream/__generated__/ReplyCommentFormContainer_story.graphql";

import { useCommentSeenEnabled } from "../../commentSeen";
import {
shouldTriggerSettingsRefresh,
shouldTriggerViewerRefresh,
Expand Down Expand Up @@ -63,7 +64,8 @@ interface Props {
}

const ReplyCommentFormContainer: FunctionComponent<Props> = (props) => {
const { pym } = useCoralContext();
const { pym, renderWindow } = useCoralContext();
const commentSeenEnabled = useCommentSeenEnabled();

const [nudge, setNudge] = useState(true);
const [initialized, setInitialized] = useState(false);
Expand Down Expand Up @@ -222,9 +224,18 @@ const ReplyCommentFormContainer: FunctionComponent<Props> = (props) => {

const elementID = computeCommentElementID(commentID);
setTimeout(() => {
pym.scrollParentToChildEl(elementID);
const elem = renderWindow.document.getElementById(elementID);
if (elem) {
const offset =
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
elem.getBoundingClientRect().top +
renderWindow.pageYOffset -
(commentSeenEnabled ? 150 : 0);
pym.scrollParentToChildPos(offset);
elem.focus();
}
}, 300);
}, [jumpToCommentID, props, pym]);
}, [commentSeenEnabled, jumpToCommentID, props, pym, renderWindow]);

if (!initialized) {
return null;
Expand Down

0 comments on commit 1f068c7

Please sign in to comment.