Skip to content

Commit 1919093

Browse files
Merge pull request #6975 from christianbeeznest/fixes-updates166
Social: Use primary color for selected message tabs in Account/Home
2 parents e8b1a5d + a81544c commit 1919093

File tree

2 files changed

+30
-18
lines changed

2 files changed

+30
-18
lines changed

assets/css/scss/_social.scss

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,20 +1040,11 @@
10401040
}
10411041

10421042
#social-wall-container {
1043-
.tab {
1044-
padding: 0.5rem 1rem;
1045-
border-radius: 9999px;
1046-
transition: background-color 0.3s, color 0.3s;
1047-
cursor: pointer;
1043+
.tab-active:hover {
1044+
@apply bg-primary/90;
10481045
}
1049-
1050-
.tab:hover {
1051-
background-color: #e2e8f0;
1052-
}
1053-
1054-
.tab-active {
1055-
background-color: #3b82f6;
1056-
color: white;
1046+
.tab:disabled {
1047+
@apply opacity-60 cursor-not-allowed;
10571048
}
10581049
}
10591050

assets/vue/views/social/SocialWall.vue

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
<template>
22
<div id="social-wall-container">
3-
<div class="flex justify-center mb-6 space-x-4">
3+
<div
4+
class="flex justify-center mb-6 space-x-4"
5+
role="tablist"
6+
aria-label="Social wall filters"
7+
>
48
<button
5-
:class="['tab', { 'tab-active': !filterType }]"
9+
:class="tabClasses(null)"
10+
role="tab"
11+
:aria-selected="!filterType"
612
@click="filterMessages(null)"
13+
type="button"
714
>
815
{{ t("All Messages") }}
916
</button>
1017
<button
11-
:class="['tab', { 'tab-active': filterType === 'promoted' }]"
18+
:class="tabClasses('promoted')"
19+
role="tab"
20+
:aria-selected="filterType === 'promoted'"
1221
@click="filterMessages('promoted')"
22+
type="button"
1323
>
1424
{{ t("Promoted Messages") }}
1525
</button>
@@ -55,8 +65,8 @@ const isAdmin = securityStore.isAdmin
5565
watch(
5666
() => route.query.filterType,
5767
(newFilterType) => {
58-
filterType.value = newFilterType
59-
refreshPosts()
68+
filterType.value = newFilterType || null
69+
postListRef.value?.refreshPosts()
6070
},
6171
)
6272
@@ -73,4 +83,15 @@ function filterMessages(type) {
7383
router.push({ path: "/social", query: { filterType: type } })
7484
}
7585
}
86+
87+
function tabClasses(type) {
88+
const isActive = type ? filterType.value === type : !filterType.value
89+
return [
90+
"inline-flex items-center rounded-full border px-4 py-2 text-body-2 font-medium transition-colors duration-150",
91+
"focus:outline-none focus:ring-2 focus:ring-primary",
92+
isActive
93+
? "bg-primary border-primary text-white shadow-sm hover:bg-primary/90"
94+
: "bg-white border-gray-25 text-gray-90 hover:bg-gray-15",
95+
]
96+
}
7697
</script>

0 commit comments

Comments
 (0)