Remove unused code

Fix tests, return tribute to talk

Signed-off-by: Gheorghe Pinzaru <feross95@gmail.com>
This commit is contained in:
Gheorghe Pinzaru 2020-05-01 17:26:40 +03:00
parent a40d599e55
commit c74beec17a
No known key found for this signature in database
GPG Key ID: C9A094959935A952
79 changed files with 254 additions and 1440 deletions

237
.carve_ignore Normal file
View File

@ -0,0 +1,237 @@
status-im.utils.build/warning-handler
status-im.utils.build/get-current-sha
status-im.ethereum.resolver/name
status-im.chat.constants/spacing-char
status-im.chat.constants/arg-wrapping-char
status-im.ios.core/init
status-im.ui.components.camera/aspects
status-im.ui.components.camera/capture-targets
status-im.ui.components.camera/set-torch
status-im.ui.components.camera/request-access-ios
status-im.chat.models.message-content/stylings
status-im.chat.models.message-content/actions
status-im.chat.models.message-content/blank-string
status-im.chat.models.message-content/sorted-ranges
status-im.ethereum.mnemonic/words->passphrase
status-im.native-module.core/listener
status-im.native-module.core/multiaccount-reset
status-im.native-module.core/extract-group-membership-signatures
status-im.native-module.core/sign-group-membership
status-im.native-module.core/update-mailservers
status-im.ethereum.abi-spec/bytes-to-hex
status-im.android.core/init
status-im.chat.models.message/transport-keys
status-im.utils.datetime/week
status-im.utils.datetime/time-ago
status-im.utils.datetime/format-date
status-im.utils.datetime/get-ordinal-date
reagent.dom/render
reagent.dom/unmount-component-at-node
reagent.dom/dom-node
reagent.dom/force-update-all
status-im.multiaccounts.create.core/get-new-key-code
status-im.ethereum.decode/string
status-im.network.ui.views/mainnet?
status-im.data-store.chats/event->string
status-im.mailserver.constants/seven-days
status-im.mailserver.constants/connection-timeout
status-im.hardwallet.card/install-applet
status-im.hardwallet.card/install-cash-applet
status-im.multiaccount.login.data-test/all-contacts
status-im.multiaccount.login.data-test/multiaccounts
status-im.multiaccount.login.data-test/get-chats
status-im.multiaccount.login.data-test/transport
status-im.multiaccount.login.data-test/topics
status-im.utils.utils/clear-timeout
status-im.utils.handlers/logged-in
status-im.multiaccounts.model/credentials
status-im.multiaccounts.login.core/contract-fleet?
status-im.multiaccounts.login.core/fetch-nodes
status-im.utils.config/rpc-networks-only?
status-im.utils.config/waku-enabled?
status-im.utils.pairing/has-paired-installations?
status-im.tribute-to-talk.core-test/user-cofx
quo.gesture-handler/tap-gesture-handler
quo.gesture-handler/pan-gesture-handler
quo.gesture-handler/long-press-gesture-handler
quo.gesture-handler/pure-native-button
quo.gesture-handler/createNativeWrapper
quo.gesture-handler/animated-raw-button
quo.gesture-handler/states
mocks.js-dependencies/action-button
mocks.js-dependencies/camera
mocks.js-dependencies/dismiss-keyboard
mocks.js-dependencies/emoji-picker
mocks.js-dependencies/i18n
mocks.js-dependencies/qr-code
mocks.js-dependencies/svg
mocks.js-dependencies/vector-icons
mocks.js-dependencies/webview
mocks.js-dependencies/desktop-linking
mocks.js-dependencies/desktop-shortcuts
mocks.js-dependencies/snoopy
mocks.js-dependencies/snoopy-filter
mocks.js-dependencies/snoopy-bars
mocks.js-dependencies/snoopy-buffer
mocks.js-dependencies/desktop-menu
mocks.js-dependencies/desktop-config
mocks.js-dependencies/react-native-navigation-twopane
mocks.js-dependencies/react-native-screens
mocks.js-dependencies/react-native-shake
mocks.js-dependencies/back-handler
mocks.js-dependencies/react
mocks.js-dependencies/react-navigation-native
mocks.js-dependencies/react-navigation-stack
mocks.js-dependencies/react-navigation-bottom-tabs
mocks.js-dependencies/react-native-haptic-feedback
mocks.js-dependencies/mock
quo.previews.main/init
status-im.chat.models.message-list-test/descending-range
status-im.chat.models.message-list-test/random-range
status-im.ethereum.eip165/supports?
status-im.utils.hex/valid-hex?
status-im.multiaccounts.core/chat-send?
status-im.hardwallet.simulated-keycard/install-cash-applet
status-im.hardwallet.simulated-keycard/sign-typed-data
status-im.utils.core/safe-read-message-content
status-im.ui.components.react/native-modules
status-im.ui.components.react/progress-bar
status-im.utils.fs/move-file
status-im.utils.fs/read-dir
status-im.utils.fs/mkdir
status-im.utils.fs/unlink
status-im.utils.fs/file-exists?
quo.animated/code
quo.animated/eq
quo.animated/neq
quo.animated/greater-or-eq
quo.animated/not*
quo.animated/or*
quo.animated/and*
quo.animated/add
quo.animated/sub
quo.animated/multiply
quo.animated/abs
quo.animated/min*
quo.animated/max*
quo.animated/set
quo.animated/start-clock
quo.animated/stop-clock
quo.animated/bezier
quo.animated/linear
quo.animated/set-value
quo.animated/clock
quo.animated/debug
quo.animated/log
quo.animated/event
quo.animated/on-change
quo.animated/cond*
quo.animated/block
quo.animated/call*
quo.animated/timing
quo.animated/spring
quo.animated/clamp
quo.animated/with-spring
quo.animated/with-timing
quo.animated/re-timing
quo.design-system.colors/white
quo.design-system.colors/black
status-im.transport.core-test/messages
status-im.ethereum.core/sidechain?
status-im.ethereum.core/network-with-upstream-rpc?
status-im.ethereum.core/current-address
status-im.ethereum.core/network->network-name
status-im.ethereum.core/estimate-gas
quo.core/animated-header
quo.core/safe-area-provider
quo.core/safe-area-consumer
quo.core/safe-area-view
status-im.utils.universal-links.core/open!
status-im.transport.filters.core-test/member-2
status-im.ui.screens.chat.ttt/one-to-one-chat-description-container
status-im.ethereum.ens/ttl
status-im.ethereum.ens/addr-hash
status-im.ethereum.ens/name-hash
status-im.ethereum.ens/ABI-hash
status-im.ethereum.ens/pubkey-hash
status-im.network.core/get-network
status-im.constants/desktop-content-types
status-im.constants/blocks-per-hour
status-im.constants/one-earth-day
status-im.constants/left-pane-min-width
status-im.constants/system
status-im.constants/contact-discovery
status-im.constants/send-transaction-failed-parse-response
status-im.constants/send-transaction-failed-parse-params
status-im.constants/send-transaction-no-account-selected
status-im.constants/send-transaction-invalid-tx-sender
status-im.constants/web3-get-logs
status-im.constants/web3-transaction-receipt
status-im.constants/web3-new-filter
status-im.constants/web3-new-pending-transaction-filter
status-im.constants/web3-new-block-filter
status-im.constants/web3-uninstall-filter
status-im.constants/web3-get-filter-changes
status-im.constants/web3-shh-post
status-im.constants/web3-shh-new-identity
status-im.constants/web3-shh-has-identity
status-im.constants/web3-shh-new-group
status-im.constants/web3-shh-add-to-group
status-im.constants/web3-shh-new-filter
status-im.constants/web3-shh-uninstall-filter
status-im.constants/web3-shh-get-filter-changes
status-im.constants/web3-shh-get-messages
status-im.constants/status-create-address
status-im.constants/event-transfer-hash
status-im.constants/regx-rtl-characters
status-im.constants/desktop-msg-chars-hard-limit
status-im.constants/debug-metrics
status-im.constants/scan-qr-code
status-im.constants/ipfs-proto-code
status-im.constants/swarm-proto-code
status-im.multiaccounts.update.publisher/publish-update!
status-im.utils.async/task-queue
status-im.utils.async/async-periodic-run!
status-im.desktop.core/app-root
status-im.desktop.core/init
status-im.chat.models-test/test-db
quo.design-system.spacing/padding-vertical
status-im.utils.money/percent-change
status-im.utils.platform/isMacOs?
status-im.utils.platform/isNix?
status-im.utils.platform/isWin?
status-im.utils.platform/android-version>=
status-im.utils.debounce/clear-all
status-im.transport.db/create-chat
status-im.utils.priority-map/priority-map
status-im.utils.priority-map/priority-map-by
status-im.utils.priority-map/priority-map-keyfn
status-im.utils.priority-map/empty-message-map
status-im.wallet.choose-recipient.core/use-default-eth-gas
status-im.ui.components.animation/decay
status-im.ui.components.animation/remove-all-listeners
status-im.ui.components.animation/stop-animation
status-im.ui.components.animation/animated
status-im.ui.components.animation/add
status-im.ui.components.animation/subtract
status-im.ui.components.animation/get-layout
status-im.wallet.transactions-test/uri-query-data
quo.react-native/touchable-highlight
status-im.utils.name/shortened-name
status-im.ui.components.button.haptic/trigger
status-im.contact.db/filter-dapps
status-im.contact.db/filter-group-contacts
status-im.contact.db/legacy-pending?
status-im.utils.transducers-test/preview-call-1
status-im.utils.transducers-test/preview-call-2
status-im.utils.types/to-string
status-im.chat.db/datemark?
status-im.chat.db/gap?
status-im.chat.db/map->sorted-seq
status-im.utils.snoopy/status-module-filter
status-im.utils.snoopy/websocket-filter
status-im.utils.snoopy/touches-filter
status-im.utils.snoopy/native-animation-filter
status-im.utils.snoopy/keyboard-observer-filter
status-im.utils.multihash/hex
status-im.utils.multihash/decode-array

