Skip to content

Commit

Permalink
[#17986] feat: add overlay component
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ghafouri committed Nov 27, 2023
1 parent f82d28c commit cc4290c
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/quo/components/overlay/style.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(ns quo.components.overlay.style)

(defn overlay-background
[background-color]
{:position :absolute
:top 0
:left 0
:right 0
:bottom 0
:background-color background-color})

(def container-style
{:flex 1})
23 changes: 23 additions & 0 deletions src/quo/components/overlay/view.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(ns quo.components.overlay.view
(:require
[quo.components.overlay.style :as style]
[quo.foundations.colors :as colors]
[react-native.blur :as blur]
[react-native.core :as rn]))

(defn view
[{:keys [type]} child]
(let [background-color (case type
:shell colors/neutral-80-opa-80-blur
:drawer colors/neutral-100-opa-70-blur)]
[rn/view
{:style (style/overlay-background background-color)}
(if (= type :shell)
[blur/view
{:blur-amount 20
:blur-type :transparent
:style style/container-style}
child]
[rn/view
{:style style/container-style}
child])]))
4 changes: 4 additions & 0 deletions src/quo/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
quo.components.numbered-keyboard.keyboard-key.view
quo.components.numbered-keyboard.numbered-keyboard.view
quo.components.onboarding.small-option-card.view
quo.components.overlay.view
quo.components.password.tips.view
quo.components.profile.collectible.view
quo.components.profile.profile-card.view
Expand Down Expand Up @@ -314,6 +315,9 @@
(def notification quo.components.notifications.notification.view/notification)
(def toast quo.components.notifications.toast.view/toast)

;;;; Overlay
(def overlay quo.components.overlay.view/view)

;;;; Password
(def tips quo.components.password.tips.view/view)

Expand Down

0 comments on commit cc4290c

Please sign in to comment.