MCPcopy Create free account
hub / github.com/dailydotdev/apps / WidgetWithAd

Function WidgetWithAd

packages/shared/src/components/post/PostWidgets.tsx:91–104  ·  view source on GitHub ↗

* 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;
})

Source from the content-addressed store, hash-verified

89 * happens when its widget rendered nothing.
90 */
91function 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
106export function PostWidgets({
107 onCopyPostLink,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected