fix - add missing code for Lowest price component (#13985)

This commit is contained in:
Ibrahem Khalil 2022-09-12 20:01:41 +02:00 committed by GitHub
parent 09e4df3cf7
commit 94303a4a64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 54 additions and 1 deletions

View File

@ -1 +1,54 @@
(ns quo2.screens.info.lowest-price)
(ns quo2.screens.info.lowest-price
(:require [quo2.foundations.colors :as colors]
[quo.react-native :as rn]
[quo.previews.preview :as preview]
[quo2.components.info.lowest-price :as quo2]
[reagent.core :as reagent]))
(def descriptor [{:label "Top value"
:key :top-value
:type :text}
{:label "Top value background color"
:key :top-value-bg-color
:type :text}
{:label "Top value text color"
:key :top-value-text-color
:type :text}
{:label "Bottom value"
:key :bottom-value
:type :text}
{:label "Bottom value background color"
:key :bottom-value-bg-color
:type :text}
{:label "Bottom value text color"
:key :bottom-value-text-color
:type :text}
{:label "Margin top"
:key :margin-top
:type :text}])
(defn cool-preview []
(let [state (reagent/atom {:top-value 20
:bottom-value 20
:top-value-bg-color colors/black
:top-value-text-color colors/white
:bottom-value-bg-color colors/black
:bottom-value-text-color colors/white})]
(fn []
[rn/view {:margin-bottom 50
:padding 16}
[rn/view {:flex 1}
[preview/customizer state descriptor]]
[rn/view {:padding-vertical 60
:flex-direction :row
:justify-content :center}
[quo2/lowest-price @state]]])))
(defn preview-lowest-price []
[rn/view {:background-color (colors/theme-colors colors/white
colors/neutral-90)
:flex 1}
[rn/flat-list {:flex 1
:keyboardShouldPersistTaps :always
:header [cool-preview]
:key-fn str}]])