Skip to content

Commit

Permalink
Merge pull request #563 from near/693-navigate-tabs-on-mobile
Browse files Browse the repository at this point in the history
feat: Add click directly on TabsButton
  • Loading branch information
erditkurteshiSQA authored Dec 12, 2023
2 parents c2ac005 + 0ec2329 commit 7903b2e
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/ActivityPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,27 @@ const TabsButton = styled("Link")`
return (
<Wrapper className="container-xl" negativeMargin={selectedTab === "posts"}>
<Tabs halfMargin={selectedTab === "apps"} noMargin={selectedTab === "posts"}>
<TabsButton href={`${activityUrl}?tab=posts`} selected={selectedTab === "posts"}>
<TabsButton
href={`${activityUrl}?tab=posts`}
selected={selectedTab === "posts"}
onClick={() => setSelectedTab("posts")}
>
Posts
</TabsButton>

<TabsButton href={`${activityUrl}?tab=apps`} selected={selectedTab === "apps"}>
<TabsButton
href={`${activityUrl}?tab=apps`}
selected={selectedTab === "apps"}
onClick={() => setSelectedTab("apps")}
>
Components
</TabsButton>

<TabsButton href={`${activityUrl}?tab=explore`} selected={selectedTab === "explore"}>
<TabsButton
href={`${activityUrl}?tab=explore`}
selected={selectedTab === "explore"}
onClick={() => setSelectedTab("explore")}
>
Explore
</TabsButton>
</Tabs>
Expand Down

0 comments on commit 7903b2e

Please sign in to comment.