mirror of
https://akkoma.dev/AkkomaGang/akkoma-fe
synced 2025-05-11 23:19:14 +08:00
Move logout button to settings modal
This commit is contained in:
parent
b982c34694
commit
406c5dbb88
6 changed files with 28 additions and 21 deletions
|
@ -98,10 +98,6 @@ export default {
|
||||||
scrollToTop () {
|
scrollToTop () {
|
||||||
window.scrollTo(0, 0)
|
window.scrollTo(0, 0)
|
||||||
},
|
},
|
||||||
logout () {
|
|
||||||
this.$router.replace('/main/public')
|
|
||||||
this.$store.dispatch('logout')
|
|
||||||
},
|
|
||||||
onSearchBarToggled (hidden) {
|
onSearchBarToggled (hidden) {
|
||||||
this.searchBarHidden = hidden
|
this.searchBarHidden = hidden
|
||||||
},
|
},
|
||||||
|
|
|
@ -101,10 +101,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-logout {
|
|
||||||
margin-left: 2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.svg-inline--fa {
|
.svg-inline--fa {
|
||||||
color: $fallback--link;
|
color: $fallback--link;
|
||||||
color: var(--topBarLink, $fallback--link);
|
color: var(--topBarLink, $fallback--link);
|
||||||
|
@ -112,7 +108,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.-wide {
|
.-wide {
|
||||||
.nav-icon:not(.nav-icon-logout) {
|
.nav-icon {
|
||||||
margin-left: 0.7em;
|
margin-left: 0.7em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,18 +164,6 @@
|
||||||
:title="$t('nav.administration')"
|
:title="$t('nav.administration')"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
<button
|
|
||||||
v-if="currentUser"
|
|
||||||
class="button-unstyled nav-icon nav-icon-logout"
|
|
||||||
@click.prevent="logout"
|
|
||||||
>
|
|
||||||
<FAIcon
|
|
||||||
fixed-width
|
|
||||||
class="fa-scale-110 fa-old-padding"
|
|
||||||
icon="sign-out-alt"
|
|
||||||
:title="$t('login.logout')"
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -14,6 +14,7 @@ import {
|
||||||
faTimes,
|
faTimes,
|
||||||
faFileUpload,
|
faFileUpload,
|
||||||
faFileDownload,
|
faFileDownload,
|
||||||
|
faSignOutAlt,
|
||||||
faChevronDown
|
faChevronDown
|
||||||
} from '@fortawesome/free-solid-svg-icons'
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
import {
|
import {
|
||||||
|
@ -28,6 +29,7 @@ library.add(
|
||||||
faWindowMinimize,
|
faWindowMinimize,
|
||||||
faFileUpload,
|
faFileUpload,
|
||||||
faFileDownload,
|
faFileDownload,
|
||||||
|
faSignOutAlt,
|
||||||
faChevronDown
|
faChevronDown
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -66,6 +68,11 @@ const SettingsModal = {
|
||||||
closeModal () {
|
closeModal () {
|
||||||
this.$store.dispatch('closeSettingsModal')
|
this.$store.dispatch('closeSettingsModal')
|
||||||
},
|
},
|
||||||
|
logout () {
|
||||||
|
this.$router.replace('/main/public')
|
||||||
|
this.$store.dispatch('closeSettingsModal')
|
||||||
|
this.$store.dispatch('logout')
|
||||||
|
},
|
||||||
peekModal () {
|
peekModal () {
|
||||||
this.$store.dispatch('togglePeekSettingsModal')
|
this.$store.dispatch('togglePeekSettingsModal')
|
||||||
},
|
},
|
||||||
|
@ -150,6 +157,7 @@ const SettingsModal = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
currentUser () { return this.$store.state.users.currentUser },
|
||||||
currentSaveStateNotice () {
|
currentSaveStateNotice () {
|
||||||
return this.$store.state.interface.settings.currentSaveStateNotice
|
return this.$store.state.interface.settings.currentSaveStateNotice
|
||||||
},
|
},
|
||||||
|
|
|
@ -71,5 +71,10 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.logout-button {
|
||||||
|
position: absolute;
|
||||||
|
right: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,6 +111,20 @@
|
||||||
id="unscrolled-content"
|
id="unscrolled-content"
|
||||||
class="extra-content"
|
class="extra-content"
|
||||||
/>
|
/>
|
||||||
|
<button
|
||||||
|
v-if="currentUser"
|
||||||
|
class="button-default logout-button"
|
||||||
|
:title="$t('login.logout')"
|
||||||
|
:aria-label="$t('login.logout')"
|
||||||
|
@click.prevent="logout"
|
||||||
|
>
|
||||||
|
<FAIcon
|
||||||
|
fixed-width
|
||||||
|
class="fa-scale-110 fa-old-padding"
|
||||||
|
icon="sign-out-alt"
|
||||||
|
/>
|
||||||
|
<span>{{ $t('login.logout') }}</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
Loading…
Reference in a new issue