Skip to content

Commit

Permalink
Merge branch 'negue/ui/combined-messages-restyling' into qa/starfish
Browse files Browse the repository at this point in the history
  • Loading branch information
negue committed Jan 13, 2025
2 parents f1b228d + 70cf860 commit 4497f42
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions website/client/src/pages/private-messages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ $background: $white;
align-items: center;
justify-content: center;
height: 44px;
color: $yellow-1;
background: $yellow-500;
width: 100%;
Expand Down Expand Up @@ -581,7 +583,6 @@ const UI_STATES = Object.freeze({
NO_CONVERSATIONS_SELECTED: 'NO_CONVERSATIONS_SELECTED',
START_NEW_CONVERSATION: 'START_NEW_CONVERSATION',
CONVERSATION_SELECTED: 'CONVERSATION_SELECTED',
DISABLED: 'DISABLED',
});
export default defineComponent({
Expand Down Expand Up @@ -750,9 +751,7 @@ export default defineComponent({
description: this.$t('PMPlaceholderDescription'),
};
},
/**
* Any value return, switches the uiState to DISABLED
*/
disabledTexts () {
if (this.user.flags.chatRevoked) {
return {
Expand All @@ -763,15 +762,6 @@ export default defineComponent({
};
}
if (this.user.inbox.optOut) {
return {
enableInput: true,
showBottomInfo: false,
title: this.$t('PMDisabledCaptionTitle'),
description: this.$t('PMDisabledCaptionText'),
};
}
if (this.selectedConversation?.key) {
if (this.user.inbox.blocks.includes(this.selectedConversation.key)) {
return {
Expand All @@ -792,6 +782,15 @@ export default defineComponent({
}
}
if (this.user.inbox.optOut) {
return {
enableInput: true,
showBottomInfo: false,
title: this.$t('PMDisabledCaptionTitle'),
description: this.$t('PMDisabledCaptionText'),
};
}
return null;
},
optTextSet () {
Expand All @@ -813,13 +812,12 @@ export default defineComponent({
return '';
},
newMessageDisabled () {
if (this.uiState === UI_STATES.DISABLED) {
if (this.disabledTexts) {
return !this.disabledTexts.enableInput;
}
return [
UI_STATES.NO_CONVERSATIONS_SELECTED,
UI_STATES.DISABLED,
UI_STATES.NO_CONVERSATIONS,
UI_STATES.LOADING,
].includes(this.uiState);
Expand All @@ -829,10 +827,6 @@ export default defineComponent({
return UI_STATES.LOADING;
}
if (this.disabledTexts) {
return UI_STATES.DISABLED;
}
if (this.loadedConversations.length === 0) {
return UI_STATES.NO_CONVERSATIONS;
}
Expand All @@ -855,8 +849,7 @@ export default defineComponent({
switch (currentUiState) {
case UI_STATES.CONVERSATION_SELECTED:
case UI_STATES.START_NEW_CONVERSATION:
case UI_STATES.DISABLED: {
case UI_STATES.START_NEW_CONVERSATION: {
return true;
}
Expand Down

0 comments on commit 4497f42

Please sign in to comment.