Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c9e6604ff | ||
|
|
dfbabd0be7 | ||
|
|
7e9f3fdbab | ||
|
|
4302079b3d | ||
|
|
99eadaef60 | ||
|
|
b531dadf96 | ||
|
|
2b0ea01710 | ||
|
|
9f5e7ce3f9 |
@@ -1,65 +0,0 @@
|
||||
# Git Etiquette Guide
|
||||
|
||||
To ensure smooth collaboration, we've outlined the following Git etiquette guide. This guide will help in writing concise commit messages, managing git branches, pull request descriptions, and other best practices.
|
||||
|
||||
## 1. Commit Messages
|
||||
|
||||
Your commit message should provide clear context about the change. This allows others (and future you) to understand why a particular change was made.
|
||||
|
||||
Here are the guidelines to write concise and meaningful commit messages:
|
||||
|
||||
- **Use the Imperative Mood**: Commit messages should be written in the present tense and imperative mood ("Add feature" not "Added feature" or "Adds feature").
|
||||
- **First Line Should Be Summary**: The first line of your commit message should be a brief summary of the changes, kept under 50 characters whenever possible.
|
||||
- **Body**: Follow this summary line with a blank line, then a more detailed explanation is always helpful but not necessary. This is often useful when the commit has significant importance or complexity.
|
||||
- **Consider Including the 'Why'**: If the commit resolves an issue or bug, mention the issue number and provide a brief explanation of how the changes fix the issue.
|
||||
|
||||
Here's a good commit message example:
|
||||
|
||||
```
|
||||
Fix off-by-one error in loop (issue #123)
|
||||
|
||||
This commit fixes an off-by-one error in the list iteration function.
|
||||
This was causing an index out of bounds exception when processing the last item in the list.
|
||||
Tests have been updated to catch this in the future.
|
||||
```
|
||||
|
||||
## 2. Branch Management
|
||||
|
||||
Git branches should be concise and focused on a single feature, fix, or improvement. Here are a few practices:
|
||||
|
||||
- **Branch Name**: The branch name should be descriptive of the change and follow a specific format such as `type/description`. Example: `feature/login-system`.
|
||||
- **Please don't accept branch recommendation by Github UI**: The branch name recommendation by Github UI will in most cases be a very long branch name concatenated with the issue number, which often results in branch names like this one :
|
||||
`feature/Merge_yada_and_yada_yada_into_one_yada_yada_status-lol_#199021`
|
||||
- **Keep Branches Short-lived**: The longer a branch lives separate from the `main` or `master` branch, the higher the possibility of merge conflicts. Aim to merge branches as soon as the work is complete and has been tested.
|
||||
- **Rebase Frequently**: If your branch lives longer, rebase it frequently on top of the main branch.
|
||||
|
||||
## 3. Pull Requests
|
||||
|
||||
Pull requests (PRs) are how your changes get incorporated into the project. Here are a few key points:
|
||||
|
||||
- **Link PR to an Issue**: Your PR should link to the issue it resolves. This helps track the resolution of bugs or addition of features.
|
||||
- **PR Description**: The PR description should outline what changes have been made and why. This should be a summary of your commits.
|
||||
- **Small and Focused PRs**: Aim to keep PRs small and focused. It's easier to understand and review a PR with a handful of related changes than one with multiple unrelated changes.
|
||||
|
||||
Example PR description:
|
||||
|
||||
```
|
||||
## Description
|
||||
This PR implements a login system (issue #456). It adds a login and logout button, as well as an authentication system. This will allow users to create an account and sign in.
|
||||
|
||||
## Changes
|
||||
- Add login button component
|
||||
- Add logout button component
|
||||
- Add authentication API integration
|
||||
|
||||
## Issue Related
|
||||
This PR closes #456
|
||||
```
|
||||
|
||||
## 4. Other Best Practices
|
||||
|
||||
- **Stay Updated**: Keep your local copy up to date with the upstream regularly.
|
||||
- **Test Before Pushing**: Always test your code and make sure all tests pass before you push.
|
||||
|
||||
Following these guidelines ensures a smoother collaboration and maintains a clean, manageable project history. Thanks for your contributions!
|
||||
|
||||
@@ -39,10 +39,11 @@
|
||||
(contact.db/public-key->new-contact identity)))
|
||||
|
||||
(defn contact-two-names-by-identity
|
||||
[contact current-multiaccount identity]
|
||||
(let [me? (= (:public-key current-multiaccount) identity)]
|
||||
[contact profile identity]
|
||||
(let [me? (= (:public-key profile) identity)]
|
||||
(if me?
|
||||
[(or (:preferred-name current-multiaccount)
|
||||
[(or (:preferred-name profile)
|
||||
(:display-name profile)
|
||||
(:primary-name contact)
|
||||
(gfycat/generate-gfy identity))]
|
||||
[(:primary-name contact) (:secondary-name contact)])))
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
(def ^:const content-type-gap 10)
|
||||
(def ^:const content-type-contact-request 11) ;; TODO: temp, will be removed
|
||||
(def ^:const content-type-system-pinned-message 14)
|
||||
(def ^:const content-type-system-mutual-state-update 15)
|
||||
(def ^:const content-type-system-message-mutual-event-sent 15)
|
||||
(def ^:const content-type-system-message-mutual-event-accepted 16)
|
||||
(def ^:const content-type-system-message-mutual-event-removed 17)
|
||||
|
||||
;; Not implemented in status-go, only used for testing/ui work
|
||||
(def ^:const content-type-gif 100)
|
||||
|
||||
@@ -253,7 +253,10 @@
|
||||
[{:keys [type value content-type] :as message-data} _ _
|
||||
{:keys [context keyboard-shown?]}]
|
||||
;;TODO temporary hide mutual-state-updates https://github.com/status-im/status-mobile/issues/16254
|
||||
(when (not= content-type constants/content-type-system-mutual-state-update)
|
||||
(when-not (#{constants/content-type-system-message-mutual-event-sent
|
||||
constants/content-type-system-message-mutual-event-accepted
|
||||
constants/content-type-system-message-mutual-event-removed}
|
||||
content-type)
|
||||
[rn/view
|
||||
(add-inverted-y-android {:background-color (colors/theme-colors colors/white colors/neutral-95)})
|
||||
(cond
|
||||
@@ -373,10 +376,11 @@
|
||||
(- (reanimated/get-shared-value scroll-y)
|
||||
keyboard-height))))
|
||||
[keyboard-shown keyboard-height])
|
||||
;; Note - Don't pass `behavior :height` to keyboard avoiding view,
|
||||
;; It breaks composer - https://github.com/status-im/status-mobile/issues/16595
|
||||
[rn/keyboard-avoiding-view
|
||||
{:style (style/keyboard-avoiding-container insets)
|
||||
:keyboard-vertical-offset (- (:bottom insets))
|
||||
:behavior :height}
|
||||
:keyboard-vertical-offset (- (:bottom insets))}
|
||||
|
||||
(when header-comp
|
||||
[header-comp
|
||||
|
||||
@@ -28,12 +28,12 @@
|
||||
cover {:uri (get-in (:images item) [:banner :uri])}]
|
||||
(if (= view-type :card-view)
|
||||
[quo/community-card-view-item (assoc item :width width :cover cover)
|
||||
#(rf/dispatch [:navigate-to :community-overview (:id item)])]
|
||||
#(rf/dispatch [:communities/navigate-to-community (:id item)])]
|
||||
[quo/community-list-item
|
||||
{:on-press (fn []
|
||||
(rf/dispatch [:communities/load-category-states (:id item)])
|
||||
(rf/dispatch [:dismiss-keyboard])
|
||||
(rf/dispatch [:navigate-to :community-overview (:id item)]))
|
||||
(rf/dispatch [:communities/navigate-to-community (:id item)]))
|
||||
:on-long-press #(rf/dispatch
|
||||
[:show-bottom-sheet
|
||||
{:content (fn []
|
||||
@@ -141,12 +141,12 @@
|
||||
(merge community
|
||||
(get mock-community-item-data :data)
|
||||
{:cover cover})
|
||||
#(rf/dispatch [:navigate-to :community-overview (:id community)])]
|
||||
#(rf/dispatch [:communities/navigate-to-community (:id community)])]
|
||||
[quo/community-list-item
|
||||
{:on-press (fn []
|
||||
(rf/dispatch [:communities/load-category-states (:id community)])
|
||||
(rf/dispatch [:dismiss-keyboard])
|
||||
(rf/dispatch [:navigate-to :community-overview (:id community)]))
|
||||
(rf/dispatch [:communities/navigate-to-community (:id community)]))
|
||||
:on-long-press #(js/alert "TODO: to be implemented")}
|
||||
(merge community
|
||||
(get mock-community-item-data :data))])]))
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
[react-native.reanimated :as reanimated]))
|
||||
|
||||
(def screen-padding 20)
|
||||
(def flash-button-size 32)
|
||||
(def flash-button-spacing 12)
|
||||
|
||||
(def flex-spacer {:flex 1})
|
||||
|
||||
@@ -69,10 +71,11 @@
|
||||
{:flex-direction :row
|
||||
:justify-content :space-between})
|
||||
|
||||
(def camera-flash-button
|
||||
(defn camera-flash-button
|
||||
[viewfinder]
|
||||
{:position :absolute
|
||||
:right 20
|
||||
:bottom 20})
|
||||
:top (- (+ (:y viewfinder) (:height viewfinder)) flash-button-size flash-button-spacing)
|
||||
:right (+ screen-padding flash-button-spacing)})
|
||||
|
||||
(defn border
|
||||
[border1 border2 corner]
|
||||
|
||||
@@ -3,21 +3,22 @@
|
||||
[oops.core :as oops]
|
||||
[quo2.core :as quo]
|
||||
[quo2.foundations.colors :as colors]
|
||||
[react-native.blur :as blur]
|
||||
[react-native.camera-kit :as camera-kit]
|
||||
[react-native.core :as rn]
|
||||
[react-native.blur :as blur]
|
||||
[react-native.hole-view :as hole-view]
|
||||
[react-native.permissions :as permissions]
|
||||
[react-native.platform :as platform]
|
||||
[react-native.reanimated :as reanimated]
|
||||
[react-native.safe-area :as safe-area]
|
||||
[reagent.core :as reagent]
|
||||
[status-im2.constants :as constants]
|
||||
[status-im2.contexts.syncing.scan-sync-code.style :as style]
|
||||
[status-im2.contexts.syncing.utils :as sync-utils]
|
||||
[utils.debounce :as debounce]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]
|
||||
[status-im2.contexts.syncing.utils :as sync-utils]
|
||||
[status-im.utils.platform :as platform]
|
||||
[react-native.reanimated :as reanimated]
|
||||
[status-im2.constants :as constants]
|
||||
[utils.debounce :as debounce]))
|
||||
[utils.transforms :as transforms]))
|
||||
|
||||
;; Android allow local network access by default. So, we need this check on iOS only.
|
||||
(defonce preflight-check-passed? (reagent/atom (if platform/ios? false true)))
|
||||
@@ -175,9 +176,7 @@
|
||||
[rn/view
|
||||
{:style style/qr-view-finder
|
||||
:on-layout (fn [event]
|
||||
(let [layout (js->clj (oops/oget event "nativeEvent.layout")
|
||||
:keywordize-keys
|
||||
true)
|
||||
(let [layout (transforms/js->clj (oops/oget event "nativeEvent.layout"))
|
||||
view-finder (assoc layout :height (:width layout))]
|
||||
(reset! qr-view-finder view-finder)))}])
|
||||
|
||||
@@ -215,15 +214,7 @@
|
||||
[rn/view
|
||||
[border :border-bottom-width :border-right-width :border-bottom-right-radius]
|
||||
[border-tip {:right 0 :top -1}]
|
||||
[border-tip {:left -1 :bottom 0}]]]
|
||||
[quo/button
|
||||
{:icon true
|
||||
:type :blur-bg
|
||||
:size 32
|
||||
:accessibility-label :camera-flash
|
||||
:override-background-color colors/neutral-80-opa-40
|
||||
:style style/camera-flash-button}
|
||||
:i/flashlight-off]]
|
||||
[border-tip {:left -1 :bottom 0}]]]]
|
||||
[quo/text
|
||||
{:size :paragraph-2
|
||||
:weight :regular
|
||||
@@ -279,7 +270,7 @@
|
||||
:text (i18n/label :t/error-this-is-not-a-sync-qr-code)}]))))
|
||||
|
||||
(defn render-camera
|
||||
[show-camera? qr-view-finder camera-ref on-read-code show-holes?]
|
||||
[show-camera? torch-mode qr-view-finder camera-ref on-read-code]
|
||||
(when (and show-camera? (:x qr-view-finder))
|
||||
[:<>
|
||||
[rn/view {:style style/camera-container}
|
||||
@@ -288,16 +279,13 @@
|
||||
:style style/camera-style
|
||||
:camera-type camera-kit/camera-type-back
|
||||
:zoom-mode :off
|
||||
;; https://github.com/status-im/status-mobile/issues/16243
|
||||
:torch-mode :off
|
||||
:torch-mode torch-mode
|
||||
:scan-barcode true
|
||||
:on-read-code on-read-code}]]
|
||||
[hole-view/hole-view
|
||||
{:style style/hole
|
||||
:holes (if show-holes?
|
||||
[(merge qr-view-finder
|
||||
{:borderRadius 16})]
|
||||
[])}
|
||||
:holes [(merge qr-view-finder
|
||||
{:borderRadius 16})]}
|
||||
[blur/view
|
||||
{:style style/absolute-fill
|
||||
:blur-amount 10
|
||||
@@ -307,13 +295,17 @@
|
||||
|
||||
(defn f-view
|
||||
[{:keys [title show-bottom-view? background animated?]}]
|
||||
(let [insets (safe-area/get-insets)
|
||||
active-tab (reagent/atom 1)
|
||||
qr-view-finder (reagent/atom {})
|
||||
render-camera? (reagent/atom false)]
|
||||
(let [insets (safe-area/get-insets)
|
||||
active-tab (reagent/atom 1)
|
||||
qr-view-finder (reagent/atom {})
|
||||
render-camera? (reagent/atom false)
|
||||
torch? (reagent/atom false)
|
||||
app-state-listener (atom nil)]
|
||||
(fn []
|
||||
(let [camera-ref (atom nil)
|
||||
read-qr-once? (atom false)
|
||||
torch-mode (if @torch? :on :off)
|
||||
flashlight-icon (if @torch? :i/flashlight-on :i/flashlight-off)
|
||||
;; The below check is to prevent scanning of any QR code
|
||||
;; when the user is in syncing progress screen
|
||||
user-in-syncing-progress-screen? (= (rf/sub [:view-id]) :syncing-progress)
|
||||
@@ -328,9 +320,8 @@
|
||||
scan-qr-code-tab? (= @active-tab 1)
|
||||
show-camera? (and scan-qr-code-tab?
|
||||
@camera-permission-granted?
|
||||
@preflight-check-passed?)
|
||||
show-holes? (and show-camera?
|
||||
(boolean (not-empty @qr-view-finder)))
|
||||
@preflight-check-passed?
|
||||
(boolean (not-empty @qr-view-finder)))
|
||||
title-opacity (reanimated/use-shared-value (if animated? 0 1))
|
||||
subtitle-opacity (reanimated/use-shared-value (if animated? 0 1))
|
||||
content-opacity (reanimated/use-shared-value (if animated? 0 1))
|
||||
@@ -361,6 +352,13 @@
|
||||
0
|
||||
:easing4))
|
||||
(if show-camera? 500 0)))]
|
||||
(rn/use-effect (fn []
|
||||
(reset! app-state-listener
|
||||
(.addEventListener rn/app-state
|
||||
"change"
|
||||
#(when (and (not= % "active") @torch?)
|
||||
(reset! torch? false))))
|
||||
#(.remove @app-state-listener)))
|
||||
(when animated?
|
||||
(reanimated/animate-shared-value-with-delay subtitle-opacity
|
||||
1 constants/onboarding-modal-animation-duration
|
||||
@@ -399,7 +397,7 @@
|
||||
[:<>
|
||||
background
|
||||
(when (or (not animated?) @render-camera?)
|
||||
[render-camera show-camera? @qr-view-finder camera-ref on-read-code show-holes?])
|
||||
[render-camera show-camera? torch-mode @qr-view-finder camera-ref on-read-code])
|
||||
[rn/view {:style (style/root-container (:top insets))}
|
||||
[header
|
||||
{:active-tab active-tab
|
||||
@@ -419,11 +417,21 @@
|
||||
:transform [{:translate-y content-translate-y}]}
|
||||
{})}
|
||||
(case @active-tab
|
||||
1 [scan-qr-code-tab qr-view-finder request-camera-permission]
|
||||
1 [scan-qr-code-tab qr-view-finder]
|
||||
2 [enter-sync-code-tab]
|
||||
nil)]
|
||||
[rn/view {:style style/flex-spacer}]
|
||||
(when show-bottom-view? [bottom-view insets bottom-view-translate-y])]]))))
|
||||
(when show-bottom-view? [bottom-view insets bottom-view-translate-y])
|
||||
(when (and (or (not animated?) @render-camera?) show-camera?)
|
||||
[quo/button
|
||||
{:icon true
|
||||
:type :blur-bg
|
||||
:size style/flash-button-size
|
||||
:accessibility-label :camera-flash
|
||||
:override-background-color colors/neutral-80-opa-40
|
||||
:style (style/camera-flash-button @qr-view-finder)
|
||||
:on-press #(swap! torch? not)}
|
||||
flashlight-icon])]]))))
|
||||
|
||||
(defn view
|
||||
[props]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "v0.161.6",
|
||||
"commit-sha1": "3170300d780e2f1479d467546d21f247f54463b5",
|
||||
"src-sha256": "10nx6gw0p5hnaxic5azb9wz392fxpzmbacvkwd8n1lammkcyqh1d"
|
||||
"version": "v0.162.3",
|
||||
"commit-sha1": "b2e56f5d2d22d7299a049f70127b415fae4da75a",
|
||||
"src-sha256": "0pz8ins5gz3f19syhi5rxz4j7115lakvw90yci85ci1k7rrhjxjk"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user