Skip to content

Commit 33d34c6

Browse files
authored
Merge pull request #2482 from pyth-network/cprussin/fix-staking-header
fix(staking): fix header to not overlap on small screen sizes
2 parents fa21077 + 04d70f5 commit 33d34c6

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

apps/staking/src/components/Header/help-menu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ export const HelpMenu = () => {
4747
return (
4848
<>
4949
<MenuTrigger>
50-
<Button className="group -mx-2 flex flex-row items-center gap-2 rounded-sm p-2 transition hover:bg-white/10 focus:outline-none focus-visible:ring-1 focus-visible:ring-pythpurple-400 pressed:bg-white/10 md:-mx-4 md:px-4">
50+
<Button className="group -mx-2 flex flex-row items-center gap-2 rounded-sm p-2 transition hover:bg-white/10 focus:outline-none focus-visible:ring-1 focus-visible:ring-pythpurple-400 pressed:bg-white/10 xl:-mx-4 xl:px-4">
5151
<QuestionMarkCircleIcon className="size-6 flex-none" />
52-
<span className="sr-only md:not-sr-only">Help</span>
52+
<span className="sr-only xl:not-sr-only">Help</span>
5353
<ChevronDownIcon className="size-4 flex-none opacity-60 transition duration-300 group-data-[pressed]:-rotate-180" />
5454
</Button>
5555
<Menu placement="bottom end">

apps/staking/src/components/Header/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const Header = ({
2121
>
2222
<div className="border-b border-neutral-600/50 bg-pythpurple-800 lg:border-x">
2323
<MaxWidth className="flex h-header items-center justify-between gap-2 lg:-mx-4">
24-
<div className="flex flex-row items-center gap-8 lg:gap-12">
24+
<div className="flex flex-row items-center gap-6 lg:gap-12">
2525
<Link
2626
href="/"
2727
className="-mx-2 h-[calc(var(--header-height)_-_0.5rem)] rounded-sm p-2 text-pythpurple-100 focus:outline-none focus-visible:ring-1 focus-visible:ring-pythpurple-400"
@@ -30,16 +30,16 @@ export const Header = ({
3030
<Logomark className="h-full lg:hidden" />
3131
<span className="sr-only">Pyth Staking</span>
3232
</Link>
33-
<Stats className="hidden gap-4 sm:flex lg:gap-6" />
33+
<Stats className="hidden gap-4 md:flex lg:gap-6" />
3434
</div>
35-
<div className="flex flex-none flex-row items-stretch gap-4 md:gap-8">
35+
<div className="flex flex-none flex-row items-stretch gap-4 lg:gap-8">
3636
<CurrentStakeAccount />
3737
<WalletButton className="flex-none" />
3838
<HelpMenu />
3939
</div>
4040
</MaxWidth>
4141
</div>
4242
</header>
43-
<Stats className="border-b border-neutral-600/50 py-4 text-center sm:hidden" />
43+
<Stats className="border-b border-neutral-600/50 py-4 text-center md:hidden" />
4444
</>
4545
);

apps/staking/src/components/Header/stats.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const Stats = ({ className, ...props }: HTMLProps<HTMLDivElement>) => {
2222

2323
return (
2424
<div className={clsx("flex flex-row items-stretch", className)} {...props}>
25-
<div className="flex-1 sm:flex-none">
25+
<div className="flex-1 md:flex-none">
2626
{state.type === StateType.Loaded ? (
2727
<Tokens className="mb-1 text-xl font-semibold leading-none">
2828
{state.data.totalStaked}
@@ -35,7 +35,7 @@ export const Stats = ({ className, ...props }: HTMLProps<HTMLDivElement>) => {
3535
</div>
3636
</div>
3737
<div className="border-l border-neutral-600/50" />
38-
<div className="flex-1 sm:flex-none">
38+
<div className="flex-1 md:flex-none">
3939
{state.type === StateType.Loaded ? (
4040
<Tokens className="mb-1 text-xl font-semibold leading-none">
4141
{state.data.rewardsDistributed}
@@ -48,7 +48,7 @@ export const Stats = ({ className, ...props }: HTMLProps<HTMLDivElement>) => {
4848
</div>
4949
</div>
5050
<div className="border-l border-neutral-600/50" />
51-
<div className="flex-1 sm:flex-none">
51+
<div className="flex-1 md:flex-none">
5252
{state.type === StateType.Loaded ? (
5353
<Tokens className="mb-1 text-xl font-semibold leading-none">
5454
{state.data.totalGovernance}
@@ -57,7 +57,7 @@ export const Stats = ({ className, ...props }: HTMLProps<HTMLDivElement>) => {
5757
<Loading />
5858
)}
5959
<div className="text-xs leading-none text-pythpurple-400">
60-
Pyth Governance Total Staked
60+
Governance Total Staked
6161
</div>
6262
</div>
6363
</div>

0 commit comments

Comments
 (0)