mirror of
https://github.com/danbulant/Nertivia-Client
synced 2026-06-21 15:41:51 +00:00
show link menu when clicking on edit avatar.
This commit is contained in:
parent
ec5263cbc0
commit
15f7fc331d
6 changed files with 61 additions and 10 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="dark-background">
|
<div class="dark-background">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<div class="text">
|
<div class="text">
|
||||||
To upload files and images, You must link your Google Drive account with your Nertivia account.
|
To upload files, images or set avatars, You must link your Google Drive account with your Nertivia account.
|
||||||
</div>
|
</div>
|
||||||
<div class="images">
|
<div class="images">
|
||||||
<div class="image GDrive-img"></div>
|
<div class="image GDrive-img"></div>
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
background: rgba(0, 0, 0, 0.781);
|
background: rgba(0, 0, 0, 0.781);
|
||||||
z-index: 1;
|
z-index: 111111;
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.inner {
|
.inner {
|
||||||
|
|
@ -30,16 +30,18 @@
|
||||||
height: 400px;
|
height: 400px;
|
||||||
width: 400px;
|
width: 400px;
|
||||||
background: rgb(32, 32, 32);
|
background: rgb(32, 32, 32);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
color: white;
|
color: white;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
.text{
|
.text{
|
||||||
color: white;
|
color: white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
|
padding-left: 10px;
|
||||||
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
.images{
|
.images{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="options">
|
<div class="options">
|
||||||
<input type="file" accept="image/*" ref="avatarBrowser" @change="avatarBrowse" class="hidden">
|
<input type="file" accept="image/*" ref="avatarBrowser" @change="avatarBrowse" class="hidden">
|
||||||
<div class="option" @click="$refs.avatarBrowser.click()">Edit Avatar</div>
|
<div class="option" @click="editAvatarBtn">Edit Avatar</div>
|
||||||
<div class="option" @click="changePassword">Change Password</div>
|
<div class="option" @click="changePassword">Change Password</div>
|
||||||
<div class="option red" @click="logout">Logout</div>
|
<div class="option red" @click="logout">Logout</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
<script>
|
<script>
|
||||||
import UploadService from '@/services/UploadService.js'
|
import UploadService from '@/services/UploadService.js'
|
||||||
import config from '@/config.js'
|
import config from '@/config.js'
|
||||||
|
import {bus} from '@/main'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -74,6 +75,12 @@ export default {
|
||||||
changePassword() {
|
changePassword() {
|
||||||
this.alert.content = 'Not implemented yet.';
|
this.alert.content = 'Not implemented yet.';
|
||||||
return this.alert.show = true;
|
return this.alert.show = true;
|
||||||
|
},
|
||||||
|
editAvatarBtn() {
|
||||||
|
if(!this.$store.getters.settings.GDriveLinked) {
|
||||||
|
return bus.$emit('GDriveLink:show');
|
||||||
|
}
|
||||||
|
this.$refs.avatarBrowser.click()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,13 @@ import socketModule from './modules/socketIOModule';
|
||||||
import channelModule from './modules/channelModule';
|
import channelModule from './modules/channelModule';
|
||||||
import messageModule from './modules/messageModule';
|
import messageModule from './modules/messageModule';
|
||||||
import notificationsModule from './modules/notificationsModule';
|
import notificationsModule from './modules/notificationsModule';
|
||||||
|
import settingsModule from './modules/settingsModule';
|
||||||
import {router} from './../router'
|
import {router} from './../router'
|
||||||
|
|
||||||
Vue.use(Vuex);
|
Vue.use(Vuex);
|
||||||
|
|
||||||
export const store = new Vuex.Store({
|
export const store = new Vuex.Store({
|
||||||
modules: { user, channelModule, messageModule, notificationsModule, socketModule },
|
modules: { user, channelModule, messageModule, notificationsModule, socketModule,settingsModule },
|
||||||
state: {
|
state: {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
||||||
36
src/store/modules/settingsModule.js
Normal file
36
src/store/modules/settingsModule.js
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
import Vue from 'vue'
|
||||||
|
import {bus} from '../../main'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const state = {
|
||||||
|
settings: {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getters = {
|
||||||
|
settings(state) {
|
||||||
|
return state.settings;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const actions = {
|
||||||
|
setSettings(context, settings) {
|
||||||
|
context.commit('setSettings', settings)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const mutations = {
|
||||||
|
setSettings(state, settings) {
|
||||||
|
state.settings = settings;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
namespace: true,
|
||||||
|
state,
|
||||||
|
getters,
|
||||||
|
actions,
|
||||||
|
mutations
|
||||||
|
}
|
||||||
|
|
@ -16,7 +16,7 @@ const actions = {
|
||||||
},
|
},
|
||||||
socket_success(context, data) {
|
socket_success(context, data) {
|
||||||
|
|
||||||
const {message, user, dms, notifications, currentFriendStatus} = data;
|
const {message, user, dms, notifications, currentFriendStatus, settings} = data;
|
||||||
const friendsArray = user.friends;
|
const friendsArray = user.friends;
|
||||||
const friendObject = {};
|
const friendObject = {};
|
||||||
|
|
||||||
|
|
@ -44,6 +44,7 @@ const actions = {
|
||||||
}
|
}
|
||||||
context.commit('addAllChannels', channelsObject)
|
context.commit('addAllChannels', channelsObject)
|
||||||
context.dispatch('addAllNotifications', notifications)
|
context.dispatch('addAllNotifications', notifications)
|
||||||
|
context.dispatch('setSettings', settings)
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@
|
||||||
</transition>
|
</transition>
|
||||||
<transition name="fade">
|
<transition name="fade">
|
||||||
<settings v-if="showSettings && loggedIn" />
|
<settings v-if="showSettings && loggedIn" />
|
||||||
<!--<GDriveLinkMenu v-if="loggedIn" /> -->
|
|
||||||
</transition>
|
</transition>
|
||||||
|
<GDriveLinkMenu v-if="loggedIn && showGDLinkMenu" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -41,6 +41,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
showLeftPanel: false,
|
showLeftPanel: false,
|
||||||
showSettings: false,
|
showSettings: false,
|
||||||
|
showGDLinkMenu: false,
|
||||||
title: "Nertivia"
|
title: "Nertivia"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -69,6 +70,9 @@ export default {
|
||||||
bus.$on('title:change', (title) => {
|
bus.$on('title:change', (title) => {
|
||||||
this.title = title;
|
this.title = title;
|
||||||
})
|
})
|
||||||
|
bus.$on('GDriveLink:show', () => {
|
||||||
|
this.showGDLinkMenu = true;
|
||||||
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
loggedIn() {
|
loggedIn() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue