Skip to content

Commit

Permalink
Merge branch 'develop' into issue-13832
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil authored Sep 6, 2022
2 parents 4f52d28 + 1d87957 commit f571b60
Show file tree
Hide file tree
Showing 82 changed files with 1,386 additions and 735 deletions.
5 changes: 3 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
bracketSpacing: false,
jsxBracketSameLine: true,
bracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
};
tabWidth: 4,
};
14 changes: 12 additions & 2 deletions ci/Jenkinsfile.tests
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,20 @@ pipeline {
stage('Checks') {
parallel {
stage('Lint') {
steps { sh "make lint 2>&1 | tee ${LOG_FILE}" }
steps {
sh """#!/bin/bash
set -eo pipefail
make lint 2>&1 | tee ${LOG_FILE}
"""
}
}
stage('Tests') {
steps { sh "make test 2>&1 | tee -a ${LOG_FILE}" }
steps {
sh """#!/bin/bash
set -eo pipefail
make test 2>&1 | tee -a ${LOG_FILE}
"""
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions doc/FDROID.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ This document describes how to update Status APK builds for the [F-Droid](https:

# Intro

In simplest terms F-Droid requires a YAML file that defines the steps necessary to create a universal unsigned APK build. This is achieved by submitting a new app versions into the `metadata/im.status.ethereum.yml` file in the [fdroiddata](https://gitlab.com/fdroid/fdroiddata) repository.
In simplest terms F-Droid requires a YAML file that defines the steps necessary to create a universal unsigned APK build. This is achieved by submitting a new app version into the `metadata/im.status.ethereum.yml` file in the [fdroiddata](https://gitlab.com/fdroid/fdroiddata) repository.

The app builds defined this way run on servers that generate the unsigned APKs using the [fdroidserver](https://gitlab.com/fdroid/fdroidserver) software. The [server setup](https://f-droid.org/en/docs/Build_Server_Setup/) is quite involved but is not necessary unless you want to run your own instance. Normally the applications defines in `fdroiddata` are built by servers maintained by [the F-Droid volunteers](https://f-droid.org/en/contribute/).
The app builds defined this way run on servers that generate the unsigned APKs using the [fdroidserver](https://gitlab.com/fdroid/fdroidserver) software. The [server setup](https://f-droid.org/en/docs/Build_Server_Setup/) is quite involved but is not necessary unless you want to run your own instance. Normally the applications defined in `fdroiddata` are built by servers maintained by [the F-Droid volunteers](https://f-droid.org/en/contribute/).

First release of Status app was merged in [fdroid/fdroiddata#7179](https://gitlab.com/fdroid/fdroiddata/-/merge_requests/7179).

:warning: __WARNING__: Once changes are commited into `fdroiddata` repo they __cannot be changed__.
:warning: __WARNING__: Once changes are committed into `fdroiddata` repo they __cannot be changed__.

# Adding New Versions

Expand Down
8 changes: 4 additions & 4 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ PODS:
- SDWebImageWebPCoder (~> 0.8.4)
- RNFS (2.16.6):
- React
- RNGestureHandler (1.8.0):
- React
- RNGestureHandler (2.5.0):
- React-Core
- RNHoleView (2.1.1):
- React-Core
- RNImageCropPicker (0.36.2):
Expand Down Expand Up @@ -640,7 +640,7 @@ SPEC CHECKSUMS:
FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e
FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e
Folly: b73c3869541e86821df3c387eb0af5f65addfab4
glog: 36ce0530c6d2c3a5a4326885ef4069564887a1db
glog: 64a900d72fb14cd1b2cdf3b717a5555ceb889d49
HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352
Keycard: ac6df4d91525c3c82635ac24d4ddd9a80aca5fc8
libwebp: 60305b2e989864154bd9be3d772730f08fc6a59c
Expand Down Expand Up @@ -691,7 +691,7 @@ SPEC CHECKSUMS:
RNCPushNotificationIOS: c145c6253ea016e5efeff604f2720736b4a596f7
RNFastImage: 1f2cab428712a4baaf78d6169eaec7f622556dd7
RNFS: 2bd9eb49dc82fa9676382f0585b992c424cd59df
RNGestureHandler: 7a5833d0f788dbd107fbb913e09aa0c1ff333c39
RNGestureHandler: bad495418bcbd3ab47017a38d93d290ebd406f50
RNHoleView: 07572d21c97fad71fdc47f7248a8513e15a38949
RNImageCropPicker: 35a3ceb837446fa11547704709bb22b5fac6d584
RNKeychain: 216f37338fcb9e5c3a2530f1e3295f737a690cb1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"react-native-fast-image": "^8.5.11",
"react-native-fetch-polyfill": "^1.1.2",
"react-native-fs": "^2.14.1",
"react-native-gesture-handler": "^1.8.0",
"react-native-gesture-handler": "^2.5.0",
"react-native-haptic-feedback": "^1.9.0",
"react-native-hole-view": "git+https://github.com/status-im/react-native-hole-view.git#refs/tags/v2.1.1-status",
"react-native-image-crop-picker": "git+https://github.com/status-im/react-native-image-crop-picker.git#refs/tags/v0.36.2-status.0",
Expand Down
Binary file added resources/images/icons/arrow-up20@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/arrow-up20@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/identicon_ring20@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/identicon_ring20@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/identicon_ring24@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/identicon_ring24@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/identicon_ring32@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/identicon_ring32@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/identicon_ring48@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/identicon_ring48@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/identicon_ring80@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/identicon_ring80@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/image20@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/image20@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/message-gap-info12@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/message-gap-info12@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/reaction20@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/icons/reaction20@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions scripts/hooks/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/usr/bin/env bash
set -euo pipefail
set -eo pipefail

if [[ -z $(git diff --cached --name-only -r | grep status-go-version.json) ]]; then
exit 0 # No status-go-version.json changes found.
fi

# MacOS sed is garbage and interprets newlines differently.
[[ "$(uname)" -eq "Darwin" ]] && NL=$'\\\n' || NL="\n"

MERGE_BASE=$(git merge-base -a develop "$(git rev-parse --abbrev-ref HEAD)" develop)
GO_COMMIT_MERGE_BASE=$(git show "${MERGE_BASE}":status-go-version.json | jq -r '."commit-sha1"')
GO_COMMIT_CURRENT=$(jq -r '."commit-sha1"' status-go-version.json)
GO_COMMIT_MERGE_BASE=$(git show "${MERGE_BASE}":status-go-version.json | awk -F'"' '/commit-sha1/{print $4}')
GO_COMMIT_CURRENT=$(awk -F'"' '/commit-sha1/{print $4}' status-go-version.json)
GITHUB_LINK_PREFIX="https://github.com/status-im/status-go/compare/"
# Link to the current StatusGo changelog being updated.
GITHUB_LINK="${GITHUB_LINK_PREFIX}${GO_COMMIT_MERGE_BASE::8}...${GO_COMMIT_CURRENT::8}"
Expand All @@ -16,7 +19,7 @@ COMMIT_MSG_FILE=$1
# Check if the commit message already contains the link (rebase) and update otherwise insert into line2
if ! grep -qF "${GITHUB_LINK_PREFIX}" "${COMMIT_MSG_FILE}" >/dev/null; then
sed -in'' -e "2i\\
\n${GITHUB_LINK}" "${COMMIT_MSG_FILE}"
${NL}${GITHUB_LINK}" "${COMMIT_MSG_FILE}"
else
sed -in'' -e "s;^${GITHUB_LINK_PREFIX}.*$;${GITHUB_LINK};" "${COMMIT_MSG_FILE}"
fi
3 changes: 2 additions & 1 deletion shadow-cljs.edn
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@
:source-map false
;; needed because we use deref in tests
:static-fns false
:optimizations :simple}}
:optimizations :simple
:infer-externs true}}

;; mock.js-dependencies is mocking the react-native libraries
;; we build it as a node library so that it can be required by
Expand Down
4 changes: 2 additions & 2 deletions src/mocks/js_dependencies.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
:View {}
:RefreshControl {}
:AppState {}
:Alert {:alert (fn [])}
:FlatList {}
:SectionList {}
:Text {}
Expand Down Expand Up @@ -137,7 +136,6 @@
:setDefaultOptions identity
:setRoot identity
:dismissOverlay #(js/Promise.resolve)
:showOverlay identity
:setLazyComponentRegistrator identity
:pop identity
:push identity
Expand Down Expand Up @@ -221,6 +219,8 @@
:FlatList #js {}
:ScrollView #js {}
:TouchableOpacity #js {}
:GestureDetector #js {}
:Gesture #js {:Pan nil}
:createNativeWrapper identity})

(def react-native-redash #js {:clamp nil})
Expand Down
10 changes: 5 additions & 5 deletions src/quo/components/list/item.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
[status-im.ui.components.icons.icons :as icons]
[quo2.foundations.colors :as quo2.colors]
[quo2.components.icon :as quo.icons]
[status-im.utils.config :as config]
[quo.components.animated.pressable :as animated]))

(defn themes [theme]
Expand Down Expand Up @@ -77,14 +78,14 @@
children))

(defn icon-column
[{:keys [icon icon-bg-color icon-color size icon-container-style new-ui?]}]
[{:keys [icon icon-bg-color icon-color size icon-container-style]}]
(when icon
(let [icon-size (size->icon-size size)]
(let [icon-size (size->icon-size size)
new-ui? @config/new-ui-enabled?]
[rn/view {:style (or icon-container-style (:tiny spacing/padding-horizontal))}
(cond
(vector? icon)
icon

(keyword? icon)
(if new-ui?
[quo.icons/icon icon {:container-style {:align-items :center
Expand Down Expand Up @@ -270,8 +271,7 @@
:subtitle subtitle
:subtitle-max-lines subtitle-max-lines
:subtitle-secondary subtitle-secondary
:right-side-present? (or accessory chevron)
:new-ui? :new-ui?}]
:right-side-present? (or accessory chevron)}]
[right-side {:chevron chevron
:active active
:disabled disabled
Expand Down
14 changes: 2 additions & 12 deletions src/quo/gesture_handler.cljs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
(ns quo.gesture-handler
(:require [oops.core :refer [oget]]
["react-native-reanimated" :default animated]
[reagent.core :as reagent]
[quo.design-system.colors :as colors]
["react-native-gesture-handler"
:refer (TapGestureHandler PanGestureHandler LongPressGestureHandler
PureNativeButton TouchableWithoutFeedback TouchableOpacity
TouchableHighlight
createNativeWrapper State NativeViewGestureHandler
TouchableWithoutFeedback TouchableOpacity
TouchableHighlight State NativeViewGestureHandler
FlatList ScrollView)]))

(def flat-list-raw FlatList)
Expand All @@ -25,8 +23,6 @@
(def long-press-gesture-handler
(reagent/adapt-react-class LongPressGestureHandler))

(def pure-native-button PureNativeButton)

(def touchable-without-feedback-class TouchableWithoutFeedback)

(def touchable-without-feedback
Expand All @@ -42,12 +38,6 @@
(def touchable-opacity
(reagent/adapt-react-class TouchableOpacity))

(def raw-button
(reagent/adapt-react-class
(createNativeWrapper (.createAnimatedComponent animated PureNativeButton)
#js {:shouldActivateOnStart true
:shouldCancelWhenOutside true})))

(def native-view-gesture-handler (reagent/adapt-react-class NativeViewGestureHandler))

(def states {:began (oget State "BEGAN")
Expand Down
16 changes: 8 additions & 8 deletions src/quo/react.cljs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(ns quo.react
(:refer-clojure :exclude [ref])
(:require [oops.core :refer [oget oset!]]
["react" :as react])
(:require ["react" :as react]
[oops.core :refer [oget oset!]])
(:require-macros [quo.react :refer [with-deps-check
maybe-js-deps]]))

Expand All @@ -25,21 +25,21 @@
(-hash [o] (goog/getUid o))

cljs.core/IDeref
(-deref [o]
(-deref [_o]
value)

cljs.core/IReset
(-reset! [o new-value]
(-reset! [_o new-value]
(set-value new-value))

cljs.core/ISwap
(-swap! [o f]
(-swap! [_o f]
(set-value f))
(-swap! [o f a]
(-swap! [_o f a]
(set-value #(f % a)))
(-swap! [o f a b]
(-swap! [_o f a b]
(set-value #(f % a b)))
(-swap! [o f a b xs]
(-swap! [_o f a b xs]
(set-value #(apply f % a b xs))))

(defn state [value]
Expand Down
49 changes: 49 additions & 0 deletions src/quo2/components/communities/community_card_view.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
(ns quo2.components.communities.community-card-view
(:require
[quo2.components.communities.community-view :as community-view]
[status-im.communities.core :as communities]
[status-im.utils.handlers :refer [>evt <sub]]
[status-im.ui.components.react :as react]
[status-im.ui.screens.communities.styles :as styles]
[status-im.ui.screens.communities.community :as community]
[status-im.ui.screens.communities.icon :as communities.icon]))

(defn community-card-view-item [{:keys [id name description locked
status tokens cover tags featured] :as community}]
(let [width (* (<sub [:dimensions/window-width]) 0.90)]
[react/view {:style (merge (styles/community-card 20)
{:margin-bottom 16}
(if featured
{:margin-right 12
:width width}
{:flex 1
:margin-horizontal 20}))}
[react/view {:style {:height 230
:border-radius 20}
:on-press (fn []
(>evt [::communities/load-category-states id])
(>evt [:dismiss-keyboard])
(>evt [:navigate-to :community {:community-id id}]))
:on-long-press #(>evt [:bottom-sheet/show-sheet
{:content (fn [] [community/community-actions community])}])}
[react/view
{:flex 1}
[react/view (styles/community-cover-container 40)
[react/image
{:source cover
:style
{:flex 1
:border-radius 20}}]]
[react/view (styles/card-view-content-container 12)
[react/view (styles/card-view-chat-icon 48)
[communities.icon/community-icon-redesign community 48]]
(when (= status :gated)
[react/view (styles/permission-tag-styles)
[community-view/permission-tag-container {:locked locked
:status status
:tokens tokens}]])
[community-view/community-title
{:title name
:description description}]
[community-view/community-stats-column :card-view]
[community-view/community-tags tags]]]]]))
76 changes: 76 additions & 0 deletions src/quo2/components/communities/community_list_view.cljs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
(ns quo2.components.communities.community-list-view
(:require
[quo2.components.communities.community-view :as community-view]
[quo2.components.text :as text]
[quo2.foundations.colors :as colors]
[status-im.communities.core :as communities]
[status-im.utils.handlers :refer [>evt]]
[status-im.ui.components.react :as react]
[status-im.ui.screens.communities.styles :as styles]
[status-im.ui.screens.communities.community :as community]
[status-im.ui.screens.communities.icon :as communities.icon]))

(defn communities-list-view-item [{:keys [id name locked status tokens background-color] :as community}]
[react/view {:style (merge (styles/community-card 16)
{:margin-bottom 12
:margin-horizontal 20})}
[react/view {:style {:height 56
:border-radius 16}
:on-press (fn []
(>evt [::communities/load-category-states id])
(>evt [:dismiss-keyboard])
(>evt [:navigate-to :community {:community-id id}]))
:on-long-press #(>evt [:bottom-sheet/show-sheet
{:content (fn []
[community/community-actions community])}])}
[react/view {:flex 1}
[react/view {:flex-direction :row
:border-radius 16
:padding-horizontal 12
:align-items :center
:padding-vertical 8
:background-color background-color}
[react/view
[communities.icon/community-icon-redesign community 32]]
[react/view {:flex 1
:margin-horizontal 12}
[text/text {:weight :semi-bold
:size :paragraph-1
:accessibility-label :community-name-text
:number-of-lines 1
:ellipsize-mode :tail}
name]
[community-view/community-stats-column :list-view]]
(when (= status :gated)
[community-view/permission-tag-container {:locked locked
:status status
:tokens tokens}])]]]])

(defn communities-membership-list-item [{:keys [id name status tokens locked] :as community}]
[react/view {:margin-bottom 12
:padding-horizontal 8}
[react/touchable-highlight {:underlay-color colors/primary-50-opa-5
:style {:border-radius 12}
:on-press (fn []
(>evt [::communities/load-category-states id])
(>evt [:dismiss-keyboard])
(>evt [:navigate-to :community {:community-id id}]))
:on-long-press #(>evt [:bottom-sheet/show-sheet
{:content (fn []
[community/community-actions community])}])}
[react/view {:flex 1
:padding-vertical 8
:padding-horizontal 12}
[react/view {:flex-direction :row
:border-radius 16
:align-items :center}
[communities.icon/community-icon-redesign community 48]
[react/view {:margin-left 12
:flex 1}
[community-view/community-title {:title name}]]
(when (= status :gated)
[react/view {:justify-content :center
:margin-right 12}
[community-view/permission-tag-container {:locked locked
:status status
:tokens tokens}]])]]]])
Loading

0 comments on commit f571b60

Please sign in to comment.