Browse Source

simplify layout

tags/0.0.1
diaseu 4 years ago
parent
commit
879bbf6139

+ 12
- 6
frontend/src/App.vue View File

@@ -1,16 +1,18 @@
1 1
 <template lang="pug">
2 2
 sidebar
3
-main.f-col
3
+main.f-col.start.w-full
4 4
     router-view
5
+    main-nav
5 6
 </template>
6 7
 
7 8
 <script>
8 9
 import * as sss from '@/sss/import.css'
9 10
 import sidebar from './components/Sidebar.vue'
11
+import mainNav from './components/MainNav.vue'
10 12
 
11 13
 export default {
12 14
     name: 'app',
13
-    components: { sidebar,  },
15
+    components: { sidebar, mainNav },
14 16
 }
15 17
 </script>
16 18
 
@@ -29,9 +31,13 @@ html
29 31
     font-family: $sans
30 32
     background-color: $secondary
31 33
     overflow-x: hidden
32
-
33
-    > aside
34
-        background-color: yellow
35
-
34
+    height: 100%
35
+    > main
36
+        position: relative
37
+        height: 100%
38
+        > article
39
+            height: 100%
40
+            width: 100%
41
+            flex-direction: column
36 42
 
37 43
 </style>

+ 5
- 3
frontend/src/components/MainNav.vue View File

@@ -1,5 +1,5 @@
1 1
 <template lang="pug">
2
-nav#main-header.w-full.f-row.around
2
+nav#main-header.w-full.f-row.around.p-2
3 3
     router-link.header__icon.mobile--only(to='/matches') matches
4 4
     router-link.header__icon(to='/') home
5 5
     router-link.header__icon.mobile--only(to='/profile') profile
