mirror of
https://github.com/status-im/status-react.git
synced 2025-02-23 08:08:33 +00:00
31 lines
664 B
Clojure
31 lines
664 B
Clojure
(ns react-native.safe-area
|
|
(:require ["react-native-static-safe-area-insets" :default StaticSafeAreaInsets]
|
|
[oops.core :as oops]
|
|
[react-native.platform :as platform]
|
|
[react-native.navigation :as navigation]))
|
|
|
|
(defn- get-static-top
|
|
[]
|
|
(oops/oget StaticSafeAreaInsets "safeAreaInsetsTop"))
|
|
|
|
(defn- get-static-bottom
|
|
[]
|
|
(oops/oget StaticSafeAreaInsets "safeAreaInsetsBottom"))
|
|
|
|
(defn get-top
|
|
[]
|
|
(if platform/ios?
|
|
(get-static-top)
|
|
(navigation/status-bar-height)))
|
|
|
|
(defn get-bottom
|
|
[]
|
|
(if platform/ios?
|
|
(get-static-bottom)
|
|
0))
|
|
|
|
(defn get-insets
|
|
[]
|
|
{:top (get-top)
|
|
:bottom (get-bottom)})
|