fix: community buttons (#18392)

This commit is contained in:
BalogunofAfrica 2024-01-05 17:17:51 +01:00 committed by GitHub
parent e7b92dcf25
commit 1919094b46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 52 additions and 47 deletions

View File

@ -7,8 +7,7 @@
:margin-top 16})
(def community-rule-index
{:margin-left 5})
{:margin-left 4})
(def community-rule-text
{:margin-left 6
:flex 1})
{:flex 1})

View File

@ -44,9 +44,10 @@
(str title ": " content)]])
(defn view
[rules]
[rules scroll-enabled?]
[rn/flat-list
{:shows-horizontal-scroll-indicator false
:scroll-enabled scroll-enabled?
:data rules
:separator [rn/view {:margin-top 1}]
:render-fn community-rule-item}])

View File

@ -11,32 +11,31 @@
:align-items :center
:justify-content :space-between})
(def request-icon
{:height 32
:width 32
:align-items :center
:background-color colors/white
:border-color colors/neutral-20
:border-width 1
:border-radius 8
:display :flex
:justify-content :center})
(def container
{:flex 1})
(def community-icon
{:margin-right :auto :margin-top 4})
(def cancel-button
{:flex 1
:margin-right 12})
(defn bottom-container
[]
(def bottom-container
{:padding-top 32
:flex-direction :row
:align-items :center
:margin-horizontal 20
:justify-content :space-evenly})
(def final-disclaimer-container
{:margin-top 12
{:margin-bottom 7
:margin-top 12
:padding-horizontal 40})
(def final-disclaimer-text
{:color colors/neutral-50
:text-align :center})
(def rules-text
{:margin-top 24})

View File

@ -1,6 +1,8 @@
(ns status-im.contexts.communities.actions.request-to-join.view
(:require
[quo.core :as quo]
[quo.foundations.colors :as colors]
[quo.theme]
[react-native.core :as rn]
[react-native.gesture :as gesture]
[status-im.common.password-authentication.view :as password-authentication]
@ -18,14 +20,15 @@
{:community-id id :password %}])}])
(rf/dispatch [:navigate-back]))
(defn request-to-join
[]
(defn- view-internal
[{:keys [theme]}]
(fn []
(let [{:keys [name
id
images]} (rf/sub [:get-screen-params])]
[rn/view {:flex 1}
[gesture/scroll-view {:style {:flex 1}}
images]} (rf/sub [:get-screen-params])
{:keys [color]} (rf/sub [:communities/community id])]
[rn/safe-area-view {:flex 1}
[gesture/scroll-view {:style style/container}
[rn/view style/page-container
[rn/view {:style style/title-container}
[quo/text
@ -33,20 +36,20 @@
:weight :semi-bold
:size :heading-2}
(i18n/label :t/request-to-join)]]
[rn/view {:style {:margin-right :auto :margin-top 8}}
[rn/view {:style style/community-icon}
[quo/context-tag
{:type :community
:size 24
:community-logo (:thumbnail images)
:community-name name}]]
[quo/text
{:style {:margin-top 24}
{:style style/rules-text
:accessibility-label :communities-rules-title
:weight :semi-bold
:size :paragraph-1}
(i18n/label :t/community-rules)]
[community-rules/view community-rules/standard-rules]
[rn/view {:style (style/bottom-container)}
[community-rules/view community-rules/standard-rules false]]]
[rn/view {:style style/bottom-container}
[quo/button
{:accessibility-label :cancel
:on-press #(rf/dispatch [:navigate-back])
@ -56,10 +59,13 @@
[quo/button
{:accessibility-label :join-community-button
:on-press #(join-community-and-navigate-back id)
:container-style {:flex 1}}
:container-style {:flex 1}
:inner-style {:background-color (colors/resolve-color color theme)}}
(i18n/label :t/request-to-join)]]
[rn/view {:style style/final-disclaimer-container}
[quo/text
{:size :paragraph-2
:style style/final-disclaimer-text}
(i18n/label :t/request-to-join-disclaimer)]]]]])))
(i18n/label :t/request-to-join-disclaimer)]]])))
(def view (quo.theme/with-theme view-internal))

View File

@ -97,7 +97,7 @@
{:name :community-requests-to-join
:options {:sheet? true}
:component join-menu/request-to-join}
:component join-menu/view}
{:name :community-account-selection
:options {:sheet? true}