소스 검색

:wrench: layout + functional tabs between pending/paired

tags/0.0.1^2
juancarbajal98 3 년 전
부모
커밋
11ccf98d52
1개의 변경된 파일40개의 추가작업 그리고 5개의 파일을 삭제
  1. 40
    5
      frontend/src/views/MatchesView.vue

+ 40
- 5
frontend/src/views/MatchesView.vue 파일 보기

1
 <template lang="pug">
1
 <template lang="pug">
2
 main.view--matches
2
 main.view--matches
3
+    .select--matches
4
+        .matches--pending(:class="currentTab =='pending' ? 'active':'idle'" @click="switchTab('pending')") Pending
5
+        .matches--paired(:class="currentTab =='paired' ? 'active':'idle'" @click="switchTab('paired')") Paired
3
 
6
 
4
     article.pa12
7
     article.pa12
5
-        template(v-if='matches.length && !loading')
6
-            h2 atches
7
-            ProfileCardList(:pid='pid' :profiles='matches' @reload='getCards')
8
+        template(v-if="currentTab=='pending'")
9
+            p Pending Matches
10
+        template(v-else)
11
+            p Paired Matches
12
+        //- template(v-if='matches.length && !loading')
13
+        //-     h2 atches
14
+        //-     ProfileCardList(:pid='pid' :profiles='matches' @reload='getCards')
8
 
15
 
9
-        p(v-else-if='matches.length === 0') No matches.
10
-        w-spinner(v-else bounce)
16
+        //- p(v-else-if='matches.length === 0') No matches.
17
+        //- w-spinner(v-else bounce)
11
 
18
 
12
     MainNav
19
     MainNav
13
 </template>
20
 </template>
22
     name: 'MatchView',
29
     name: 'MatchView',
23
     components: { ProfileCardList },
30
     components: { ProfileCardList },
24
     mixins: [mixins.pidMixin, mixins.cardMixin],
31
     mixins: [mixins.pidMixin, mixins.cardMixin],
32
+    data: () => ({
33
+        currentTab: 'pending'
34
+    }),
25
     methods: {
35
     methods: {
26
         /** Gets called from cardMixin */
36
         /** Gets called from cardMixin */
27
         async getCards() {
37
         async getCards() {
33
             }
43
             }
34
             this.loading = false
44
             this.loading = false
35
         },
45
         },
46
+        switchTab(tab){
47
+            if(this.currentTab === tab) return
48
+            this.currentTab = tab
49
+        }
36
     },
50
     },
37
 }
51
 }
38
 </script>
52
 </script>
53
+<style>
54
+.select--matches{
55
+    display: flex;
56
+    justify-content: space-between;
57
+    margin: 0 25px;
58
+}
59
+.select--matches > div{
60
+    width: 100%;
61
+    text-align: center;
62
+    font-size: 16px;
63
+    line-height: 40px;
64
+}
65
+.active{
66
+    border-bottom: 3px solid #F2CD5C;
67
+    color: #F2CD5C;
68
+}
69
+.idle{
70
+    color: #BCC5D3;
71
+}
72
+
73
+</style>

Loading…
취소
저장