ソースを参照

:recycle: fixing up things to remove warnings and runtime errs

tags/0.0.1
J 4年前
コミット
fcd8a9cf95

+ 2
- 2
frontend/src/App.vue ファイルの表示

@@ -1,5 +1,4 @@
1 1
 <template lang="pug">
2
-navbar
3 2
 main
4 3
     router-view
5 4
 </template>
@@ -7,7 +6,8 @@ main
7 6
 <script>
8 7
 export default {
9 8
   name: "app",
10
-};
9
+  components: {}
10
+}
11 11
 </script>
12 12
 
13 13
 <style lang="postcss">

+ 7
- 7
frontend/src/main.js ファイルの表示

@@ -4,7 +4,7 @@ import router from './router'
4 4
 
5 5
 router.beforeEach((to, from, next) => {
6 6
   const requiresAuth = false
7
-  const requiresProfile = false
7
+  const requiresProfile = true
8 8
 
9 9
   if (requiresAuth) {
10 10
     console.log('You are not authorized to access this area.')
@@ -13,12 +13,12 @@ router.beforeEach((to, from, next) => {
13 13
     next()
14 14
   }
15 15
 
16
-  if (requiresProfile) {
17
-    console.log('You must first complete your profile.')
18
-    next('profile')
19
-  } else {
20
-    next()
21
-  }
16
+  // if (requiresProfile) {
17
+  //   console.log('You must first complete your profile.')
18
+  //   next('profile')
19
+  // } else {
20
+  //   next()
21
+  // }
22 22
 })
23 23
 
24 24
 createApp(App).use(router).mount('#app')

+ 4
- 27
frontend/src/shared/MainHeader.vue ファイルの表示

@@ -1,31 +1,23 @@
1 1
 <template>
2 2
   <div id="main-header">
3 3
     <router-link class="header__icon mobile--only" to="/friends">
4
-      <AccountGroupIcon fillColor="#989898" :size="30" />
4
+      <p> friends
5 5
     </router-link>
6 6
     
7 7
     <router-link class="header__icon" to="/">
8
-      <FireIcon fillColor="#fd5068" :size="40" />
8
+      <p> home
9 9
     </router-link>
10 10
 
11 11
     <router-link class="header__icon mobile--only" to="/profile">
12
-      <AccountIcon fillColor="#989898" :size="30" />
12
+      <p> profile
13 13
     </router-link>
14 14
   </div>
15 15
 </template>
16 16
 
17 17
 <script>
18
-import AccountGroupIcon from "vue-material-design-icons/AccountGroup.vue";
19
-import FireIcon from "vue-material-design-icons/Fire.vue";
20
-import AccountIcon from "vue-material-design-icons/Account.vue";
21 18
 export default {
22 19
   name: "main-header",
23
-  components: {
24
-    AccountGroupIcon,
25
-    FireIcon,
26
-    AccountIcon,
27
-  },
28
-};
20
+}
29 21
 </script>
30 22
 
31 23
 <style scoped>
@@ -37,19 +29,4 @@ export default {
37 29
   border-bottom: 1px solid #f5f0f0c2;
38 30
   padding: 2px;
39 31
 }
40
-.header__icon {
41
-  cursor: pointer;
42
-  padding: 20px;
43
-  border-radius: 15px;
44
-  background: transparent;
45
-}
46
-.header__icon:hover {
47
-  transform: scale(1.06);
48
-  transition: all 0.2s ease-in-out;
49
-}
50
-@media only screen and (min-width: 768px) {
51
-  .mobile--only {
52
-    display: none;
53
-  }
54
-}
55 32
 </style>

+ 25
- 0
frontend/src/shared/Sidebar.vue ファイルの表示

@@ -0,0 +1,25 @@
1
+<template lang="pug">
2
+.sidebar__messages
3
+  h4.message__title {{ title }}
4
+  router-link(:to="`/chats/${user.uid}`" v-for="user in users" :key="user.uid" :class="[uid == user.uid ? 'active' : '',  'sidebar__message']")
5
+    .message__left
6
+      p avatar and status
7
+    .message__right
8
+      h4.message__name {{ user.name }}
9
+      p.message__content {{ user.metadata.rawMetadata || "Hello!" }}
10
+</template> 
11
+
12
+<script>
13
+export default {
14
+  data() {
15
+    return {
16
+      title: 'i am a title',
17
+      uid: 111,
18
+      users: [
19
+        { name:'sample', uid: 111, metadata: { rawMetadata: 'rawmeta' } },
20
+        { name:'usample', uid: 112, metadata: { rawMetadata: 'morerawmeta' } }
21
+      ]
22
+    }
23
+  }
24
+}
25
+</script>

+ 0
- 1
frontend/src/views/Chats.vue ファイルの表示

@@ -29,7 +29,6 @@
29 29
                   <div class="msg--wrapper">
30 30
                     <div class="bubble--wrapper">
31 31
                       <p> avatar goes here
32
-
33 32
                       <div class="msg-bubble">
34 33
                         <div class="msg-info">
35 34
                           <div class="msg-info-name">{{ user.name }}</div>

+ 7
- 5
frontend/src/views/home.vue ファイルの表示

@@ -5,13 +5,15 @@
5 5
         <p>cards and header</p>
6 6
       </div>
7 7
     </div>
8
-    <p>sidebar</p>
8
+    <sidebar />
9 9
   </div>
10 10
 </template>
11 11
 
12 12
 <script>
13
+import sidebar from '../shared/Sidebar.vue'
13 14
 export default {
14 15
   name: "home",
16
+  components: {sidebar},
15 17
   data() {
16 18
     return {
17 19
       swipables: [],
@@ -36,16 +38,16 @@ html
36 38
   background-color: #f9f9f9
37 39
 .wrapper
38 40
   position: relative
39
-.content-wrapper
40
-  float: right
41
-  width: 100%
42 41
 .content
43 42
   margin-left: 320px
44 43
   clear: both
45 44
   overflow: auto
46 45
   background: #f9f9ff
47 46
   min-height: 100vh
48
-  
47
+  &-wrapper
48
+    float: right
49
+    width: 100%
50
+
49 51
 @media only screen and (max-width: 768px)
50 52
   .content
51 53
     margin-left: 0

読み込み中…
キャンセル
保存