diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-04-27 19:38:41 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2021-05-30 10:28:57 +0200 |
commit | 9facd8fbf3621df573f0e56e54da0612482c3c62 (patch) | |
tree | f0130a5354a36f312444e017731bb2951f10d17a /src/components/AppContent | |
parent | bb5f38e9231b659f348fbd83422af0d65194037b (diff) |
Refactor circle actions
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'src/components/AppContent')
-rw-r--r-- | src/components/AppContent/CircleContent.vue | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/src/components/AppContent/CircleContent.vue b/src/components/AppContent/CircleContent.vue index 164aaf5b..eda997df 100644 --- a/src/components/AppContent/CircleContent.vue +++ b/src/components/AppContent/CircleContent.vue @@ -36,34 +36,36 @@ </EmptyContent> </AppContentDetails> - <!-- not a member --> - <AppContentDetails v-else-if="!circle.isMember"> - <EmptyContent v-if="!loadingJoin" icon="icon-circles"> - {{ t('contacts', 'You are not a member of this circle') }} - - <!-- Only show the join button if the circle is accepting requests --> - <template v-if="circle.canJoin" #desc> - <button :disabled="loadingJoin" class="primary" @click="requestJoin"> - {{ t('contacts', 'Request to join') }} - </button> - </template> - </EmptyContent> - - <EmptyContent v-else-if="circle.isPendingJoin" icon="icon-loading"> - {{ t('contacts', 'Your request to join this circle is pending approval') }} - </EmptyContent> - - <EmptyContent v-else icon="icon-loading"> - {{ t('contacts', 'Joining circle') }} - </EmptyContent> - </AppContentDetails> - <template v-else> <!-- member list --> <MemberList :list="members" /> <!-- main contacts details --> - <CircleDetails :circle-id="selectedCircle" /> + <CircleDetails :circle="circle"> + <!-- not a member --> + <template v-if="!circle.isMember"> + <!-- Join request in progress --> + <EmptyContent v-if="loadingJoin" icon="icon-loading"> + {{ t('contacts', 'Joining circle') }} + </EmptyContent> + + <!-- Pending request validation --> + <EmptyContent v-else-if="circle.isPendingJoin" icon="icon-loading"> + {{ t('contacts', 'Your request to join this circle is pending approval') }} + </EmptyContent> + + <EmptyContent v-else icon="icon-circles"> + {{ t('contacts', 'You are not a member of this circle') }} + + <!-- Only show the join button if the circle is accepting requests --> + <template v-if="circle.canJoin" #desc> + <button :disabled="loadingJoin" class="primary" @click="requestJoin"> + {{ t('contacts', 'Request to join') }} + </button> + </template> + </EmptyContent> + </template> + </CircleDetails> </template> </div> </AppContent> |