Browse Source

refactor: converted banned page to Vue composite API

Kristian Vos 2 years ago
parent
commit
ef15910766
1 changed files with 10 additions and 11 deletions
  1. 10 11
      frontend/src/pages/Banned.vue

+ 10 - 11
frontend/src/pages/Banned.vue

@@ -1,3 +1,13 @@
+<script setup lang="ts">
+import { computed } from "vue";
+import { formatDistance } from "date-fns";
+import { useStore } from "vuex";
+
+const store = useStore();
+
+const ban = computed(() => store.state.user.auth.ban);
+</script>
+
 <template>
 	<div class="container">
 		<page-metadata title="Banned" />
@@ -14,17 +24,6 @@
 		</h5>
 	</div>
 </template>
-<script>
-import { mapState } from "vuex";
-import { formatDistance } from "date-fns"; // eslint-disable-line no-unused-vars
-
-export default {
-	computed: mapState({
-		ban: state => state.user.auth.ban
-	}),
-	methods: { formatDistance }
-};
-</script>
 
 <style lang="less" scoped>
 .container {