-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#17393] feat: add visibility update sheet
- Loading branch information
1 parent
32cfd21
commit 2a3772d
Showing
13 changed files
with
123 additions
and
33 deletions.
There are no files selected for viewing
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(ns status-im2.contexts.profile.settings.header.utils | ||
(:require [status-im2.constants :as constants] | ||
[utils.i18n :as i18n])) | ||
|
||
(defn visibility-status-type-data | ||
[status] | ||
(case (:status-type status) | ||
(constants/visibility-status-automatic) | ||
{:title (i18n/label :t/status-automatic) | ||
:icon :i/automatic} | ||
|
||
(constants/visibility-status-always-online) | ||
{:title (i18n/label :t/online) | ||
:icon :i/online} | ||
|
||
(constants/visibility-status-inactive) | ||
{:title (i18n/label :t/offline) | ||
:icon :i/offline} | ||
|
||
{:title (i18n/label :t/offline) | ||
:icon :i/offline})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/status_im/contexts/profile/settings/visibility_sheet/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
(ns status-im.contexts.profile.settings.visibility-sheet.view | ||
(:require [quo.core :as quo] | ||
[status-im.constants :as constants] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn change-visibility-status | ||
[status-type] | ||
(rf/dispatch | ||
[:visibility-status-updates/delayed-visibility-status-update status-type]) | ||
(rf/dispatch [:hide-bottom-sheet])) | ||
|
||
(defn view | ||
[{:keys [customization-color status-type]}] | ||
[quo/action-drawer | ||
[[{:icon :i/online | ||
:no-icon-color? true | ||
:state (when (= status-type constants/visibility-status-always-online) :selected) | ||
:customization-color customization-color | ||
:accessibility-label :online | ||
:label (i18n/label :t/online) | ||
:on-press #(change-visibility-status constants/visibility-status-always-online)} | ||
{:icon :i/offline | ||
:no-icon-color? true | ||
:state (when (= status-type constants/visibility-status-inactive) :selected) | ||
:accessibility-label :offline | ||
:customization-color customization-color | ||
:label (i18n/label :t/offline) | ||
:sub-label (i18n/label :t/status-inactive-subtitle) | ||
:on-press #(change-visibility-status constants/visibility-status-inactive)} | ||
{:icon :i/automatic | ||
:no-icon-color? true | ||
:state (when (= status-type constants/visibility-status-automatic) :selected) | ||
:accessibility-label :automatic | ||
:customization-color customization-color | ||
:label (i18n/label :t/status-automatic) | ||
:sub-label (i18n/label :t/status-automatic-subtitle) | ||
:on-press #(change-visibility-status constants/visibility-status-automatic)}]]]) |