Move logout button to settings modal

This commit is contained in:
eris 2022-08-07 06:32:05 +00:00
parent b982c34694
commit 406c5dbb88
6 changed files with 28 additions and 21 deletions

View file

@ -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
}, },

View file

@ -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;
} }
} }

View file

@ -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>

View file

@ -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
}, },

View file

@ -71,5 +71,10 @@
display: flex; display: flex;
flex-grow: 1; flex-grow: 1;
} }
.logout-button {
position: absolute;
right: 20px;
}
} }
} }

View file

@ -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>