-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#17986] feat: add overlay component
- Loading branch information
1 parent
d309aa3
commit 2b8e93e
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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])])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters