From f0b35993c9091cd252eee0dc77fdd4c006ef3c43 Mon Sep 17 00:00:00 2001 From: Sinclair Chen Date: Fri, 7 Oct 2022 10:56:27 -0700 Subject: [PATCH 1/3] fix hydration error (button inside button) --- web/components/nav/more-button.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/components/nav/more-button.tsx b/web/components/nav/more-button.tsx index 9847541c..7f3317e1 100644 --- a/web/components/nav/more-button.tsx +++ b/web/components/nav/more-button.tsx @@ -11,13 +11,13 @@ function SidebarButton(props: { }) { const { text, children } = props return ( - + ) } From b57ff68654a83f076b7c41707dab8f3834dc94ea Mon Sep 17 00:00:00 2001 From: James Grugett Date: Fri, 7 Oct 2022 14:40:38 -0500 Subject: [PATCH 2/3] Fix highlight & scroll to comment --- web/components/feed/feed-comments.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/web/components/feed/feed-comments.tsx b/web/components/feed/feed-comments.tsx index 7111e88f..0cc7012d 100644 --- a/web/components/feed/feed-comments.tsx +++ b/web/components/feed/feed-comments.tsx @@ -109,12 +109,18 @@ export const FeedComment = memo(function FeedComment(props: { } const totalAwarded = bountiesAwarded ?? 0 - const router = useRouter() - const highlighted = router.asPath.endsWith(`#${comment.id}`) + const { isReady, asPath } = useRouter() + const [highlighted, setHighlighted] = useState(false) const commentRef = useRef(null) useEffect(() => { - if (highlighted && commentRef.current != null) { + if (isReady && asPath.endsWith(`#${comment.id}`)) { + setHighlighted(true) + } + }, [isReady, asPath, comment.id]) + + useEffect(() => { + if (highlighted && commentRef.current) { commentRef.current.scrollIntoView(true) } }, [highlighted]) @@ -126,7 +132,7 @@ export const FeedComment = memo(function FeedComment(props: { className={clsx( 'relative', indent ? 'ml-6' : '', - highlighted ? `-m-1.5 rounded bg-indigo-500/[0.2] p-1.5` : '' + highlighted ? `-m-1.5 rounded bg-indigo-500/[0.2] px-2 py-4` : '' )} > {/*draw a gray line from the comment to the left:*/} From 443397b7dc27419a4140f2a3b5f1b24e73ff9127 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Fri, 7 Oct 2022 15:13:57 -0500 Subject: [PATCH 3/3] Action to merge main into main2 automatically --- .github/workflows/merge-main-into-main2.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/merge-main-into-main2.yml diff --git a/.github/workflows/merge-main-into-main2.yml b/.github/workflows/merge-main-into-main2.yml new file mode 100644 index 00000000..0a8de56f --- /dev/null +++ b/.github/workflows/merge-main-into-main2.yml @@ -0,0 +1,17 @@ +name: Merge main into main2 on every commit +on: + push: + branches: + - 'main' +jobs: + merge-branch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + + - name: Merge main -> main2 + uses: devmasx/merge-branch@master + with: + type: now + target_branch: main2 + github_token: ${{ github.token }}