status-react/src/react_native/safe_area.cljs
flexsurfer 685c95591c
refactor and move composer to status-im2 (#14758)
refactor and move composer to status-im2
2023-01-16 17:20:10 +01:00

16 lines
508 B
Clojure

(ns react-native.safe-area
(:require ["react-native-safe-area-context" :as safe-area-context :refer
(SafeAreaProvider SafeAreaInsetsContext)]
[reagent.core :as reagent]))
(def ^:private consumer-raw (reagent/adapt-react-class (.-Consumer ^js SafeAreaInsetsContext)))
(def provider (reagent/adapt-react-class SafeAreaProvider))
(defn consumer
[component]
[consumer-raw
(fn [^js insets]
(reagent/as-element
[component (js->clj insets :keywordize-keys true)]))])