View File

@ -4,9 +4,6 @@
(def spacing-char " ")
(def arg-wrapping-char "\"")
(def input-height 56)
(def input-spacing-top 16)
(def spam-message-frequency-threshold 4)
(def spam-interval-ms 1000)
(def default-cooldown-period-ms 10000)

View File

@ -56,11 +56,6 @@
[{:keys [current-chat-id] :as db} kvs]
(update-in db [:chat-ui-props current-chat-id] merge kvs))
(defn toggle-chat-ui-prop
"Toggles chat ui prop in active chat"
[{:keys [current-chat-id] :as db} ui-element]
(update-in db [:chat-ui-props current-chat-id ui-element] not))
(defn dissoc-join-time-fields [db chat-id]
(update-in db [:chats chat-id] dissoc
:join-time-mail-request-id

View File

@ -29,27 +29,6 @@
(:line-count content)))
(assoc :should-collapse? true)))
(defn system-message? [{:keys [message-type]}]
(= constants/message-type-private-group-system-message message-type))
(defn build-desktop-notification
[{:keys [db] :as cofx} {:keys [chat-id timestamp content from] :as message}]
(let [{:keys [group-chat] :as chat} (get-in db [:chats chat-id])
contact-name (get-in db [:contacts/contacts from :name]
(:name (contact.db/public-key->new-contact from)))
chat-name (if group-chat
(chat.db/group-chat-name chat)
contact-name)
;; contact name and chat-name are the same in 1-1 chats
shown-chat-name (when group-chat chat-name)
timestamp' (when-not (< (time/seconds-ago (time/to-date timestamp)) 15)
(str " @ " (time/to-short-str timestamp)))
body-first-line (when (or shown-chat-name timestamp')
(str shown-chat-name timestamp' ":\n"))]
{:title contact-name
:body (str body-first-line (:text content))
:prioritary? (not (chat-model/multi-user-chat? cofx chat-id))}))
(fx/defn rebuild-message-list
[{:keys [db]} chat-id]
{:db (assoc-in db [:chats chat-id :message-list]

View File

@ -7,8 +7,6 @@
[:italic constants/regx-italic]
[:backquote constants/regx-backquote]])
(def styling-keys (into #{} (map first) stylings))
(def ^:private actions [[:link constants/regx-url]
[:tag constants/regx-tag]
[:mention constants/regx-mention]])
@ -18,30 +16,6 @@
(defn- blank-string [size]
(.repeat ^js blank size))
(defn- clear-ranges [ranges input]
(reduce (fn [acc [start end]]
(.concat ^js (subs acc 0 start) (blank-string (- end start)) (subs acc end)))
input ranges))
(defn- query-regex [^js regex content]
(loop [input content
matches []
offset 0]
(if-let [^js match (.exec regex input)]
(let [match-value (first match)
match-size (count match-value)
relative-index (.-index match)
start-index (+ offset relative-index)
end-index (+ start-index match-size)]
(recur (subs input (+ relative-index match-size))
(conj matches [start-index end-index])
end-index))
(seq matches))))
(defn- right-to-left-text? [text]
(and (seq text)
(re-matches constants/regx-rtl-characters (first text))))
(defn should-collapse? [text line-count]
(or (<= constants/chars-collapse-threshold (count text))
(<= constants/lines-collapse-threshold (inc line-count))))
@ -55,34 +29,6 @@
{})
(sort-by ffirst)))
(defn build-render-recipe
"Builds render recipe from message text and metadata, can be used by render code
by simply iterating over it and paying attention to `:kind` set for each segment of text.
Optional in optional 2 arity version, you can pass collection of keys determining which
metadata to include in the render recipe (all of them by default)."
([content]
(build-render-recipe content nil))
([{:keys [text metadata] :as content} metadata-keys]
(when metadata
(let [[offset builder] (->> (sorted-ranges content metadata-keys)
(reduce (fn [[offset builder] [[start end] kind]]
(if (< start offset)
[offset builder] ;; next record is nested, not allowed, discard
(let [record-text (subs text start end)
record (if (styling-keys kind)
[(subs record-text 1
(dec (count record-text))) kind]
[record-text kind])]
(if-let [padding (when-not (= offset start)
[(subs text offset start) :text])]
[end (conj builder padding record)]
[end (conj builder record)]))))
[0 []]))
end-record (when-not (= offset (count text))
[(subs text offset (count text)) :text])]
(cond-> builder
end-record (conj end-record))))))
(defn emoji-only-content?
"Determines if text is just an emoji"
[{:keys [text response-to]}]

View File

@ -11,14 +11,6 @@
[status-im.utils.clocks :as utils.clocks]
[status-im.utils.core :as utils]))
(defn remove-empty-vals
"Remove key/value when empty seq or nil"
[e]
(into {} (remove (fn [[_ v]]
(or (nil? v)
(and (coll? v)
(empty? v)))) e)))
(def one-to-one-chat-type 1)
(def public-chat-type 2)
(def private-group-chat-type 3)
@ -33,9 +25,6 @@
#(vector % (get event %))
(sort (keys event))))))
; Build an event id from a message
(def event-id (comp ethereum/sha3 event->string))
(defn type->rpc [{:keys [public? group-chat] :as chat}]
(assoc chat :chatType (cond
public? public-chat-type

View File

@ -28,11 +28,6 @@
[v]
(apply str v))
(defn hardwallet-supported? []
(and config/hardwallet-enabled?
platform/android?
(nfc/nfc-supported?)))
(defn get-card-state
[{:keys [has-master-key?
applet-installed?

View File

@ -42,10 +42,6 @@
(seq (clojure.set/difference (:chat-ids new-mailserver-topic)
(:chat-ids previous-mailserver-topic))))
(defn new-filter-ids? [previous-mailserver-topic new-mailserver-topic]
(seq (clojure.set/difference (:chat-ids new-mailserver-topic)
(:chat-ids previous-mailserver-topic))))
(defn merge-topic
"Calculate last-request and merge chat-ids keeping the old ones and new ones"
[old-mailserver-topic

View File

@ -13,9 +13,6 @@
{:color colors/gray
:ios {:margin-top 5}})
(def paste-json-text-input
{:font-size 17})
(def connect-button-container
{:margin-top 8
:margin-bottom 16
@ -54,30 +51,6 @@
:ios {:opacity 0.8}
:android {:opacity 0.4}})
(def edit-button-container
{:align-items :center
:margin-vertical 16
:margin-horizontal 16})
(styles/def edit-button
{:height 52
:align-items :center
:justify-content :center
:background-color colors/blue
:border-radius 8
:ios {:width 343}
:android {:width 328}})
(def edit-button-label
{:color colors/blue
:font-size 17})
(def edit-button-description
{:text-align :center
:color colors/gray
:margin-top 8
:font-size 14})
(defn network-icon [connected? size]
{:width size
:height size

View File

@ -99,18 +99,6 @@
(fx/defn init [cofx]
{:pairing/get-our-installations (waku/enabled? cofx)})
(defn handle-bundles-added [{:keys [db] :as cofx} bundle]
(let [installation-id (:installationID bundle)]
(when
(and (= (:identity bundle)
(multiaccounts.model/current-public-key cofx))
(not= (get-in db [:multiaccount :installation-id]) installation-id))
(fx/merge cofx
(init)
#(when-not (or (:pairing/prompt-user-pop-up db)
(= :installations (:view-id db)))
(prompt-user-on-new-installation %))))))
(fx/defn enable [{:keys [db]} installation-id]
{:db (assoc-in db
[:pairing/installations installation-id :enabled?]

View File

@ -11,13 +11,6 @@
[status-im.utils.fx :as fx]
[status-im.utils.types :as types]))
(defn- js-obj->seq [^js obj]
;; Sometimes the filter will return a single object instead of a collection
(if (array? obj)
(for [i (range (.-length obj))]
(aget obj i))
[obj]))
(fx/defn handle-chats [cofx chats]
(models.chat/ensure-chats cofx chats))
@ -125,10 +118,4 @@
:message-type message-type})
(update-in [:transport/message-ids->confirmations message-id]
#(or % {:pending-confirmations messages-count})))})]
(apply fx/merge cofx (conj check-confirmations-fx add-envelope-data))))
(defn- own-info [db]
(let [{:keys [name photo-path address]} (:multiaccount db)]
{:name name
:profile-image photo-path
:address address}))
(apply fx/merge cofx (conj check-confirmations-fx add-envelope-data))))

View File

@ -50,18 +50,6 @@
(<= min-velocity vy)
(> (* cancellation-coefficient height) (- height dy))))
(defn- cancel
([opts] (cancel opts nil))
([{:keys [height bottom-value show-sheet? opacity-value]} callback]
(animate {:bottom bottom-value
:new-bottom-value height
:opacity opacity-value
:new-opacity-value 0
:duration cancellation-animation-duration
:callback #(do (reset! show-sheet? false)
(animation/set-value bottom-value height)
(when (fn? callback) (callback)))})))
(defn- on-release
[{:keys [height bottom-value close-sheet opacity-value]}]
(fn [_ state]

View File

@ -25,10 +25,6 @@
(second name)
(first name)))]]))
(defn default-browser-icon [name]
(default-chat-icon name {:default-chat-icon (styles/default-chat-icon-chat-list colors/default-chat-color)
:default-chat-icon-text (styles/default-chat-icon-text 40)}))
(defn dapp-badge [{:keys [online-view-wrapper online-view online-dot-left online-dot-right]}]
[react/view online-view-wrapper
[react/view online-view
@ -97,18 +93,6 @@
(when dapp?
[dapp-badge styles])])
(defn contact-icon-view-chat [contact]
[contact-icon-view contact
{:container styles/container-chat-list
:online-view-wrapper styles/online-view-wrapper
:online-view styles/online-view
:online-dot-left styles/online-dot-left
:online-dot-right styles/online-dot-right
:size 60
:chat-icon styles/chat-icon-chat-list
:default-chat-icon (styles/default-chat-icon-chat-list colors/default-chat-color)
:default-chat-icon-text (styles/default-chat-icon-text 60)}])
(defn contact-icon-contacts-tab [contact]
[contact-icon-view contact
{:container styles/container-chat-list
@ -121,15 +105,6 @@
:default-chat-icon (styles/default-chat-icon-chat-list colors/default-chat-color)
:default-chat-icon-text (styles/default-chat-icon-text 40)}])
(defn dapp-icon-browser [contact size]
[contact-icon-view contact
{:container {:width size :height size :top 3 :margin-left 2}
:online-view-wrapper styles/online-view-wrapper
:size size
:chat-icon (styles/custom-size-icon size)
:default-chat-icon (styles/default-chat-icon-chat-list colors/default-chat-color)
:default-chat-icon-text (styles/default-chat-icon-text size)}])
(defn dapp-icon-permission [contact size]
[contact-icon-view contact
{:container {:width size :height size}
@ -176,15 +151,4 @@
(multiaccounts/displayed-name multiaccount)
color
edit?
size {}]))
(defn my-profile-header-icon [{multiaccount :multiaccount
edit? :edit?}]
(let [color colors/default-chat-color
size 40]
[profile-icon-view
(multiaccounts/displayed-photo multiaccount)
(multiaccounts/displayed-name multiaccount)
color
edit?
size {}]))
size {}]))

