Skip to content

Commit

Permalink
Merge pull request #39987 from nextcloud/fix/39926-fix_predefined_sta…
Browse files Browse the repository at this point in the history
…tus-buttons

Fix predefined status buttons
  • Loading branch information
JuliaKirschenheuter authored Aug 22, 2023
2 parents da3c941 + 558f5f9 commit e42d82f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 20 deletions.
12 changes: 7 additions & 5 deletions apps/user_status/src/components/PredefinedStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,15 @@ export default {
}
&__input:checked + &__label,
&__input:focus + &__label,
&__label:hover {
background-color: var(--color-background-hover);
&__label:active {
outline: 2px solid var(--color-main-text);
box-shadow: 0 0 0 4px var(--color-main-background);
border-radius: var(--border-radius-large);
}
&__label:active {
background-color: var(--color-background-dark);
&__input:focus-visible + &__label {
outline: 2px solid var(--color-primary-element) !important;
border-radius: var(--border-radius-large);
}
}
</style>
20 changes: 12 additions & 8 deletions apps/user_status/src/components/PredefinedStatusesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
:icon="status.icon"
:message="status.message"
:clear-at="status.clearAt"
:selected="!isCustomStatus && lastSelected === status.id"
:selected="lastSelected === status.id"
@select="selectStatus(status)" />
</ul>
<div v-else
Expand All @@ -48,13 +48,6 @@ export default {
components: {
PredefinedStatus,
},
props: {
/** If the current selected status is a custom one */
isCustomStatus: {
type: Boolean,
required: true,
},
},
data() {
return {
lastSelected: null,
Expand All @@ -63,9 +56,20 @@ export default {
computed: {
...mapState({
predefinedStatuses: state => state.predefinedStatuses.predefinedStatuses,
messageId: state => state.userStatus.messageId,
}),
...mapGetters(['statusesHaveLoaded']),
},
watch: {
messageId: {
immediate: true,
handler() {
this.lastSelected = this.messageId
},
},
},
/**
* Loads all predefined statuses from the server
* when this component is mounted
Expand Down
2 changes: 1 addition & 1 deletion apps/user_status/src/components/SetStatusModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
:icon="backupIcon"
:message="backupMessage"
@select="revertBackupFromServer" />
<PredefinedStatusesList :is-custom-status="isCustomStatus" @select-status="selectPredefinedMessage" />
<PredefinedStatusesList @select-status="selectPredefinedMessage" />
<ClearAtSelect :clear-at="clearAt"
@select-clear-at="setClearAt" />
<div class="status-buttons">
Expand Down
4 changes: 2 additions & 2 deletions dist/user-status-modal-8299.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/user-status-modal-8299.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/user_status-menu.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/user_status-menu.js.map

Large diffs are not rendered by default.

0 comments on commit e42d82f

Please sign in to comment.