Parcourir la source

:construction: initial attempt at a placeholder card

tags/0.0.3^2
juancarbajal98 il y a 3 ans
Parent
révision
6181b63a9b
2 fichiers modifiés avec 21 ajouts et 3 suppressions
  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 Voir le fichier

150
     }
150
     }
151
     return c
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 Voir le fichier

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

Chargement…
Annuler
Enregistrer