* Half the rail's widgets decide internally whether they have anything to show, * so an ad placed after one can end up following nothing and landing against * the previous ad. `display: contents` keeps the pair in the rail's own flex * flow, and the slot hides itself whenever it comes out first —
({
widget,
ad,
}: {
widget: ReactNode;
ad: ReactNode;
})
| 89 | * happens when its widget rendered nothing. |
| 90 | */ |
| 91 | function WidgetWithAd({ |
| 92 | widget, |
| 93 | ad, |
| 94 | }: { |
| 95 | widget: ReactNode; |
| 96 | ad: ReactNode; |
| 97 | }): ReactElement { |
| 98 | return ( |
| 99 | <div className="contents"> |
| 100 | {widget} |
| 101 | <div className="contents [&:first-child]:hidden">{ad}</div> |
| 102 | </div> |
| 103 | ); |
| 104 | } |
| 105 | |
| 106 | export function PostWidgets({ |
| 107 | onCopyPostLink, |
nothing calls this directly
no outgoing calls
no test coverage detected