@@ -13,8 +13,10 @@ export default {
13 13
 
14 14
 <style lang="postcss">
15 15
 #main-header
16
-  border-bottom: 1px solid #f5f0f0c2
17
-  padding: 2px
16
+  position: absolute
17
+  bottom: 1vh
18
+  right: 0
19
+
18 20
 
19 21
 @media only screen and (min-width: 768px)
20 22
   .mobile--only

+ 39
- 55
frontend/src/components/Messages.vue View File

@@ -5,18 +5,19 @@
5 5
             :to="'/chats/' + user.uid"
6 6
             v-for="user in users"
7 7
             :key="user.uid"
8
-            :class="[uid == user.uid ? 'active' : '', 'sidebar__message']"
8
+            :class="[uid == user.uid ? 'active' : '', 'sidebar__message', 'f-col', 'start']"
9 9
         >
10
-            <div class="message__left">
11
-                <p>avatar goes here</p>
12
-            </div>
10
+            <div class="f-row start">
11
+                <img :src="user.avatar" />
13 12
 
14
-            <div class="message__right">
15
-                <h4 class="message__name">{{ user.name }}</h4>
16
-                <p class="message__content">
17
-                    {{ user.metadata.rawMetadata || "Hello I'm using tinder!" }}
18
-                </p>
13
+                <div class="message__right f-col">
14
+                    <h4 class="message__name">{{ user.name }}</h4>
15
+                    <p class="message__content">
16
+                        {{ user.metadata.rawMetadata || "Hello I'm using tinder!" }}
17
+                    </p>
18
+                </div>
19 19
             </div>
20
+
20 21
         </router-link>
21 22
     </div>
22 23
 </template>
@@ -28,16 +29,6 @@ export default {
28 29
         title: { type: String, default: 'Messages' },
29 30
         users: {
30 31
             type: [Object, Array],
31
-            default: function () {
32
-                return [
33
-                    {
34
-                        uid: '1',
35
-                        name: 'Fullname',
36
-                        avatar: 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/newborn-baby-boy-sleeping-peacefully-wearing-knit-royalty-free-image-1589459736.jpg?crop=0.669xw:1.00xh;0.228xw,0&resize=640:*',
37
-                        metadata: { age: '21', rawMetadata: 'Some Text Here!' },
38
-                    },
39
-                ]
40
-            },
41 32
         },
42 33
     },
43 34
     computed: {
@@ -49,42 +40,35 @@ export default {
49 40
 </script>
50 41
 
51 42
 <style lang="postcss">
52
-.sidebar__messages
53
-  padding: 20px 10px
54
-  height: calc(100vh - 300px)
55
-  overflow-y: scroll
56
-
57
-.sidebar__messages a
58
-  color: black
59
-  text-decoration: none
60
-
61
-.sidebar__messages a:hover
62
-  background: #f9f9ff
63
-  transition: 0.5s
64
-
65
-.active
66
-  background: #ececff
67
-  transition: 0.5s
68
-
69
-.message__title
70
-  color: #fd5068
71
-  margin-bottom: 10px
72
-
73
-.sidebar__message
74
-  display: flex
75
-  align-items: center
76
-  margin: 20px 0
77
-
78
-.message__left
79
-  width: 70px
80
-  height: 70px
81
-
82
-.message__left img
83
-  object-fit: cover
84 43
 
85
-.message__right
86
-  margin-left: 10px
44
+.sidebar
45
+    &__messages
46
+        padding: 20px 10px
47
+        /* overflow-y: scroll */
48
+        a
49
+            color: black
50
+            text-decoration: none
51
+            &:hover
52
+                background: #f9f9ff
53
+                transition: 0.5s
54
+            &.active
55
+                background: #ececff
56
+                transition: 0.5s
57
+    &__message
58
+        display: flex
59
+        align-items: center
60
+        margin: 20px 0
61
+        img
62
+            object-fit: cover
63
+            width: 70px
64
+            height: 70px
87 65
 
88
-.message__name
89
-  margin-bottom: 10px
66
+.message
67
+    &__title
68
+        color: #fd5068
69
+        margin-bottom: 10px
70
+    &__right
71
+        margin-left: 10px
72
+    &__name
73
+        margin-bottom: 10px
90 74
 </style>

+ 16
- 19
frontend/src/components/Sidebar.vue View File

@@ -1,43 +1,40 @@
1 1
 <template lang="pug">
2
-aside.sidebar__messages.p-1
2
+aside.sidebar.p-1
3 3
     p messages
4 4
     input
5 5
     label search
6 6
 
7
-    router-link(
8
-        :class='[uid == user.uid ? "active" : "", "sidebar__message"]'
9
-        :key='user.uid'
10
-        :to='`/chats/${user.uid}`'
11
-        v-for='user in users'
12
-    )
13
-        h4.message__title.mv-0 {{ title }}
14
-        .row.f-row.mv-0
15
-            .message__left.mr-0
16
-                p avatar
17
-                p O
18
-            .message__right.t-left.f-grow
19
-                h4.message__name {{ user.name }}
20
-                p.message__content {{ user.metadata.rawMetadata || "Hello!" }}
21
-        hr
7
+    messages(:title="title" :users="users")
22 8
 </template>
23 9
 
24 10
 <script>
11
+import messages from './Messages.vue'
12
+
25 13
 export default {
14
+    components: { messages }, 
26 15
     data: () => ({
27
-        title: 'i am a title',
16
+        title:'i am a title',
28 17
         uid: 111,
29 18
         users: [
30 19
             {
31
-                name: 'bob mcrob',
20
+                name: 'Bob McRob',
32 21
                 uid: 111,
22
+                avatar: 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/newborn-baby-boy-sleeping-peacefully-wearing-knit-royalty-free-image-1589459736.jpg?crop=0.669xw:1.00xh;0.228xw,0&resize=640:*',
33 23
                 metadata: { rawMetadata: 'howdy howdy howdy' },
34 24
             },
35 25
             {
36
-                name: 'rob bebob',
26
+                name: 'Rob Bebob',
37 27
                 uid: 112,
28
+                avatar: 'https://hips.hearstapps.com/hmg-prod.s3.amazonaws.com/images/newborn-baby-boy-sleeping-peacefully-wearing-knit-royalty-free-image-1589459736.jpg?crop=0.669xw:1.00xh;0.228xw,0&resize=640:*',
38 29
                 metadata: { rawMetadata: 'this is the last message' },
39 30
             },
40 31
         ],
41 32
     }),
42 33
 }
43 34
 </script>
35
+
36
+<style lang="postcss">
37
+aside.sidebar
38
+    background-color: yellow
39
+    height: 100vh
40
+</style>

+ 1
- 1
frontend/src/router/index.js View File

@@ -16,7 +16,7 @@ const routes = [
16 16
     {
17 17
         path: '/profile',
18 18
         component: Profile,
19
-        name: 'profile',
19
+        name: 'Profile',
20 20
         meta: { requiresAuth: true },
21 21
     },
22 22
     {

+ 2
- 21
frontend/src/views/Matches.vue View File

@@ -1,25 +1,6 @@
1 1
 <template lang="pug">
2
-.match
3
-    .matches
4
-        h1 Matches
5
-        .row
6
-    .messages
7
-        h2 Messages
8
-        .matched.active
9
-            .messagecontent
10
-                h3 NSE Tropical
11
-                |
12
-                | Recently active, match now!
13
-        .matched
14
-            .messagecontent
15
-                h3 Golden Communications
16
-                |
17
-                | Click to match now!
18
-        .matched
19
-            .messagecontent
20
-                h3 Mojo Solutions
21
-                |
22
-                | Click to match now!
2
+article.match
3
+    h1 Match Page
23 4
 </template>
24 5
 
25 6
 <script>

+ 7
- 43
frontend/src/views/Profile.vue View File

@@ -1,49 +1,13 @@
1 1
 <template lang="pug">
2
-.login__box
3
-    h2 Profile
4
-    form(@submit.prevent='onSubmit')
5
-        .user__box
6
-            input(
7
-                minlength='6'
8
-                required=''
9
-                type='text'
10
-                v-model='form.fullname'
11
-            )
12
-            label Fullname
13
-        .user__box
14
-            input(minlength='10' required='' type='text' v-model='form.avatar')
15
-            label Image URL
16
-        .user__box
17
-            input(
18
-                max='60'
19
-                maxlength='3'
20
-                min='18'
21
-                minlength='2'
22
-                required=''
23
-                type='number'
24
-                v-model='form.age'
25
-            )
26
-            label Age
27
-        .user__box
28
-            input(
29
-                maxlength='50'
30
-                minlength='10'
31
-                required=''
32
-                type='text'
33
-                v-model='form.metadata'
34
-            )
35
-            label Description
36
-        button(type='submit')
37
-            span
38
-            span
39
-            span
40
-            span {{ requesting ? "Log..." : "Update" }}
41
-        router-link.links(to='/') Back
2
+article#profile
3
+    h1 Profile Page
42 4
 </template>
43 5
 
44 6
 <script>
7
+
8
+
45 9
 export default {
46
-    name: 'ProfileUpdate',
10
+    name: 'Profile',
47 11
     data() {
48 12
         return {
49 13
             requesting: false,
@@ -65,7 +29,7 @@ export default {
65 29
             // this.setUser()
66 30
         },
67 31
         getUser() {
68
-            const uid = auth.currentUser.uid
32
+            // const uid = auth.currentUser.uid
69 33
             return
70 34
         },
71 35
         setUser() {
@@ -79,6 +43,6 @@ export default {
79 43
 </script>
80 44
 
81 45
 <style lang="postcss">
82
-
46
+#profile
83 47
 
84 48
 </style>

+ 6
- 8
frontend/src/views/home.vue View File

@@ -1,19 +1,14 @@
1 1
 <template lang="pug">
2
-article#home.w-full.f-row.reverse
3
-    .content-wrapper.w-full
4
-        header
5
-            main-nav
6
-
7
-        profile-card-list(:uid='uid' :users='swipables')
2
+article#home
3
+    profile-card-list(:uid='uid' :users='swipables')
8 4
 </template>
9 5
 
10 6
 <script>
11
-import mainNav from '../components/MainNav.vue'
12 7
 import profileCardList from '../components/ProfileCardList.vue'
13 8
 
14 9
 export default {
15 10
     name: 'HomeView',
16
-    components: { mainNav, profileCardList },
11
+    components: { profileCardList },
17 12
     data: () => ({
18 13
         swipables: [],
19 14
         uid: null,
@@ -43,3 +38,6 @@ export default {
43 38
 }
44 39
 </script>
45 40
 
41
+<style lang="postcss">
42
+#home
43
+</style>

Loading…
Cancel
Save