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

Function placeBar

packages/shared/src/components/shell/ShellRow.tsx:58–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56
57 // The bar follows the lit label; it only slides once it has a place.
58 const placeBar = () => {
59 const bar = barRef.current;
60 const lit = row.querySelector<HTMLElement>(litSelector);
61 const label = lit?.querySelector<HTMLElement>('[data-tab-label]');
62
63 if (!bar || !lit || !label) {
64 if (bar) {
65 bar.style.opacity = '0';
66 }
67 return;
68 }
69
70 const left =
71 lit.offsetLeft +
72 label.offsetLeft +
73 label.offsetWidth / 2 -
74 barWidth / 2;
75 const isPlaced = bar.style.opacity === '1';
76 bar.style.transition = isPlaced ? '' : 'none';
77 bar.style.transform = `translateX(${left}px)`;
78 bar.style.opacity = '1';
79 };
80
81 const reveal = () => {
82 placeBar();

Callers 1

revealFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected