notifications tab now hidden for mobile users.

This commit is contained in:
supertiger1234 2019-09-02 15:16:23 +01:00
parent a3eb9edae7
commit c222fced0e
2 changed files with 21 additions and 3 deletions

View file

@ -3,7 +3,7 @@
<div class="settings-box"> <div class="settings-box">
<div class="tabs"> <div class="tabs">
<div class="tab" <div class="tab"
v-for="(tab, index) in tabs" v-for="(tab, index) in tabsFiltered"
:key="index" :key="index"
:class="{selected: currentTab === index}" :class="{selected: currentTab === index}"
@click="currentTab = index"> @click="currentTab = index">
@ -32,11 +32,14 @@
<script> <script>
import { bus } from "@/main"; import { bus } from "@/main";
import {isMobile} from '@/utils/Mobile';
const MyProfile = () => import("./SettingsPanels/MyProfile.vue"); const MyProfile = () => import("./SettingsPanels/MyProfile.vue");
const ManageEmojis = () => import("./SettingsPanels/ManageEmojis.vue"); const ManageEmojis = () => import("./SettingsPanels/ManageEmojis.vue");
const MessageDesign = () => import("./SettingsPanels/MessageDesign.vue"); const MessageDesign = () => import("./SettingsPanels/MessageDesign.vue");
const Notifications = () => import("./SettingsPanels/Notifications.vue"); const Notifications = () => import("./SettingsPanels/Notifications.vue");
export default { export default {
components: { components: {
MyProfile, MyProfile,
@ -71,7 +74,8 @@ export default {
name: "Notifications", name: "Notifications",
tabName: "Notifications", tabName: "Notifications",
icon: "message", icon: "message",
component: "notifications" component: "notifications",
hidden: isMobile(),
} }
] ]
}; };
@ -87,6 +91,11 @@ export default {
visibility: false visibility: false
}); });
} }
},
computed: {
tabsFiltered() {
return this.tabs.filter(t => t.hidden !== true )
}
} }
}; };
</script> </script>
@ -136,7 +145,7 @@ export default {
border-radius: 5px; border-radius: 5px;
margin-top: 5px; margin-top: 5px;
margin-bottom: 5px; margin-bottom: 5px;
cursor: default; cursor: pointer;
user-select: none; user-select: none;
transition: 0.3s; transition: 0.3s;
align-items: center; align-items: center;

9
src/utils/Mobile.js Normal file
View 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;
};