Skip to content

Commit

Permalink
Merge branch 'develop' into 19645
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil authored Apr 25, 2024
2 parents 34b1f23 + ce3d32d commit 3976791
Show file tree
Hide file tree
Showing 24 changed files with 252 additions and 247 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC

private fun updateConfig(jsonConfigString: String, absRootDirPath: String, keystoreDirPath: String): String {
val jsonConfig = JSONObject(jsonConfigString)
val dataDirPath = jsonConfig.getString("DataDir")
// when doing local pair syncing, backend will provide default data dir
val dataDirPath = jsonConfig.optString("DataDir","")
val logEnabled = jsonConfig.getBoolean("LogEnabled")
val gethLogFile = if (logEnabled) logManager.prepareLogsFile(reactContext) else null
val gethLogDirPath = gethLogFile?.parent
Expand Down Expand Up @@ -140,7 +141,6 @@ class AccountManager(private val reactContext: ReactApplicationContext) : ReactC
updatedJsonConfigString
} catch (e: JSONException) {
Log.e(TAG, "updateConfig failed: ${e.message}")
System.exit(1)
""
}
}
Expand Down
3 changes: 3 additions & 0 deletions modules/react-native-status/ios/RCTStatus/AccountManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ -(NSString *) prepareDirAndUpdateConfig:(NSString *)config
NSData *configData = [config dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *configJSON = [NSJSONSerialization JSONObjectWithData:configData options:NSJSONReadingMutableContainers error:nil];
NSString *relativeDataDir = [configJSON objectForKey:@"DataDir"];
if (relativeDataDir == nil) {
relativeDataDir = @"";
}
NSString *absDataDir = [rootUrl.path stringByAppendingString:relativeDataDir];
NSURL *absDataDirUrl = [NSURL fileURLWithPath:absDataDir];
NSString *keystoreDir = [@"/keystore/" stringByAppendingString:keyUID];
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/status_im/multiaccounts/create/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
:selected-storage-type :default
:selected-id (-> result first :id)
:step :choose-key))))
:navigate-to :choose-name})
:navigate-to [:choose-name (:theme db)]})

(rf/defn generate-and-derive-addresses
{:events [:generate-and-derive-addresses]}
Expand Down
8 changes: 2 additions & 6 deletions src/legacy/status_im/node/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
[clojure.string :as string]
[legacy.status-im.utils.deprecated-types :as types]
[react-native.platform :as platform]
[status-im.config :as config]
[utils.ethereum.chain :as chain]))
[status-im.config :as config]))

(defn- add-log-level
[config log-level]
Expand Down Expand Up @@ -117,10 +116,7 @@
{:keys [installation-id log-level
waku-bloom-filter-mode]}
profile]
(cond-> {:NetworkId (chain/chain-keyword->chain-id :mainnet)
:DataDir "/ethereum/mainnet_rpc"
:UpstreamConfig {:Enabled true
:URL config/mainnet-rpc-url}}
(cond-> {}
:always
(get-base-node-config)

Expand Down
4 changes: 2 additions & 2 deletions src/quo/components/inputs/recovery_phrase/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
container-style))

