Explorar o código

Show different text for post thread button when not logged in

sbkwgh %!s(int64=7) %!d(string=hai) anos
pai
achega
b31e65240c
Modificáronse 1 ficheiros con 11 adicións e 2 borrados
  1. 11 2
      frontend/src/components/routes/Index.vue

+ 11 - 2
frontend/src/components/routes/Index.vue

@@ -16,8 +16,10 @@
 				<select-button v-model='selectedCategory':options='categories'></select-button>
 				<router-link
 					class='button button--blue'
-					v-if='$store.state.username' to='/thread/new'
-				>Post new thread</router-link>
+					to='/thread/new'
+				>
+					{{postNewThreadText}}
+				</router-link>
 			</div>
 		</div>
 		<div class='threads_main'>
@@ -165,6 +167,13 @@
 				get () {
 					return this.$store.state.category.selectedCategory
 				}
+			},
+			postNewThreadText () {
+				if(this.$store.state.username) {
+					return 'Post new thread'
+				} else {
+					return 'Login to post'
+				}
 			}
 		},
 		methods: {