Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/ArticleMenu/ArticleMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const ArticleMenu = ({
}}
>
<HeartIcon
className={`w-6 h-6${
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come you needed to change the order of these?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of an already merged change, I had done a git pull from upstream after committing my changes and since I had global rebase to true, it caused this commit to be moved ahead of my commit.

Reference to the merged commit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok this makes sense. Thanks for the clarification

className={`h-6 w-6 ${
data?.currentUserLiked
? "fill-red-400"
: "fill-neutral-400 dark:fill-neutral-600"
Expand All @@ -162,7 +162,7 @@ const ArticleMenu = ({
}}
>
<BookmarkIcon
className={`w-6 h-6${
className={`h-6 w-6 ${
data?.currentUserBookmarked
? "fill-blue-400"
: "fill-neutral-400 dark:fill-neutral-600"
Expand Down
2 changes: 1 addition & 1 deletion components/ArticlePreview/ArticlePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ const ArticlePreview: NextPage<Props> = ({
}
>
<BookmarkIcon
className={`w-6 h-6${
className={`h-6 w-6 ${
bookmarked
? "fill-blue-400"
: "fill-neutral-400 dark:fill-neutral-600"
Expand Down
22 changes: 20 additions & 2 deletions components/Nav/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";
import { api } from "@/server/trpc/react";
import { usePathname } from "next/navigation";
import {
Disclosure,
DisclosureButton,
Expand Down Expand Up @@ -40,6 +41,8 @@ const Nav = ({
enabled: session ? true : false,
});

const pathname = usePathname();

const userNavigation = [
{
name: "Your Profile",
Expand All @@ -55,6 +58,18 @@ const Nav = ({

const hasNotifications = !!count && count > 0;

const handleSignInPageNavigation = () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! This is very much a minor issue but it annoyed me and means we need to add guards in E2E tests. This will remove that need

Copy link
Copy Markdown
Contributor Author

@IdrisGit IdrisGit Oct 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I am happy to help :)

Helping maintainers to solve these minor but time consuming issues is my goal for this Hacktoberfest.

/**
* * NextAuth.js automatically adds current url to the callbackurl prop in the singin() method.
* * As Navbar is always present, spamming SignIn button causes login page url getting appended in the url bar.
*/
if (pathname === "/get-started") {
return;
}

signIn();
};

return (
<Disclosure as="nav" className="bg-neutral-100 dark:bg-black">
{({ close, open }) => (
Expand Down Expand Up @@ -117,12 +132,15 @@ const Nav = ({
</>
) : (
<>
<button className="nav-button" onClick={() => signIn()}>
<button
className="nav-button"
onClick={handleSignInPageNavigation}
>
Sign in
</button>
<button
className="primary-button"
onClick={() => signIn()}
onClick={handleSignInPageNavigation}
>
Sign up for free
</button>
Expand Down