about summary refs log tree commit diff
path: root/src/tours/positioning.web.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/tours/positioning.web.ts')
-rw-r--r--src/tours/positioning.web.ts27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/tours/positioning.web.ts b/src/tours/positioning.web.ts
new file mode 100644
index 000000000..fd0f7aa71
--- /dev/null
+++ b/src/tours/positioning.web.ts
@@ -0,0 +1,27 @@
+import {useWindowDimensions} from 'react-native'
+
+import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries'
+import {useShellLayout} from '#/state/shell/shell-layout'
+
+export function useHeaderPosition() {
+  const {headerHeight} = useShellLayout()
+  const winDim = useWindowDimensions()
+  const {isMobile} = useWebMediaQueries()
+
+  let left = 0
+  let width = winDim.width
+  if (width > 590 && !isMobile) {
+    left = winDim.width / 2 - 295
+    width = 590
+  }
+
+  let offset = isMobile ? 45 : 0
+
+  return {
+    top: headerHeight.value - offset,
+    left,
+    width,
+    height: 45,
+    borderRadiusObject: undefined,
+  }
+}