Skip to content

[TOOL-5083] Portal: Fix header on mobile viewport #7661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
39 changes: 17 additions & 22 deletions apps/portal/src/app/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
TableOfContentsIcon,
} from "lucide-react";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { usePathname } from "next/navigation";
import { useState } from "react";
import { DocSearch } from "@/components/others/DocSearch";
import { Button } from "@/components/ui/button";
Expand Down Expand Up @@ -191,13 +191,12 @@

export function Header() {
const [showBurgerMenu, setShowBurgerMenu] = useState(false);
const router = useRouter();
const pathname = usePathname();

return (
<header className="flex w-full flex-col gap-2 border-b bg-background pt-4 px-4 lg:px-8 overflow-hidden">
<header className="flex w-full flex-col gap-2 border-b bg-background pt-4 px-4 pb-4 xl:pb-0 lg:px-8 overflow-hidden">

Check warning on line 197 in apps/portal/src/app/Header.tsx

View workflow job for this annotation

GitHub Actions / Lint Packages

Classnames 'pt-4, px-4, pb-4' could be replaced by the 'p-4' shorthand!
{/* Top row */}
<div className="container flex items-center justify-between gap-6">
{/* Top row */}
<div className="flex items-center gap-2">
<Link
aria-label="thirdweb Docs"
Expand All @@ -219,7 +218,7 @@
href="https://github.com/thirdweb-dev"
target="_blank"
>
<GithubIcon className="mx-3 size-6" />
<GithubIcon className="size-6 lg:size-5" />
</Link>
</div>

Expand All @@ -232,25 +231,21 @@
</div>

<div className="hidden xl:block">
<Button
onClick={() => {
router.push("/chat");
}}
>
<MessageCircleIcon className="mr-2 size-4" />
Ask AI
<Button asChild>
<Link href="/chat">
<MessageCircleIcon className="mr-2 size-4" />
Ask AI
</Link>
</Button>
</div>

<div className="flex items-center gap-1 xl:hidden">
<ThemeSwitcher className="border-none bg-transparent" />
<DocSearch variant="icon" />
<Button
className="p-2"
onClick={() => router.push("/chat")}
variant="ghost"
>
<MessageCircleIcon className="size-7" />
<Button className="p-2" asChild variant="ghost">
<Link href="/chat">
<MessageCircleIcon className="size-6" />
</Link>
</Button>
<Button
className="p-2"
Expand All @@ -264,13 +259,13 @@
</div>

{/* Bottom row - hidden on mobile */}
<div className="container hidden items-center justify-between gap-6 xl:flex">
<div className="container hidden items-center justify-between gap-6 xl:flex mt-1">
<nav className="flex grow gap-5">
<ul className="flex flex-row items-center gap-5">
<ul className="flex flex-row items-center gap-0 mb-1">
{links.map((link) => {
return (
<li
className="flex items-center py-4 relative overflow-hidden"
className="flex items-center py-2 relative px-2.5 rounded-lg hover:bg-accent hover:text-foreground"
key={link.href}
onClick={() => {
setShowBurgerMenu(false);
Expand All @@ -281,7 +276,7 @@
>
<NavLink href={link.href} name={link.name} />
{pathname.includes(link.href) && (
<div className="bg-violet-700 h-1 inset-x-0.5 rounded-full absolute -bottom-0.5" />
<div className="bg-violet-700 h-[2px] inset-x-0 rounded-full absolute -bottom-1" />
)}
</li>
);
Expand Down
11 changes: 6 additions & 5 deletions apps/portal/src/components/Layouts/DocLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import clsx from "clsx";
import { cn } from "@/lib/utils";
import { PageFooter } from "../Document/PageFooter";
import {
DocSidebar,
Expand All @@ -25,17 +25,18 @@ type DocLayoutProps = {
export function DocLayout(props: DocLayoutProps) {
return (
<div
className={`container text-muted-foreground relative flex flex-col gap-12 xl:grid p-4 ${
className={cn(
"container text-muted-foreground relative flex flex-col gap-12 xl:grid",
props.showTableOfContents !== false
? "xl:grid-cols-[220px_720px_1fr]"
: "xl:grid-cols-[220px_1160px]"
}`}
: "xl:grid-cols-[220px_1160px]",
)}
style={{
minHeight: "calc(100vh - var(--sticky-top-height))",
}}
>
<aside
className={clsx(
className={cn(
"sticky top-sticky-top-height h-sidebar-height flex-col overflow-y-hidden",
"hidden xl:flex",
)}
Expand Down
6 changes: 3 additions & 3 deletions apps/portal/src/components/others/DocSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@
{forDesktop && (
<DialogTrigger asChild>
<Button
className="flex w-64 justify-between gap-6 px-3 text-muted-foreground"
className="flex w-64 justify-between gap-6 px-3 text-muted-foreground bg-card"
variant="outline"
>
Search Docs
<div className="flex items-center gap-1 rounded-sm border bg-background px-2 py-1 text-muted-foreground text-xs">
<span className="text-xs">Search Docs</span>
<div className="flex items-center gap-1 rounded-sm px-1 py-1 text-muted-foreground text-xs">

Check warning on line 361 in apps/portal/src/components/others/DocSearch.tsx

View workflow job for this annotation

GitHub Actions / Lint Packages

Classnames 'px-1, py-1' could be replaced by the 'p-1' shorthand!
<CommandIcon className="size-3" />K
</div>
</Button>
Expand Down
4 changes: 2 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ coverage:
- "**/__generated__/**"
- "**/contract/deployment/zksync/**"
- "*/thirdweb/src/contract/deployment/zksync/zkDeployContract.ts"


github_checks:
annotations: true
Expand All @@ -30,5 +30,5 @@ comment:
require_changes: false # if true: only post the comment if coverage changes
require_base: false # [yes :: must have a base report to post]
require_head: true # [yes :: must have a head report to post]
show_carryforward_flags: true
show_carryforward_flags: true
hide_comment_details: true #collapse all the "detailed info" for the PR comment
Loading