MCPcopy
hub / github.com/nygardk/react-share / getBoxPositionOnWindowCenter

Function getBoxPositionOnWindowCenter

src/ShareButton.tsx:44–47  ·  view source on GitHub ↗
(width: number, height: number)

Source from the content-addressed store, hash-verified

42 typeof (obj as Promise<unknown>).then === 'function';
43
44const getBoxPositionOnWindowCenter = (width: number, height: number) => ({
45 left: window.outerWidth / 2 + (window.screenX || window.screenLeft || 0) - width / 2,
46 top: window.outerHeight / 2 + (window.screenY || window.screenTop || 0) - height / 2,
47});
48
49const getBoxPositionOnScreenCenter = (width: number, height: number) => ({
50 top: (window.screen.height - height) / 2,

Callers 1

handleClickFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…