aboutsummaryrefslogtreecommitdiff
path: root/src/site/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/site/components')
-rw-r--r--src/site/components/footer/Footer.vue12
-rw-r--r--src/site/components/grid/Grid.vue8
-rw-r--r--src/site/components/loading/BulmaLoading.vue33
-rw-r--r--src/site/components/navbar/Navbar.vue4
-rw-r--r--src/site/components/sidebar/Sidebar.vue15
5 files changed, 53 insertions, 19 deletions
diff --git a/src/site/components/footer/Footer.vue b/src/site/components/footer/Footer.vue
index 49f622c..44e34f4 100644
--- a/src/site/components/footer/Footer.vue
+++ b/src/site/components/footer/Footer.vue
@@ -49,15 +49,15 @@
</footer>
</template>
<script>
+import { mapState, mapGetters } from 'vuex';
import { saveAs } from 'file-saver';
+
export default {
computed: {
- loggedIn() {
- return this.$store.state.loggedIn;
- },
- version() {
- return this.$store.state.config.version;
- }
+ ...mapGetters({ loggedIn: 'auth/isLoggedIn' }),
+ ...mapState({
+ version: state => state.config.version
+ })
},
methods: {
createShareXThing() {
diff --git a/src/site/components/grid/Grid.vue b/src/site/components/grid/Grid.vue
index 279472c..a06eabf 100644
--- a/src/site/components/grid/Grid.vue
+++ b/src/site/components/grid/Grid.vue
@@ -198,6 +198,8 @@
</template>
<script>
+import { mapState } from 'vuex';
+
import Waterfall from './waterfall/Waterfall.vue';
import WaterfallItem from './waterfall/WaterfallItem.vue';
@@ -246,9 +248,9 @@ export default {
};
},
computed: {
- user() {
- return this.$store.state.user;
- },
+ ...mapState({
+ user: state => state.auth.user
+ }),
blank() {
return require('@/assets/images/blank.png');
},
diff --git a/src/site/components/loading/BulmaLoading.vue b/src/site/components/loading/BulmaLoading.vue
new file mode 100644
index 0000000..37cc5a5
--- /dev/null
+++ b/src/site/components/loading/BulmaLoading.vue
@@ -0,0 +1,33 @@
+<template>
+ <div class="loader-wrapper">
+ <div class="loader is-loading" />
+ </div>
+</template>
+
+<style lang="scss" scoped>
+ .loader-wrapper {
+ position: absolute;
+ top: 0;
+ left: 0;
+ height: 100%;
+ width: 100%;
+ background: #fff;
+ opacity: 0;
+ z-index: -1;
+ transition: opacity .3s;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border-radius: 6px;
+
+ .loader {
+ height: 80px;
+ width: 80px;
+ }
+
+ &.is-active {
+ opacity: 1;
+ z-index: 1;
+ }
+ }
+</style>
diff --git a/src/site/components/navbar/Navbar.vue b/src/site/components/navbar/Navbar.vue
index aa4a672..7fb2f22 100644
--- a/src/site/components/navbar/Navbar.vue
+++ b/src/site/components/navbar/Navbar.vue
@@ -82,8 +82,8 @@ export default {
...mapState(['config'])
},
methods: {
- logOut() {
- this.$store.dispatch('logout');
+ async logOut() {
+ await this.$store.dispatch('auth/logout');
this.$router.replace('/login');
}
}
diff --git a/src/site/components/sidebar/Sidebar.vue b/src/site/components/sidebar/Sidebar.vue
index a2ad3f4..3cb8b43 100644
--- a/src/site/components/sidebar/Sidebar.vue
+++ b/src/site/components/sidebar/Sidebar.vue
@@ -6,13 +6,11 @@
<router-link to="/dashboard/albums">
<i class="icon-interface-window" />Albums
</router-link>
- <!--
<router-link to="/dashboard/tags">
<i class="icon-ecommerce-tag-c" />Tags
</router-link>
- -->
<router-link to="/dashboard/account">
- <i class="icon-ecommerce-tag-c" />Account
+ <i class="icon-user-alt" />Account
</router-link>
<template v-if="user && user.isAdmin">
<router-link to="/dashboard/admin/users">
@@ -28,13 +26,14 @@
</div>
</template>
<script>
+import { mapState } from 'vuex';
+
export default {
- computed: {
- user() {
- return this.$store.state.user;
- }
- }
+ computed: mapState({
+ user: state => state.auth.user
+ })
};
+
</script>
<style lang="scss" scoped>
@import '~/assets/styles/_colors.scss';