mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-06-13 19:42:01 +00:00
notifications tab now hidden for mobile users.
This commit is contained in:
parent
a3eb9edae7
commit
c222fced0e
2 changed files with 21 additions and 3 deletions
|
|
@ -3,7 +3,7 @@
|
|||
<div class="settings-box">
|
||||
<div class="tabs">
|
||||
<div class="tab"
|
||||
v-for="(tab, index) in tabs"
|
||||
v-for="(tab, index) in tabsFiltered"
|
||||
:key="index"
|
||||
:class="{selected: currentTab === index}"
|
||||
@click="currentTab = index">
|
||||
|
|
@ -32,11 +32,14 @@
|
|||
<script>
|
||||
import { bus } from "@/main";
|
||||
|
||||
import {isMobile} from '@/utils/Mobile';
|
||||
|
||||
const MyProfile = () => import("./SettingsPanels/MyProfile.vue");
|
||||
const ManageEmojis = () => import("./SettingsPanels/ManageEmojis.vue");
|
||||
const MessageDesign = () => import("./SettingsPanels/MessageDesign.vue");
|
||||
const Notifications = () => import("./SettingsPanels/Notifications.vue");
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
MyProfile,
|
||||
|
|
@ -71,7 +74,8 @@ export default {
|
|||
name: "Notifications",
|
||||
tabName: "Notifications",
|
||||
icon: "message",
|
||||
component: "notifications"
|
||||
component: "notifications",
|
||||
hidden: isMobile(),
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
@ -87,6 +91,11 @@ export default {
|
|||
visibility: false
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
tabsFiltered() {
|
||||
return this.tabs.filter(t => t.hidden !== true )
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -136,7 +145,7 @@ export default {
|
|||
border-radius: 5px;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
cursor: default;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
transition: 0.3s;
|
||||
align-items: center;
|
||||
|
|
|
|||
9
src/utils/Mobile.js
Normal file
9
src/utils/Mobile.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
exports.isMobile = () => {
|
||||
// if we want a more complete list use this: http://detectmobilebrowsers.com/
|
||||
// str.test() is more efficent than str.match()
|
||||
// remember str.test is case sensitive
|
||||
var isMobile = /iphone|ipod|android|ie|blackberry|fennec/.test(
|
||||
navigator.userAgent.toLowerCase()
|
||||
);
|
||||
return isMobile;
|
||||
};
|
||||
Loading…
Reference in a new issue