View File

@ -28,29 +28,12 @@
:height size
:border-radius (/ size 2)}))
(defn default-chat-icon-view-action [color]
(merge (default-chat-icon color)
{:width 36
:height 36
:border-radius 18}))
(defn default-chat-icon-message-status [color]
(merge (default-chat-icon color)
{:width 64
:height 64
:border-radius 32}))
(defn default-chat-icon-text [size]
{:color colors/white-transparent-70-persist
:font-weight "700"
:font-size (/ size 2)
:line-height size})
(def message-status-icon-text
{:margin-top -2
:color colors/white
:font-size 24})
(def chat-icon
{:margin 4
:border-radius 20
@ -75,29 +58,12 @@
:height size
:margin 0}))
(def chat-icon-menu-item
{:width 24
:height 24
:border-radius 12})
(def chat-icon-profile
(merge chat-icon
{:width 64
:height 64
:border-radius 32}))
(def chat-icon-view-action
(merge chat-icon
{:width 36
:height 36
:border-radius 18
:margin 0}))
(def chat-icon-message-status
{:border-radius 32
:width 64
:height 64})
(def online-view-wrapper
{:position :absolute
:bottom -2
@ -107,15 +73,6 @@
:border-radius 11
:background-color colors/white})
(def online-view-menu-wrapper
{:position :absolute
:bottom 0
:right -1
:width 16
:height 16
:border-radius 8
:background-color colors/white})
(def online-view
{:position :absolute
:bottom 2
@ -125,14 +82,6 @@
:border-radius 9
:background-color colors/blue})
(def online-view-menu-item
(merge online-view
{:width 14
:height 14
:border-radius 7
:bottom 1
:right 1}))
(def online-view-profile
(merge online-view
{:width 24
@ -149,18 +98,6 @@
(def online-dot-left (merge online-dot {:left 2.8}))
(def online-dot-right (merge online-dot {:left 7.2}))
(def online-dot-menu-item
(merge online-dot
{:top 4
:width 3
:height 3}))
(def online-dot-left-menu-item
(merge online-dot-menu-item {:left 2.5
:top 5}))
(def online-dot-right-menu-item
(merge online-dot-menu-item {:left 8
:top 5}))
(def online-dot-profile
(merge online-dot
{:top 8
@ -172,10 +109,6 @@
(def online-dot-right-profile
(merge online-dot-profile {:left 11}))
(def container
{:width 44
:height 44})
(def container-chat-list
{:width 40
:height 40})
@ -188,33 +121,6 @@
{:width 36
:height 36})
(def container-menu-item
{:width 24
:height 24})
(def container-profile
{:width 72
:height 72})
(def container-message-status
{:margin-top 20})
(def default-image-style
{:margin 4})
(defn border-style [size]
{:width size
:height size
:border-radius (/ size 2)
:background-color :#b9c8d6
:padding 0.5})
(defn image-style [size]
(let [image-size (dec size)]
{:width image-size
:height image-size
:border-radius (/ image-size 2)}))
(defn profile-icon-mask [size]
{:height size
:width size

View File

@ -10,8 +10,4 @@
:justify-content :center
:border-radius 2
:width 18
:height 18})
(def check-icon
{:width 16
:height 16})
:height 18})

View File

@ -27,9 +27,6 @@
(def themes {:dark dark :light light})
;; TRANSPARENT
(def transparent "transparent")
;; WHITE
(def white (:white light))
(def white-persist (:white light)) ;; this doesn't with theme

View File

@ -16,10 +16,6 @@
[react/view (merge styles/separator-wrapper wrapper-style)
[react/view (merge styles/separator style)]])
;;TODO DEPRECATED, use status-im.ui.components.list-item.views
(defn list-separator []
[separator styles/list-separator])
;;TODO DEPRECATED, use status-im.ui.components.button
(defn bottom-button [{:keys [accessibility-label
label

View File

@ -11,18 +11,6 @@
:background-color colors/black-transparent
:opacity 0.5}})
(def list-separator
{:margin-left 72})
(def network-container
{:flex-direction :row
:padding-horizontal 13
:padding-vertical 11
:align-items :center})
(def label-action-text
{:color colors/blue})
(defn logo-container [size]
{:width size
:height size

View File

@ -1,25 +1,6 @@
(ns status-im.ui.components.contact.contact
(:require [clojure.string :as string]
[status-im.i18n :as i18n]
[status-im.ui.components.chat-icon.screen :as chat-icon]
[status-im.ui.components.contact.styles :as styles]
[status-im.ui.components.icons.vector-icons :as vector-icons]
[status-im.ui.components.list-selection :as list-selection]
[status-im.ethereum.stateofus :as stateofus]
[status-im.ui.components.list.views :as list]
[status-im.ui.components.react :as react]
[status-im.utils.gfycat.core :as gfycat]
[status-im.utils.platform :as platform])
(:require-macros [status-im.utils.views :as views]))
(defn desktop-extended-options [options]
[react/view {}
(doall (for [{:keys [label action]} options]
^{:key label}
[react/touchable-highlight
{:on-press action}
[react/view {}
[react/text label]]]))])
(:require [status-im.ethereum.stateofus :as stateofus]
[status-im.utils.gfycat.core :as gfycat]))
(defn format-name [{:keys [ens-verified name public-key]}]
(if ens-verified

View File

@ -1,44 +0,0 @@
(ns status-im.ui.components.contact.styles
(:require [status-im.ui.components.colors :as colors]))
(def contact-container
{:flex-direction :row
:justify-content :center
:align-items :center
:padding-vertical 12
:padding-horizontal 16})
(def info-container-to-refactor
{:flex 1
:flex-direction :column
:margin-left 16
:justify-content :center})
(def info-container
{:flex 1
:justify-content :center})
(defn name-text []
{:color colors/gray
:font-size 17})
(defn info-text []
{:margin-top 1
:font-size 12
:color colors/gray})
(def forward-btn
{:opacity 0.4
:padding 12
:align-items :center
:justify-content :center})
(def toggle-container
{:width 56
:height 56
:alignItems :center
:justifyContent :center})
(def check-icon
{:width 16
:height 16})

View File

@ -72,9 +72,6 @@
(def right-item-wrapper
{:justify-content :center})
(def settings-item-separator
{:margin-left 16})
(def settings-item
{:padding-left 16
:padding-right 8
@ -146,10 +143,6 @@
base-separator
{:margin-left 64}))
(styles/def list-header-footer-spacing
{:android {:background-color colors/white
:height 8}})
(styles/def section-header
{:font-size 14
:color colors/gray
@ -158,48 +151,4 @@
:android {:margin-bottom 3}
:ios {:margin-bottom 10}})
(def section-header-container {})
(def action-list
{:background-color colors/blue})
(def action
{:background-color colors/white-transparent-10
:border-radius 50})
(def action-disabled
{:background-color colors/gray-lighter})
(def action-label
{:color colors/white})
(def action-label-disabled
{:color colors/gray})
(def action-separator
{:height 1
:background-color colors/white-transparent-10
:margin-left 64})
(def list-with-label-wrapper
{:margin-top 26
:margin-horizontal 16})
(def label
{:color colors/gray})
(def delete-button-width 100)
(def delete-icon-highlight
{:position :absolute
:top 0
:bottom 0
:right -800
:width 800
:background-color colors/red-light})
(def delete-icon-container
{:flex 1
:width delete-button-width
:justify-content :center
:align-items :center})
(def section-header-container {})

View File

@ -114,11 +114,6 @@
[react/view {:style (merge style styles/item-checkbox)}
[radio/radio (:checked? props)]])])
(def item-icon-forward
[item-icon {:icon :main-icons/next
:style {:width 12}
:icon-opts {:color colors/white}}])
;;TODO DEPRECATED, use status-im.ui.components.list-item.views
(defn big-list-item
[{:keys [style text text-color text-style subtext value action-fn active? destructive? hide-chevron?
@ -184,10 +179,6 @@
(def default-separator [react/view styles/separator])
(def default-header [react/view styles/list-header-footer-spacing])
(def default-footer [react/view styles/list-header-footer-spacing])
(defn- base-list-props
[{:keys [key-fn render-fn empty-component header footer separator default-separator?]}]
(let [separator (or separator (when (and platform/ios? default-separator?) default-separator))]
@ -259,10 +250,3 @@
{:sections (clj->js (map wrap-per-section-render-fn sections))
:renderSectionHeader (wrap-render-section-header-fn render-section-header-fn)
:style style})])
;;TODO DEPRECATED, use status-im.ui.components.list-item.views
(defn list-with-label [{:keys [style]} label list]
[react/view (merge styles/list-with-label-wrapper style)
[react/text {:style styles/label}
label]
list])

View File

@ -32,10 +32,4 @@
(show {:title (i18n/label :t/browsing-title)
:options [{:label (i18n/label (platform-web-browser))
:action #(.openURL ^js react/linking (http/normalize-url link))}]
:cancel-text (i18n/label :t/browsing-cancel)}))
(defn browse-dapp [link]
(show {:title (i18n/label :t/browsing-title)
:options [{:label (i18n/label :t/browsing-open-in-status)
:action #(re-frame/dispatch [:browser.ui/open-url link])}]
:cancel-text (i18n/label :t/browsing-cancel)}))
:cancel-text (i18n/label :t/browsing-cancel)}))

View File

@ -1,37 +0,0 @@
(ns status-im.ui.components.popup-menu.views
(:require [status-im.ui.components.react :as react]
[status-im.utils.platform :as platform]
[status-im.i18n :as i18n]
[re-frame.core :as re-frame]
[taoensso.timbre :as log]
[status-im.utils.config :as config]))
(defn get-chat-menu-items [group-chat public? chat-id]
(->> [(when (and (not group-chat) (not public?))
{:text (i18n/label :t/view-profile)
:on-select #(re-frame/dispatch [:show-profile-desktop chat-id])})
(when (and group-chat (not public?))
{:text (i18n/label :t/group-info)
:on-select #(re-frame/dispatch [:show-group-chat-profile])})
{:text (i18n/label :t/mark-all-read)
:on-select #(re-frame/dispatch [:chat.ui/mark-all-read-pressed chat-id])}
{:text (i18n/label :t/clear-history)
:on-select #(re-frame/dispatch [:chat.ui/clear-history-pressed chat-id])}
{:text (i18n/label :t/fetch-history)
:on-select #(re-frame/dispatch [:chat.ui/fetch-history-pressed chat-id])}
#_{:text "Fetch 48-60h"
:on-select #(re-frame/dispatch [:chat.ui/fetch-history-pressed48-60 chat-id])}
#_{:text "Fetch 84-96h"
:on-select #(re-frame/dispatch [:chat.ui/fetch-history-pressed84-96 chat-id])}
{:text (i18n/label :t/delete-chat)
:on-select #(re-frame/dispatch [(if (and group-chat (not public?))
:group-chats.ui/leave-chat-pressed
:chat.ui/remove-chat-pressed)
chat-id])}]
(remove nil?)))
(defn get-message-menu-items [chat-id message-id]
[{:text (i18n/label :t/resend-message)
:on-select #(re-frame/dispatch [:chat.ui/resend-message chat-id message-id])}
{:text (i18n/label :t/delete-message)
:on-select #(re-frame/dispatch [:chat.ui/delete-message chat-id message-id])}])

View File

@ -1,12 +1,6 @@
(ns status-im.ui.components.qr-code-viewer.styles
(:require [status-im.ui.components.colors :as colors]))
(def qr-code-hint
{:color colors/gray
:margin-vertical 12
:text-align :center})
(def qr-code-max-width 208)
(def qr-code-padding 16)
(defn qr-code-container [width]
@ -19,39 +13,4 @@
:align-items :center
:justify-content :center
:border-width 1
:border-radius 8})
(def name-text
{:font-size 17})
(def address-text
{:color colors/white
:font-size 12})
(def wallet-qr-code
{:flex-grow 1
:flex-direction :column})
(def account-toolbar
{:background-color colors/white})
(def footer
{:flex-direction :row
:justify-content :center})
(def wallet-info
{:flex-grow 1
:align-items :center})
(def hash-value-text
{:align-self :stretch
:border-color colors/black-transparent
:border-width 1
:margin-horizontal 16
:padding-horizontal 8
:padding-vertical 6
:border-radius 8
:text-align :center})
(def done-button-text
{:color colors/white})
:border-radius 8})

View File

@ -31,9 +31,6 @@
(def text-class (reagent/adapt-react-class (.-Text react-native)))
(def text-input-class (reagent/adapt-react-class (.-TextInput react-native)))
(def image-class (reagent/adapt-react-class (.-Image react-native)))
(def picker-class (reagent/adapt-react-class (.-Picker react-native)))
(def picker-item-class (reagent/adapt-react-class (.-Item (.-Picker react-native))))
(defn valid-source? [source]
(or (not (map? source))
(not (contains? source :uri))
@ -62,8 +59,6 @@
:ios {:size :small}
:android {:size :16}}])
(def modal (reagent/adapt-react-class (.-Modal react-native)))
(def pan-responder (.-PanResponder react-native))
(def animated (.-Animated react-native))
@ -162,14 +157,6 @@
[{:keys [style key]}]
[text {:style style} (i18n/label key)])
(defn icon
([n] (icon n {:width 24
:height 24}))
([n style]
[image {:source {:uri (keyword (str "icon_" (name n)))}
:resizeMode "contain"
:style style}]))
(defn touchable-opacity [props content]
[touchable-opacity-class props content])
@ -186,20 +173,6 @@
(defn get-dimensions [name]
(js->clj (.get ^js dimensions name) :keywordize-keys true))
(defn list-item [component]
(reagent/as-element component))
(defn value->picker-item [{:keys [value label]}]
[picker-item-class {:value (or value "") :label (or label value "")}])
(defn picker [{:keys [style on-change selected enabled data]}]
(into
[picker-class (merge (when style {:style style})
(when enabled {:enabled enabled})
(when on-change {:on-value-change on-change})
(when selected {:selected-value selected}))]
(map value->picker-item data)))
;; Image picker
(defn show-access-error [o]
(when (= "E_PERMISSION_MISSING" (.-code ^js o))
@ -257,6 +230,4 @@
(def safe-area-provider (reagent/adapt-react-class SafeAreaProvider))
(def safe-area-consumer (reagent/adapt-react-class SafeAreaConsumer))
(def safe-area-view (reagent/adapt-react-class SafeAreaView))
(def touchable-without-feedback-gesture (reagent/adapt-react-class TouchableWithoutFeedback))
(def safe-area-view (reagent/adapt-react-class SafeAreaView))

View File

@ -14,9 +14,6 @@
(def tabs-diff (- tabs-height minimized-tabs-height))
(def minimized-tab-ratio
(/ tabs-height minimized-tabs-height))
(def counter
{:right 0
:top 0

View File

@ -3,11 +3,6 @@
[status-im.ui.components.toolbar.styles :as styles]
[status-im.ui.components.colors :as colors]))
(defn add [illuminated? handler]
{:icon :main-icons/add
:icon-opts (if illuminated? styles/icon-add-illuminated styles/icon-add)
:handler handler})
(defn opts [options]
{:icon :main-icons/more
:options options})
@ -19,34 +14,13 @@
(def default-handler #(re-frame/dispatch [:navigate-back]))
(def home-handler #(re-frame/dispatch [:navigate-to :home]))
(def default-back
(back default-handler))
(def home-back
(back home-handler))
(defn back-white [handler]
{:icon :main-icons/back
:icon-opts {:color colors/white}
:handler handler
:accessibility-label :back-button})
(defn close [handler]
{:icon :main-icons/close
:handler handler
:accessibility-label :done-button})
(def default-close
(close default-handler))
(defn close-white [handler]
{:icon :main-icons/close
:icon-opts {:color colors/white}
:handler handler})
(defn list-white [handler]
{:icon :main-icons/two-arrows
:icon-opts {:color colors/white}
:handler handler})
(close default-handler))

View File

@ -2,14 +2,6 @@
(:require [status-im.ui.components.colors :as colors]))
(def toolbar-height 56)
(def toolbar-icon-width 24)
(def toolbar-icon-height 24)
(def toolbar-icon-spacing 24)
(def toolbar
{:height 55
:flex 1})
(def toolbar-title-container
{:justify-content :center
:align-items :center
@ -19,45 +11,14 @@
{:typography :title-bold
:text-align :center})
(defn toolbar-actions-container [actions-count custom]
(merge {:flex-direction :row}
(when-not custom {:margin-right 4})
(when (and (zero? actions-count) (not custom))
{:width (+ toolbar-icon-width toolbar-icon-spacing)})))
(def touchable-area
{:width 56
:height 56
:justify-content :center
:align-items :center})
(def action-default
{:width 24
:height 24})
(def item-text
{:color colors/blue})
(def item-text-action
{:color colors/blue})
(def toolbar-text-action-disabled
{:color colors/gray})
(def item-text-white-background
{:color colors/blue})
(def icon-add
{:width 24
:height 24
:color colors/blue})
(def icon-add-illuminated
{:width 24
:height 24
:color colors/blue
:container-style {:background-color colors/blue-transparent-10
:border-radius 28
:display :flex
:justify-content :center
:align-items :center}})
{:color colors/gray})

View File

@ -38,21 +38,11 @@
props)
text]]))
(defn nav-clear-text
([text] (nav-clear-text nil text))
([props text]
(nav-text (merge props styles/item-text-white-background) text)))
(def nav-back-home [nav-button actions/home-back])
(def default-nav-back [nav-button actions/default-back])
(def default-nav-close [nav-button actions/default-close])
;; Content
(defn content-wrapper [content]
[react/view {:style {:flex 1}}
content])
(defn content-title
([title] (content-title nil title))
([title-style title]

View File

@ -8,36 +8,6 @@
:font-weight "400"
:font-size 15})
(defn get-line-height
[font-size]
(get {10 14
11 15
12 16
13 17
14 19
15 21
16 22
17 23
18 23
19 24
20 26
21 27
22 28
23 30
24 31
25 32
26 34
27 35
28 35
29 36
30 37
31 38
32 40
33 41
34 42
40 50}
font-size))
(def typography-styles
{:header {:font-weight "700"
:font-size 22}

View File

@ -9,8 +9,6 @@
(def webview-class
(reagent/adapt-react-class rn-webview))
(defn module [] (.-WebViewModule ^js (.-NativeModules react-native)))
(defn webview [{:keys [dapp? dapp-name] :as opts}]
(if (and config/cached-webviews-enabled? platform/android? dapp?)
(reagent.core/create-class

View File

@ -1,23 +1,6 @@
(ns status-im.ui.screens.about-app.styles
(:require [status-im.ui.components.colors :as colors]))
(def peer-view
{:background-color colors/white
:padding-bottom 5
:padding-horizontal 16})
(def peer-text
{:font-size 10})
(def about-title
{:background-color colors/white
:font-size 20
:padding-vertical 5
:padding-horizontal 16})
(def about-title-text
{:font-size 20})
(def learn-more-title
{:typography :title-bold})

View File

@ -5,10 +5,4 @@
{:margin-horizontal 16
:align-self :center
:font-size 12
:color colors/gray})
(def list-title
{:margin-top 24
:margin-left 16
:font-size 14
:color colors/gray})
:color colors/gray})

View File

@ -17,30 +17,6 @@
{:flex 1
:flex-direction :column})
(def chat-name-container
{:margin-top 10})
(def members-text
{:color colors/gray
:font-size 16})
(def section-title
(merge members-text
{:padding-horizontal 16}))
(def public-chat-icon
{:background-color colors/blue
:border-radius 50
:width 40
:height 40
:align-items :center
:justify-content :center})
(def public-chat-icon-symbol
{:font-size 20
:text-transform :uppercase
:color colors/white})
(def input-container
{:padding 0
:padding-right 16

View File

@ -43,11 +43,6 @@
(when error
[tooltip/tooltip error styles/tooltip])])
(defn- public-chat-icon [topic]
[react/view styles/public-chat-icon
[react/text {:style styles/public-chat-icon-symbol}
(first topic)]])
(defn render-topic [topic]
^{:key topic}
[react/touchable-highlight {:on-press #(start-chat topic)

View File

@ -20,12 +20,6 @@
(input-container)
{:flex 1}))
(def button-container
{:justify-content :center
:border-radius components.styles/border-radius
:padding-horizontal 16
:height 52})
(styles/def input
{:flex 1
:height 52

View File

@ -33,37 +33,12 @@
:padding-horizontal 44
:align-items :center})
(def privacy-container
{:margin-horizontal 16
:margin-top 8
:border-color colors/gray-lighter
:border-width 1
:border-radius 12
:padding-vertical 8
:padding-left 16})
(def open-dapp-store
{:margin-top 12
:font-size 15
:font-weight "500"
:line-height 22})
(def close-icon-container
{:width 21
:height 21
:border-radius 12
:background-color colors/gray
:align-items :center
:justify-content :center})
(def might-break
{:margin-left 34
:font-size 13
:font-weight "500"
:color colors/gray
:line-height 18
:margin-top 2})
(defn dapps-account [color]
{:flex-direction :row
:background-color color

View File

@ -4,20 +4,6 @@
(def browser {:flex 1})
(styles/def dapp-name
{:flex 1
:justify-content :center
:margin-left 12
:android {:padding-bottom 6}})
(def dapp-name-text
{:font-size 16})
(styles/def dapp-text
{:color colors/gray
:ios {:margin-top 4}
:android {:font-size 13}})
(defn navbar []
{:background-color colors/white
:height 51
@ -31,18 +17,6 @@
(def disabled-button
{:opacity 0.4})
(def forward-button
{:margin-left 72})
(def share-button
{:margin-right 72})
(def background
{:flex 1
:background-color colors/gray-lighter
:align-items :center
:justify-content :center})
(def web-view-error
{:flex 1
:justify-content :center

View File

@ -6,7 +6,6 @@
[status-im.ui.components.colors :as colors]
[status-im.utils.security :as security]
[status-im.ui.components.icons.vector-icons :as vector-icons]
[status-im.ui.components.popup-menu.views :as desktop.pop-up]
[status-im.ui.components.react :as react]
[status-im.ui.screens.chat.sheets :as sheets]
[status-im.ui.screens.chat.photos :as photos]

View File

@ -1,61 +0,0 @@
(ns status-im.ui.screens.chat.message.sheets
(:require [re-frame.core :as re-frame]
[status-im.ui.components.react :as react]
[status-im.ui.screens.chat.styles.message.sheets :as sheets.styles]
[status-im.utils.platform :as platform]
[status-im.ui.components.list-selection :as list-selection]
[status-im.ui.components.list-item.views :as list-item]))
(defn hide-sheet-and-dispatch [event]
(re-frame/dispatch [:bottom-sheet/hide-sheet])
(re-frame/dispatch event))
(defn options [chat-id message-id]
(fn []
[react/view
[react/i18n-text {:style sheets.styles/sheet-text :key :message-not-sent}]
[list-item/list-item
{:theme :action
:title :t/resend-message
:icon :main-icons/refresh
:accessibility-label :resend-message-button
:on-press #(hide-sheet-and-dispatch [:chat.ui/resend-message chat-id message-id])}]
[list-item/list-item
{:theme :action-destructive
:title :t/delete-message
:icon :main-icons/delete
:accessibility-label :delete-transaction-button
:on-press #(hide-sheet-and-dispatch [:chat.ui/delete-message chat-id message-id])}]]))
(defn message-long-press [{:keys [message-id content]}]
(fn []
[react/view
[list-item/list-item
{:theme :action
:title :t/message-reply
:icon :main-icons/reply
:on-press #(hide-sheet-and-dispatch [:chat.ui/reply-to-message message-id])}]
[list-item/list-item
{:theme :action
:title :t/sharing-copy-to-clipboard
:icon :main-icons/copy
:on-press (fn []
(re-frame/dispatch [:bottom-sheet/hide-sheet])
(react/copy-to-clipboard (:text content)))}]
(when-not platform/desktop?
[list-item/list-item
{:theme :action
:title :t/sharing-share
:icon :main-icons/share
:on-press (fn []
(re-frame/dispatch [:bottom-sheet/hide-sheet])
(list-selection/open-share {:message (:text content)}))}])]))
(defn sticker-long-press [{:keys [message-id]}]
(fn []
[react/view
[list-item/list-item
{:theme :action
:title :t/message-reply
:icon :main-icons/reply
:on-press #(hide-sheet-and-dispatch [:chat.ui/reply-to-message message-id])}]]))

View File

@ -11,10 +11,4 @@
:width icon-size
:border-radius (/ icon-size 2)
:align-items :center
:justify-content :center})
(defn stickers-panel-height []
(cond
platform/iphone-x? 299
platform/ios? 258
:else 272))
:justify-content :center})

View File

@ -1,40 +0,0 @@
(ns status-im.ui.screens.chat.styles.animations
(:require [status-im.ui.components.styles :as common]
[status-im.ui.components.colors :as colors]
[status-im.utils.platform :as platform]))
(def header-draggable-icon "rgba(73, 84, 93, 0.23)")
(def overlap-container
{:position :absolute
:left 0
:top 0
:right 0
:bottom 0})
(defn expandable-container [anim-value bottom max-height]
{:background-color colors/white
:left 0
:right 0
:bottom bottom
:position :absolute
:elevation 2
:shadow-offset {:width 0 :height 1}
:shadow-radius 12
:shadow-opacity 0.12
:shadow-color colors/white
:max-height max-height
:transform [{:translateY anim-value}]})
(def header-container
{:min-height 19
:background-color colors/white
:align-items :center})
(def header-icon
{:background-color header-draggable-icon
:margin-top 8
:margin-bottom 6
:width 24
:border-radius 1.5
:height 3})

View File

@ -25,29 +25,8 @@
:margin-top 4
:color colors/text-gray})
(def overlay-highlight
{:flex 1})
;; this map looks a bit strange
;; but this way of setting elevation seems to be the only way to set z-index (in RN 0.30)
(def bottom-info-overlay
{:position :absolute
:top -16
:bottom -16
:left -16
:right -16
:background-color "#00000055"
:elevation 8})
(defn bottom-info-container [height]
{:background-color colors/white
:elevation 2
:position :absolute
:bottom 16
:left 16
:right 16
:height height})
(defn add-contact []
{:flex-direction :row
:align-items :center

View File

@ -1,14 +1,6 @@
(ns status-im.ui.screens.chat.styles.message.datemark
(:require [status-im.ui.components.colors :as colors]))
(def datemark-wrapper
{:flex 1
:align-items :center})
(def datemark
{:margin-top 16
:height 22})
(def datemark-mobile
{:flex 1
:align-items :center

View File

@ -55,12 +55,6 @@
:bottom 9 ; 6 Bubble bottom, 3 message baseline
(if rtl? :left :right) 12})))
(def selected-message
{:margin-top 18
:margin-left 40
:font-size 12
:color colors/text-gray})
(defn message-wrapper-base [message]
(merge {:flex-direction :column}
(last-message-padding message)))
@ -125,12 +119,6 @@
(def message-activity-indicator
{:padding-top 4})
(defn text-message
[collapsed? outgoing]
(assoc (style-message-text outgoing)
:line-height 22
:margin-bottom (if collapsed? 2 0)))
(defn emoji-message
[{:keys [incoming-group]}]
{:font-size 28
@ -165,10 +153,6 @@
(when (= content-type constants/content-type-emoji)
{:flex-direction :row})))
(def play-image
{:width 33
:height 33})
(def status-container
{:padding-horizontal 5})
@ -177,10 +161,6 @@
:font-size 14
:color colors/gray})
(defn message-container [window-width]
{:position :absolute
:width window-width})
(defn message-author-name [chosen?]
{:font-size (if chosen? 13 12)
:font-weight (if chosen? "500" "400")

View File

@ -19,11 +19,6 @@
(def fleet-item-name-text
{:font-size 17})
(def fleet-item-connected-text
{:color colors/gray
:font-size 14
:margin-top 6})
(defn fleet-icon-container [current?]
{:width 40
:height 40

View File

@ -4,36 +4,16 @@
[status-im.utils.styles :as styles]
[status-im.utils.platform :as platform]))
(def tabs-height
(cond
platform/android? 52
platform/ios? 52
platform/desktop? 36))
(defn toolbar-icon [enabled?]
{:width 20
:height 18
:opacity (if enabled? 1 0.3)})
(def group-container
{:flex 1
:flex-direction :column})
(def contact
{:padding-left 0})
(defn no-contact-text []
{:margin-bottom 20
:margin-horizontal 50
:text-align :center
:color colors/gray})
(def number-of-participants-disclaimer
{:margin-top 20
:margin-bottom 5
:font-size 12
:margin-horizontal 17})
(def toolbar-header-container
{:align-items :center})

View File

@ -2,10 +2,6 @@
(:require [status-im.ui.components.colors :as colors]
[status-im.utils.styles :as styles]))
(def container
{:flex 1
:background-color colors/white})
(styles/def pin-container
{:flex 1
:flex-direction :column
@ -86,7 +82,4 @@
(def numpad-button-text
{:font-size 22
:color colors/blue})
(def numpad-empty-button-text
{:color colors/white})
:color colors/blue})

View File

@ -118,23 +118,6 @@
(def pin-retries 3)
(def puk-retries 5)
(defview create-pin []
(letsubs [pin [:hardwallet/pin]
step [:hardwallet/pin-enter-step]
status [:hardwallet/pin-status]
error-label [:hardwallet/pin-error-label]]
[pin-view {:pin pin
:title-label (case step
:confirmation :t/repeat-pin
:current :t/current-pin
:t/create-a-pin)
:description-label (case step
:current :t/current-pin-description
:t/create-pin-description)
:step step
:status status
:error-label error-label}]))
(defview enter-pin []
(letsubs [pin [:hardwallet/pin]
step [:hardwallet/pin-enter-step]

View File

@ -1,4 +1 @@
(ns status-im.ui.screens.help-center.styles)
(def wrapper
{:flex 1})
(ns status-im.ui.screens.help-center.styles)

View File

@ -6,10 +6,6 @@
:justify-content :flex-end
:margin-bottom 12})
(def intro-logo-container
{:align-items :center
:justify-content :center})
(defn dot-selector [n]
(let [diameter 6
interval 10]
@ -28,10 +24,6 @@
:height 6
:border-radius 3})
(def welcome-image-container
{:align-items :center
:margin-top 42})
(def wizard-title
{:typography :header
:text-align :center
@ -41,11 +33,6 @@
{:color colors/gray
:text-align :center})
(def welcome-text
{:typography :header
:margin-top 32
:text-align :center})
(def welcome-text-bottom-note
{:typography :caption
:color colors/gray
@ -72,15 +59,6 @@
:border-width 1
:border-color colors/black-transparent})
(def welcome-text-description
{:margin-top 8
:text-align :center
:margin-horizontal 32
:color colors/gray})
(def intro-logo
{:size 111})
(defn password-text-input [width]
{:typography :header
:width width})
@ -101,10 +79,6 @@
(def disabled-bottom-button-text
{:color colors/gray-transparent-40})
(def bottom-button-container
{:margin-bottom 24
:margin-top 16})
(defn bottom-arrow []
{:flex-direction :row
:justify-content :flex-end

View File

@ -16,30 +16,6 @@
[status-im.ui.components.topbar :as topbar]
[reagent.core :as reagent]))
(defn welcome []
[react/view {:flex 1
:justify-content :space-between
:align-items :center
:flex-direction :column}
[react/view]
[react/view {:align-items :center}
[react/image {:source (resources/get-image :status-logo)
:resize-mode :center
:style {:width 64
:height 64}}]
[react/view {:margin-top 24}
[react/i18n-text {:style {:typography :header
:text-align :center}
:key :welcome-to-status}]]
[react/view {:margin-top 16}
[react/i18n-text {:style {:text-align :center
:margin-horizontal 39
:color colors/gray}
:key :welcome-screen-text}]]]
[react/view {:align-items :center :margin-bottom 52}
[react/activity-indicator {:size :large
:animating true}]]])
;; NOTE(Ferossgp): Seems like it should be in popover
(defn blank []
[react/view {:flex 1

View File

@ -19,16 +19,6 @@
{:color colors/gray
:text-align :center})
(def network-icon
{:title-color :blue
:icon-color :blue
:icon-background :blue-light})
(def cancel-icon
{:title-color :red
:icon-color :red
:icon-background :red-light})
(def separator
{:background-color colors/gray-lighter
:margin-left 72

View File

@ -54,13 +54,6 @@
:android {:margin-top 11
:padding-top 13}})
(def save-password-unavailable
{:margin-top 8
:width "100%"
:text-align :center
:flex-direction :row
:align-items :center})
(def save-password-unavailable-android
{:margin-top 8
:width "100%"

View File

@ -1,36 +0,0 @@
(ns status-im.ui.screens.multiaccounts.recover.styles
(:require [status-im.ui.components.colors :as colors]
[status-im.utils.styles :as styles]))
(def screen-container
{:flex 1})
(styles/def inputs-container
{:margin 16
:desktop {:padding-top 15}})
(def password-input
{:margin-top 10})
(def bottom-button-container
{:flex-direction :row
:margin-horizontal 12
:margin-vertical 15})
(def processing-view
{:flex 1
:align-items :center
:justify-content :center})
(def sign-you-in
{:margin-top 16
:font-size 13})
(def recover-release-warning
{:margin-top 16
:font-size 12
:color colors/gray})
(def recovery-phrase-input
{:flex 1
:text-align-vertical :top})

View File

@ -9,15 +9,8 @@
:margin-top 24
:justify-content :space-between})
(def bottom-actions-container
{:margin-bottom 16})
(def multiaccount-image-size 40)
(def multiaccount-title-text
{:color colors/black
:font-size 17})
(def multiaccounts-list-container
{:flex 1
:padding-bottom 8})
@ -36,17 +29,6 @@
(def multiaccount-badge-text
{:font-weight "500"})
(def multiaccount-badge-pub-key-text
{:font-family "monospace"
:color colors/gray})
(def bottom-button
{:padding-horizontal 24
:justify-content :center
:align-items :center
:align-self :center
:flex-direction :row})
(defn bottom-button-container []
{:flex-direction :row
:padding-horizontal 12

View File

@ -53,9 +53,6 @@
:align-items :center
:justify-content :center})
(def installation-status
{:color colors/gray})
(def pairing-actions-text
{:flex 1
:margin-left 16})

View File

@ -74,20 +74,6 @@
[react/view
[react/text (i18n/label :t/pair-this-device-description)]]]]])
(defn sync-devices []
[react/touchable-highlight {:on-press synchronize-installations!
:style styles/pair-this-device}
[react/view {:style styles/pair-this-device-actions}
[react/view
[react/view (styles/pairing-button true)
[icons/icon :main-icons/wnode (icon-style (styles/pairing-button-icon true))]]]
[react/view {:style styles/pairing-actions-text}
[react/view
[react/text {:style styles/pair-this-device-title}
(if @syncing
(i18n/label :t/syncing-devices)
(i18n/label :t/sync-all-devices))]]]]])
(defn your-device [{:keys [installation-id name device-type]}]
[react/view {:style styles/installation-item}
[react/view {:style (styles/pairing-button true)}

View File

@ -1,11 +0,0 @@
(ns status-im.ui.screens.privacy-policy.styles
(:require [status-im.ui.components.colors :as colors]))
(def privacy-policy-button-text
{:color colors/blue})
(def privacy-policy-button-text-gray
{:text-align :center
:color colors/gray
:margin-bottom 16
:margin-top 42})

View File

@ -1,13 +0,0 @@
(ns status-im.ui.screens.privacy-policy.views
(:require [status-im.ui.components.react :as react]
[status-im.ui.screens.privacy-policy.styles :as styles]
[status-im.i18n :as i18n]
[re-frame.core :as re-frame]))
(defn privacy-policy-button []
[react/nested-text
{:style styles/privacy-policy-button-text-gray
:on-press #(re-frame/dispatch [:privacy-policy/privacy-policy-button-pressed])}
(i18n/label :t/agree-by-continuing)
[{:style styles/privacy-policy-button-text}
(i18n/label :t/privacy-policy)]])

View File

@ -10,28 +10,6 @@
(re-frame/dispatch [:bottom-sheet/hide-sheet])
(re-frame/dispatch event))
(views/defview add-contact []
(views/letsubs [{:keys [public-key]} [:bottom-sheet/options]]
[react/view
[react/text {:style styles/sheet-text}
(i18n/label :t/add-to-contacts-text)]
[list-item/list-item
{:theme :action
:title :t/add-to-contacts
:icon :main-icons/add-contact
:on-press #(hide-sheet-and-dispatch [:contact.ui/add-to-contact-pressed public-key])}]]))
(views/defview remove-contact []
(views/letsubs [contact [:bottom-sheet/options]]
[react/view
[react/text {:style styles/sheet-text}
(i18n/label :t/remove-from-contacts-text)]
[list-item/list-item
{:theme :action-destructive
:title :t/remove-from-contacts
:icon :main-icons/remove-contact
:on-press #(hide-sheet-and-dispatch [:contact.ui/remove-contact-pressed contact])}]]))
(views/defview block-contact []
(views/letsubs [{:keys [public-key]} [:bottom-sheet/options]]
[react/view

View File

@ -8,10 +8,6 @@
:justify-content :flex-start
:align-items :center})
(def profile-header-edit
{:flex-direction :column
:justify-content :center})
(def profile-name-text
{:typography :header
:line-height 28
@ -41,9 +37,6 @@
;; settings items elements
(def settings-item-separator
{:margin-left 16})
(def settings-item
{:padding-left 16
:padding-right 8
@ -82,17 +75,8 @@
:padding-right 10
:color colors/gray})
(def settings-title
{:color colors/gray
:margin-left 16
:margin-top 18
:font-size 14})
;; shared profile styles
(def modal-menu
{:align-items :center})
(def profile
{:flex 1
:flex-direction :column})

View File

@ -100,13 +100,6 @@
;; settings items elements
(defn settings-item-separator []
[common/separator styles/settings-item-separator])
(defn settings-title [title]
[react/text {:style styles/settings-title}
title])
(defn settings-item
[{:keys [item-text label-kw value action-fn active? destructive? hide-arrow?
accessibility-label icon icon-content]

View File

@ -1,33 +1,6 @@
(ns status-im.ui.screens.profile.contact.styles
(:require [status-im.ui.components.colors :as colors]))
(def action-container
{:background-color colors/white})
(def action
{:background-color colors/blue-transparent-10
:border-radius 50})
(defn action-label [with-subtext?]
(cond-> {:color colors/blue}
with-subtext?
(assoc :font-size 15
:line-height 22
:font-weight "500")))
(def action-subtext
{:line-height 22
:font-size 15
:color colors/gray})
(def action-separator
{:height 0
:background-color colors/black-transparent
:margin-left 50})
(def action-icon-opts
{:color colors/blue})
(def block-action-label
{:color colors/red
:padding-top 26

View File

@ -98,13 +98,6 @@
{:typography :main-medium
:color colors/gray})
(def edit-view-message-container
{:border-radius 8
:background-color colors/blue-light
:margin-horizontal 72
:padding-horizontal 12
:padding-vertical 8})
(def finish-label
{:typography :header
:text-align :center})
@ -202,13 +195,6 @@
:width 238
:border-color colors/gray-lighter})
(defn chat-bubble [tribute-sender?]
{:background-color (if tribute-sender? colors/blue-light colors/blue)
:padding-horizontal 12
:padding-vertical 6
:margin-top 4
:border-radius 8})
(def pay-to-chat-bubble
{:background-color colors/blue-light
:padding-horizontal 12

View File

@ -1,46 +1,6 @@
(ns status-im.ui.screens.profile.user.styles
(:require [status-im.ui.components.colors :as colors]))
(def share-contact-code-container
{:flex-direction :row
:justify-content :center
:align-items :center})
(def share-contact-code-button
{:height 42})
(def qr-code
{:background-color colors/white})
(def qr-code-viewer
{:flex-grow 1
:flex-direction :column})
(def share-link-button
{:margin-top 12
:margin-bottom 8})
(def advanced-button
{:margin-top 16
:margin-bottom 12})
(def advanced-button-container
{:align-items :center
:justify-content :center})
(def advanced-button-container-background
{:padding-left 16
:padding-right 12
:padding-vertical 6
:border-radius 18
:background-color colors/blue-transparent-10})
(def advanced-button-row
{:flex-direction :row
:align-items :center})
(def advanced-button-label
{:color colors/blue})
(def pair-button
{:margin-left 32})
:margin-bottom 8})

View File

@ -12,8 +12,6 @@
["@react-navigation/bottom-tabs" :refer (createBottomTabNavigator)]
[oops.core :refer [ocall oget]]))
(defonce native react-navigation)
(def navigation-container (reagent/adapt-react-class NavigationContainer))
(def use-focus-effect useFocusEffect)

View File

@ -21,7 +21,6 @@
[status-im.utils.platform :as platform]))
(defonce main-stack (navigation/create-stack))
(defonce modals-stack (navigation/create-stack))
(defonce bottom-tabs (navigation/create-bottom-tabs))
;; TODO(Ferossgp): Add two-pane navigator on chat-stack

View File

@ -17,8 +17,6 @@
[status-im.wallet.utils :as wallet.utils])
(:require-macros [status-im.utils.views :as views]))
(def state (reagent/atom {:tab :assets}))
(views/defview account-card [{:keys [name color address type] :as account}]
(views/letsubs [currency [:wallet/currency]
portfolio-value [:account-portfolio-value address]

View File

@ -1,10 +1,6 @@
(ns status-im.ui.screens.wallet.components.styles
(:require [status-im.ui.components.colors :as colors]))
(def recent-recipients
{:flex 1
:background-color colors/white})
(defn separator []
{:height 1
:background-color colors/gray-lighter})

View File

@ -3,38 +3,6 @@
[status-im.utils.platform :as platform]
[status-im.utils.styles :as styles]))
(def tabs-height
(cond
platform/android? 52
platform/ios? 52
platform/desktop? 36))
(defn tab [active?]
{:flex 1
:height tabs-height
:justify-content :center
:align-items :center
:padding-bottom (if active? 0 1)
:border-bottom-width (if active? 2 1)
:border-bottom-color (if active?
colors/blue
colors/gray)})
(def tabs-container
{:flex-direction :row
:height tabs-height})
(defn tab-title
[active?]
{:text-align :center
:color (if active?
colors/blue
colors/black)})
(def transactions
{:flex 1
:background-color colors/white})
(def forward
{:color colors/gray})
@ -70,10 +38,6 @@
:padding-left 17
:padding-top 4})
(def address-item
{:font-size 16
:color colors/gray})
(def address-label
{:margin-right 5
:font-size 16
@ -88,20 +52,6 @@
:font-size 16
:color colors/gray})
(def sign-all-view
{:flex 1
:flex-direction :column
:justify-content :center
:background-color colors/gray})
(def sign-all-done
{:position :absolute
:right 0
:top 0})
(def sign-all-done-button
{:background-color :transparent})
(defn transaction-icon-background [color]
{:justify-content :center
:align-items :center
@ -187,20 +137,4 @@
(def details-separator
{:background-color colors/black-transparent
:height 1
:margin-vertical 10})
(def corner-dot
{:position :absolute
:top 0
:right 0
:width 4
:height 4
:border-radius 2
:background-color colors/blue})
(def filter-container
{:flex 1})
(def transactions-view
{:flex 1
:background-color colors/white})
:margin-vertical 10})

View File

@ -133,36 +133,7 @@
#(re-frame/dispatch
[:transactions/fetch-more address]))}}]))]))
(defn- render-item-filter [{:keys [id label checked? on-touch]}]
[react/view {:accessibility-label :filter-item}
[list/list-item-with-checkbox
{:checked? checked?
:on-value-change on-touch}
[list/item
[list/item-icon (transaction-type->icon id)]
[list/item-content
[list/item-primary-only {:accessibility-label :filter-name-text}
label]]]]])
;; NOTE: Is this needed?
(defview filter-history []
(letsubs [{:keys [filters on-touch-select-all]}
[:wallet.transactions.filters/screen]]
[react/view styles/filter-container
[topbar/topbar {:title :t/transactions-filter-title
:navigation {:label (i18n/label :t/done)
:handler #(re-frame/dispatch [:navigate-back])}
:accessories [{:label :t/transactions-filter-select-all
:handler on-touch-select-all}]}]
[react/view
{:style (merge {:background-color colors/white} components.styles/flex)}
[list/section-list {:sections [{:title
(i18n/label :t/type)
:key :type
:render-fn render-item-filter
:data filters}]
:key-fn :id}]]]))
(defn details-header
[date type amount-text currency-text]
[react/view {:style styles/details-header}

View File

@ -2,5 +2,4 @@
(:require-macros [status-im.utils.build :as build]))
(def version (build/git-short-version))
(def commit-sha (build/get-current-sha))
(def build-no (build/get-build-no))

View File

@ -5,13 +5,6 @@
[status-im.multiaccounts.model :as multiaccounts.model]
[taoensso.timbre :as log]))
(defn side-effect!
"Middleware for handlers that will not affect db."
[handler]
(fn [db params]
(handler db params)
db))
(defn- pretty-print-event [ctx]
(let [[first _] (get-coeffect ctx :event)]
first))

View File

@ -58,15 +58,6 @@
(boolean
(re-matches constants/regx-deep-link url)))
(defn open! [url]
(log/info "universal-links: opening " url)
(if-let [dapp-url (match-url url browse-regex)]
(when (security/safe-link? url)
(list-selection/browse-dapp dapp-url))
;; We need to dispatch here, we can't openURL directly
;; as it is opened in safari on iOS
(re-frame/dispatch [:handle-universal-link url])))
(fx/defn handle-browse [cofx url]
(log/info "universal-links: handling browse" url)
(when (security/safe-link? url)

View File

@ -95,18 +95,6 @@
(js/setTimeout cb ms)
(.setTimeout background-timer cb ms)))
(defn unread-messages-count
"display actual # if less than 1K, round to the lowest thousand if between 1 and 10K, otherwise 10K+ for anything larger"
[messages-count]
(let [round-to-lowest-single-thousand #(-> %
(/ 1000)
(Math/floor)
(str "K+"))]
(cond
(< messages-count 1000) (str messages-count)
(<= 1000 messages-count 10000) (round-to-lowest-single-thousand messages-count)
(> messages-count 10000) "10K+")))
;; same as re-frame dispatch-later but using background timer for long
;; running timeouts
(re-frame/reg-fx

View File

@ -9,15 +9,6 @@
(is (= (u/truncate-str "Long string" 11) "Long string")) ; threshold is the same as string length
(is (= (u/truncate-str "Long string" 20) "Long string"))) ; threshold is more then string length
(deftest unread-messages-count-test
(is (= (uu/unread-messages-count 2) "2"))
(is (= (uu/unread-messages-count 12) "12"))
(is (= (uu/unread-messages-count 400) "400"))
(is (= (uu/unread-messages-count 1220) "1K+"))
(is (= (uu/unread-messages-count 4353) "4K+"))
(is (= (uu/unread-messages-count 4999) "4K+"))
(is (= (uu/unread-messages-count 11000) "10K+")))
(deftest clean-text-test
(is (= (u/clean-text "Hello! \n\r") "Hello!")
(= (u/clean-text "Hello!") "Hello!")))

View File

@ -51,8 +51,6 @@
:type type
:path path}])))))
(def dec-pass-error "could not decrypt key with given password")
(defn normalize-path [path]
(if (string/starts-with? path "m/")
(str constants/path-wallet-root