| 
1 | 1 | (ns quo.components.keycard.view  | 
2 | 2 |   (:require  | 
 | 3 | +    [clojure.string :as string]  | 
3 | 4 |     [quo.components.keycard.style :as style]  | 
4 | 5 |     [quo.components.tags.tag :as tag]  | 
5 | 6 |     [quo.foundations.colors :as colors]  | 
 | 
14 | 15 |   - :locked? - Boolean to specify whether the keycard is locked or not  | 
15 | 16 |   - :theme :light/:dark  | 
16 | 17 |   "  | 
17 |  | -  [{:keys [holder-name locked?]}]  | 
18 |  | -  (let [theme (quo.theme/use-theme)  | 
19 |  | -        label (if holder-name  | 
20 |  | -                (i18n/label :t/user-keycard {:name holder-name})  | 
21 |  | -                (i18n/label :t/empty-keycard))]  | 
22 |  | -    [rn/view {:style (style/card-container locked? theme)}  | 
 | 18 | +  [{:keys [holder-name locked? blur?]}]  | 
 | 19 | +  (let [theme (quo.theme/use-theme)]  | 
 | 20 | +    [rn/view {:style (style/card-container locked? theme blur?)}  | 
23 | 21 |      [rn/image  | 
24 | 22 |       {:source (resources/get-image :keycard-logo)  | 
25 | 23 |        :style  (style/keycard-logo locked? theme)}]  | 
26 | 24 |      [rn/image  | 
27 | 25 |       {:source (resources/get-image  | 
28 | 26 |                 (if (or locked? (= :dark theme)) :keycard-chip-dark :keycard-chip-light))  | 
29 | 27 |        :style  style/keycard-chip}]  | 
30 |  | -     [rn/image  | 
31 |  | -      {:source (resources/get-image :keycard-watermark)  | 
32 |  | -       :style  (style/keycard-watermark locked? theme)}]  | 
33 |  | -     [tag/tag  | 
34 |  | -      {:size                32  | 
35 |  | -       :type                (when locked? :icon)  | 
36 |  | -       :label               label  | 
37 |  | -       :labelled?           true  | 
38 |  | -       :blurred?            true  | 
39 |  | -       :resource            (when locked? :i/locked)  | 
40 |  | -       :accessibility-label :holder-name  | 
41 |  | -       :icon-color          colors/white-70-blur  | 
42 |  | -       :override-theme      (when locked? :dark)}]]))  | 
 | 28 | +     (when-not (string/blank? holder-name)  | 
 | 29 | +       [tag/tag  | 
 | 30 | +        {:size                32  | 
 | 31 | +         :type                (when locked? :icon)  | 
 | 32 | +         :label               (i18n/label :t/user-keycard {:name holder-name})  | 
 | 33 | +         :labelled?           true  | 
 | 34 | +         :blurred?            true  | 
 | 35 | +         :resource            (when locked? :i/locked)  | 
 | 36 | +         :accessibility-label :holder-name  | 
 | 37 | +         :icon-color          colors/white-70-blur  | 
 | 38 | +         :override-theme      (when locked? :dark)}])]))  | 
0 commit comments