Quellcode durchsuchen

:construction: initial attempt at a placeholder card

tags/0.0.3^2
juancarbajal98 vor 3 Jahren
Ursprung
Commit
6181b63a9b
2 geänderte Dateien mit 21 neuen und 3 gelöschten Zeilen
  1. 17
    1
      frontend/src/entities/card/card.js
  2. 4
    2
      frontend/src/views/ProfileView.vue

+ 17
- 1
frontend/src/entities/card/card.js Datei anzeigen

@@ -150,4 +150,20 @@ const makeCardFromProfile = profile => {
150 150
     }
151 151
     return c
152 152
 }
153
-export { Card, makeCardFromProfile, cardAspects }
153
+
154
+const makePlaceholderCard = () => {
155
+    const c = new Card({
156
+        pid: 0,
157
+        name: 'test name',
158
+        email: 'test@email.com',
159
+        role: 'participant'
160
+    })
161
+
162
+    c.presence = 'remote'
163
+    c.urgency = 'actively_looking'
164
+    c.pronouns = 'he/him'
165
+    c.ethnicity = ''
166
+    c.locale = 'Los Angeles, CA'
167
+    c.email = 'test@email.com'
168
+}
169
+export { Card, makeCardFromProfile, makePlaceholderCard, cardAspects }

+ 4
- 2
frontend/src/views/ProfileView.vue Datei anzeigen

@@ -5,7 +5,7 @@ main.view--profile
5 5
         ProfileCard(
6 6
             :aspects='card.aspects'
7 7
             :is-list='false'
8
-            :card='card'
8
+            :card='placeholderCard'
9 9
         )
10 10
     w-spinner(v-else bounce)
11 11
 
@@ -15,7 +15,7 @@ main.view--profile
15 15
 <script>
16 16
 import ProfileCard from '../components/ProfileCard.vue'
17 17
 import { fetchProfileByProfileId } from '../services'
18
-import { makeCardFromProfile } from '../entities'
18
+import { makeCardFromProfile, makePlaceholderCard } from '../entities'
19 19
 
20 20
 export default {
21 21
     name: 'ProfileView',
@@ -24,6 +24,7 @@ export default {
24 24
         loading: true,
25 25
         profile: {},
26 26
         card: {},
27
+        placeholderCard: {},
27 28
     }),
28 29
     created() {
29 30
         this.getProfile()
@@ -39,6 +40,7 @@ export default {
39 40
                 console.error(err)
40 41
             }
41 42
             this.card = makeCardFromProfile(this.profile)
43
+            this.placeholderCard = makePlaceholderCard()
42 44
             this.loading = false
43 45
         },
44 46
     },

Laden…
Abbrechen
Speichern