Skip to content

Commit 131ae39

Browse files
committed
fix: ad
1 parent e30fecc commit 131ae39

File tree

2 files changed

+64
-61
lines changed

2 files changed

+64
-61
lines changed

src/components/DocsLayout.tsx

Lines changed: 57 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ export function DocsLayout({
457457
{/* Collapsed strip - visible on sm to xl, hidden on xl+. Lower z-index so expanded menu covers it */}
458458
<div
459459
className={twMerge(
460-
'hidden sm:flex xl:hidden flex-col',
460+
'hidden sm:flex xl:hidden flex-col overflow-hidden',
461461
'sticky top-[var(--navbar-height)] h-[calc(100dvh-var(--navbar-height))]',
462462
'z-10 border-r border-gray-500/20',
463463
'bg-white/50 dark:bg-black/30',
@@ -492,7 +492,7 @@ export function DocsLayout({
492492
ref={expandedMenuRef}
493493
className={twMerge(
494494
'max-w-[250px] xl:max-w-[300px] 2xl:max-w-[400px]',
495-
'flex-col',
495+
'flex-col overflow-hidden',
496496
'h-[calc(100dvh-var(--navbar-height))] top-[var(--navbar-height)]',
497497
'z-20 border-r border-gray-500/20',
498498
'transition-all duration-300',
@@ -539,7 +539,8 @@ export function DocsLayout({
539539
className={`
540540
min-h-[calc(100dvh-var(--navbar-height))]
541541
flex flex-col sm:flex-row
542-
w-full transition-all duration-300`}
542+
w-full transition-all duration-300
543+
[overflow-x:clip]`}
543544
>
544545
{smallMenu}
545546
{largeMenu}
@@ -605,70 +606,66 @@ export function DocsLayout({
605606
"
606607
>
607608
<div className="sm:sticky sm:top-[var(--navbar-height)] ml-auto flex flex-wrap flex-row justify-center sm:flex-col gap-4 pl-4 pb-4">
608-
<div className="flex flex-col">
609-
<div className="flex flex-wrap items-stretch border-l border-gray-500/20 rounded-bl-lg overflow-hidden -mr-px">
610-
<div className="w-full flex gap-2 justify-between border-b border-gray-500/20 px-3 py-2">
611-
<Link
612-
className="font-medium opacity-60 hover:opacity-100 text-xs"
613-
to="/partners"
614-
>
615-
Partners
616-
</Link>
617-
<a
618-
href="https://docs.google.com/document/d/1Hg2MzY2TU6U3hFEZ3MLe2oEOM3JS4-eByti3kdJU3I8"
619-
target="_blank"
620-
rel="noopener noreferrer"
621-
className="font-medium opacity-60 hover:opacity-100 text-xs hover:underline"
622-
>
623-
Become a Partner
624-
</a>
625-
</div>
626-
{activePartners
627-
.filter((d) => d.id !== 'ui-dev')
628-
.map((partner) => {
629-
// flexBasis as percentage based on score, flexGrow to fill remaining row space
630-
const widthPercent = Math.round(partner.score * 100)
631-
632-
return (
633-
<a
634-
key={partner.name}
635-
href={partner.href}
636-
target="_blank"
637-
rel="noreferrer"
638-
className="flex items-center justify-center px-3 py-2
609+
<div className="flex flex-wrap items-stretch border-l border-gray-500/20 rounded-bl-lg overflow-hidden -mr-px">
610+
<div className="w-full flex gap-2 justify-between border-b border-gray-500/20 px-3 py-2">
611+
<Link
612+
className="font-medium opacity-60 hover:opacity-100 text-xs"
613+
to="/partners"
614+
>
615+
Partners
616+
</Link>
617+
<a
618+
href="https://docs.google.com/document/d/1Hg2MzY2TU6U3hFEZ3MLe2oEOM3JS4-eByti3kdJU3I8"
619+
target="_blank"
620+
rel="noopener noreferrer"
621+
className="font-medium opacity-60 hover:opacity-100 text-xs hover:underline"
622+
>
623+
Become a Partner
624+
</a>
625+
</div>
626+
{activePartners
627+
.filter((d) => d.id !== 'ui-dev')
628+
.map((partner) => {
629+
// flexBasis as percentage based on score, flexGrow to fill remaining row space
630+
const widthPercent = Math.round(partner.score * 100)
631+
632+
return (
633+
<a
634+
key={partner.name}
635+
href={partner.href}
636+
target="_blank"
637+
rel="noreferrer"
638+
className="flex items-center justify-center px-3 py-2
639639
border-r border-b border-gray-500/20
640640
hover:bg-gray-500/10 transition-colors duration-150 ease-out"
641+
style={{
642+
flexBasis: `${widthPercent}%`,
643+
flexGrow: 1,
644+
flexShrink: 0,
645+
}}
646+
>
647+
<div
641648
style={{
642-
flexBasis: `${widthPercent}%`,
643-
flexGrow: 1,
644-
flexShrink: 0,
649+
width: Math.max(
650+
60 + Math.round(140 * partner.score),
651+
70,
652+
),
645653
}}
646654
>
647-
<div
648-
style={{
649-
width: Math.max(
650-
60 + Math.round(140 * partner.score),
651-
70,
652-
),
653-
}}
654-
>
655-
<PartnerImage
656-
config={partner.image}
657-
alt={partner.name}
658-
/>
659-
</div>
660-
</a>
661-
)
662-
})}
663-
</div>
655+
<PartnerImage
656+
config={partner.image}
657+
alt={partner.name}
658+
/>
659+
</div>
660+
</a>
661+
)
662+
})}
664663
</div>
665664
<AdGate>
666-
<div className="max-w-full overflow-hidden">
667-
<GamVrec1
668-
popupPosition="top"
669-
borderClassName="rounded-l-xl rounded-r-none"
670-
/>
671-
</div>
665+
<GamVrec1
666+
popupPosition="top"
667+
borderClassName="rounded-l-xl rounded-r-none"
668+
/>
672669
</AdGate>
673670
{libraryId === 'query' ? (
674671
<div className="p-4 bg-white/70 dark:bg-black/40 rounded-lg flex flex-col">

src/components/Gam.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,13 @@ export function GamLeftRailSquare() {
185185
export function GamVrec1(
186186
props: Omit<React.ComponentProps<typeof GamAd>, 'name'>,
187187
) {
188-
return <GamAd {...props} name="vrec_1" />
188+
return (
189+
<GamAd
190+
{...props}
191+
name="vrec_1"
192+
className={twMerge('w-[300px] min-h-[600px]', props.className)}
193+
/>
194+
)
189195
}
190196

191197
export function GamHeader(

0 commit comments

Comments
 (0)