(defn input
[]
(assoc (text/text-style {} nil)
[theme]
(assoc (text/text-style {} theme)
:height 32
:flex-grow 1
:padding-vertical 5
Expand Down
2 changes: 1 addition & 1 deletion src/quo/components/inputs/recovery_phrase/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
[rn/view {:style (style/container container-style)}
[rn/text-input
(merge {:accessibility-label :recovery-phrase-input
:style (style/input)
:style (style/input theme)
:placeholder-text-color (style/placeholder-color state theme blur?)
:cursor-color (style/cursor-color customization-color theme)
:keyboard-appearance theme
Expand Down
33 changes: 17 additions & 16 deletions src/quo/components/notifications/notification/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,23 @@

(defn notification
[{title-text :title :keys [avatar user header title-weight text body container-style theme]}]
(let [theme theme
body (or body (when text [message text theme]))
header (or header
(when title-text
[title
{:text title-text
:weight title-weight
:theme theme
:multiline? (some? body)}]))
header (when header [header-container header])
body (when body [body-container body])
user-avatar (or avatar (when user (user-avatar/user-avatar user)))
avatar (when user-avatar
[avatar-container
{:multiline? (and header body)}
user-avatar])]
(let [context-theme (quo.theme/use-theme)
theme (or theme context-theme)
body (or body (when text [message text theme]))
header (or header
(when title-text
[title
{:text title-text
:weight title-weight
:theme theme
:multiline? (some? body)}]))
header (when header [header-container header])
body (when body [body-container body])
user-avatar (or avatar (when user (user-avatar/user-avatar user)))
avatar (when user-avatar
[avatar-container
{:multiline? (and header body)}
user-avatar])]
[quo.theme/provider theme
[notification-container
{:avatar avatar
Expand Down
3 changes: 2 additions & 1 deletion src/quo/components/notifications/toast/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
"
[{:keys [type icon title text action undo-duration undo-on-press container-style theme user]
:or {type :neutral icon :i/placeholder}}]
(let [context-theme theme
(let [context-theme (quo.theme/use-theme)
context-theme (or theme context-theme)
icon-name (case type
:positive (if (= theme :light)
:i/correct
Expand Down
62 changes: 33 additions & 29 deletions src/quo/components/tags/context_tag/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@
[schema.core :as schema]))

(defn- tag-skeleton
[{:keys [theme size text] :or {size 24}} logo-component]
[rn/view {:style (style/tag-container size)}
logo-component
[rn/view {:style (style/tag-spacing size)}
[text/text
{:style (style/text theme)
:weight :medium
:size (if (= size 24) :paragraph-2 :paragraph-1)}
text]]])
[{:keys [size text] :or {size 24}} logo-component]
(let [theme (quo.theme/use-theme)]
[rn/view {:style (style/tag-container size)}
logo-component
[rn/view {:style (style/tag-spacing size)}
[text/text
{:style (style/text theme)
:weight :medium
:size (if (= size 24) :paragraph-2 :paragraph-1)}
text]]]))

(defn- communities-tag
[{:keys [theme size community-logo community-name blur? channel? channel-name]}]
(let [text-size (if (= size 24) :paragraph-2 :paragraph-1)
[{:keys [size community-logo community-name blur? channel? channel-name]}]
(let [theme (quo.theme/use-theme)
text-size (if (= size 24) :paragraph-2 :paragraph-1)
icon-size (if (= size 24) 16 20)]
[rn/view {:style (style/tag-container size)}
[fast-image/fast-image {:style (style/circle-logo size) :source community-logo}]
Expand All @@ -54,26 +56,28 @@
(str (subs pk 0 5) "..." (subs pk (- (count pk) 3))))

(defn- address-tag
[{:keys [theme size address]}]
[rn/view {:style (style/address size)}
[text/text
{:style (style/text theme)
:weight :monospace ;; TODO: fix this style (issue #17009)
:size (if (= size 24) :paragraph-2 :paragraph-1)}
(trim-public-key address)]])
[{:keys [size address]}]
(let [theme (quo.theme/use-theme)]
[rn/view {:style (style/address size)}
[text/text
{:style (style/text theme)
:weight :monospace ;; TODO: fix this style (issue #17009)
:size (if (= size 24) :paragraph-2 :paragraph-1)}
(trim-public-key address)]]))

(defn- icon-tag
[{:keys [theme size icon blur? context]}]
[rn/view {:style (style/icon size)}
[icons/icon icon
{:color (style/context-tag-icon-color theme blur?)
:size (if (= size 24) 12 20)}]
[rn/view {:style (style/icon-spacing size)}
[text/text
{:style (style/text theme)
:weight :medium
:size (if (= size 24) :paragraph-2 :paragraph-1)}
context]]])
[{:keys [size icon blur? context]}]
(let [theme (quo.theme/use-theme)]
[rn/view {:style (style/icon size)}
[icons/icon icon
{:color (style/context-tag-icon-color theme blur?)
:size (if (= size 24) 12 20)}]
[rn/view {:style (style/icon-spacing size)}
[text/text
{:style (style/text theme)
:weight :medium
:size (if (= size 24) :paragraph-2 :paragraph-1)}
context]]]))

(defn- view-internal
[{:keys [type size state blur? customization-color profile-picture full-name users
Expand Down
58 changes: 29 additions & 29 deletions src/quo/components/wallet/token_input/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -92,36 +92,36 @@
(oops/oget "nativeEvent.selection")
(js->clj :keywordize-keys true)
(on-selection-change))))]
(fn [{:keys [theme token customization-color show-keyboard? crypto? currency value error?
selection]
(fn [{:keys [token customization-color show-keyboard? crypto? currency value error? selection]
:or {show-keyboard? true}}]
[rn/view {:style {:flex 1}}
[rn/pressable {:on-press on-token-press}
[token/view
{:token token
:size :size-32}]]
[rn/pressable
{:style style/text-input-container
:on-press focus-input}
[rn/text-input
(cond-> {:style (style/text-input theme error?)
:placeholder-text-color (style/placeholder-text theme)
:auto-focus true
:ref set-ref
:placeholder "0"
:keyboard-type :numeric
:max-length 12
:on-change-text handle-on-change-text
:selection-color customization-color
:show-soft-input-on-focus show-keyboard?
:on-selection-change handle-selection-change
:selection (clj->js selection)}
controlled-input? (assoc :value value)
(not controlled-input?) (assoc :default-value value-internal))]]
[token-label
{:theme theme
:text (if crypto? token currency)
:value (if controlled-input? value value-internal)}]])))
(let [theme (quo.theme/use-theme)]
[rn/view {:style {:flex 1}}
[rn/pressable {:on-press on-token-press}
[token/view
{:token token
:size :size-32}]]
[rn/pressable
{:style style/text-input-container
:on-press focus-input}
[rn/text-input
(cond-> {:style (style/text-input theme error?)
:placeholder-text-color (style/placeholder-text theme)
:auto-focus true
:ref set-ref
:placeholder "0"
:keyboard-type :numeric
:max-length 12
:on-change-text handle-on-change-text
:selection-color customization-color
:show-soft-input-on-focus show-keyboard?
:on-selection-change handle-selection-change
:selection (clj->js selection)}
controlled-input? (assoc :value value)
(not controlled-input?) (assoc :default-value value-internal))]]
[token-label
{:theme theme
:text (if crypto? token currency)
:value (if controlled-input? value value-internal)}]]))))

(defn- view-internal
[{:keys [container-style value on-swap] :as props}]
Expand Down
93 changes: 47 additions & 46 deletions src/quo/components/wallet/wallet_overview/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -66,52 +66,53 @@

(defn- view-info-bottom
[{:keys [state time-frame metrics date begin-date end-date
currency-change percentage-change theme]}]
[rn/view {:style style/container-info-bottom}
(when (= state :loading)
[rn/view
{:style {:flex-direction :row
:align-items :center}}
(loading-bars [{:width 32 :height 10 :margin 8}
{:width 32 :height 10 :margin 2}
{:width 62 :height 10 :margin 4}
{:width 10 :height 10 :margin 0}]
theme)])
(when (and (= state :default) (= time-frame :selected))
[text/text
{:weight :medium
:size :paragraph-2
:style (style/style-text-paragraph theme)}
date])
(when (and (= state :default) (= time-frame :custom))
[rn/view {:style {:flex-direction :row}}
[text/text
{:weight :medium
:size :paragraph-2
:style (style/style-text-paragraph theme)}
begin-date]
[icon/icon :i/positive-right
{:color (style/color-text-paragraph theme)
:size 16}]
[text/text
{:weight :medium
:size :paragraph-2
:style (style/style-text-paragraph theme)}
end-date]])
(when (and (= state :default) (not (#{:none :selected} time-frame)))
[rn/view {:style {:flex-direction :row}}
[text/text
{:weight :medium
:size :paragraph-2
:style {:color (style/color-text-paragraph theme)
:margin-right 8}}
(time-frame time-frames)]
(when (and (= state :default) (not= metrics :none))
[view-metrics
{:metrics metrics
:currency-change currency-change
:percentage-change percentage-change
:theme theme}])])])
currency-change percentage-change]}]
(let [theme (quo.theme/use-theme)]
[rn/view {:style style/container-info-bottom}
(when (= state :loading)
[rn/view
{:style {:flex-direction :row
:align-items :center}}
(loading-bars [{:width 32 :height 10 :margin 8}
{:width 32 :height 10 :margin 2}
{:width 62 :height 10 :margin 4}
{:width 10 :height 10 :margin 0}]
theme)])
(when (and (= state :default) (= time-frame :selected))
[text/text
{:weight :medium
:size :paragraph-2
:style (style/style-text-paragraph theme)}
date])
(when (and (= state :default) (= time-frame :custom))
[rn/view {:style {:flex-direction :row}}
[text/text
{:weight :medium
:size :paragraph-2
:style (style/style-text-paragraph theme)}
begin-date]
[icon/icon :i/positive-right
{:color (style/color-text-paragraph theme)
:size 16}]
[text/text
{:weight :medium
:size :paragraph-2
:style (style/style-text-paragraph theme)}
end-date]])
(when (and (= state :default) (not (#{:none :selected} time-frame)))
[rn/view {:style {:flex-direction :row}}
[text/text
{:weight :medium
:size :paragraph-2
:style {:color (style/color-text-paragraph theme)
:margin-right 8}}
(time-frame time-frames)]
(when (and (= state :default) (not= metrics :none))
[view-metrics
{:metrics metrics
:currency-change currency-change
:percentage-change percentage-change
:theme theme}])])]))

(defn- view-internal
[props]
Expand Down
Loading

0 comments on commit 3976791

Please sign in to comment.