-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Resul Avan
authored and
Resul Avan
committed
May 28, 2020
1 parent
a494272
commit cc36c79
Showing
21 changed files
with
164 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
import { BaseCollection } from "../../src/types"; | ||
|
||
export interface Image { | ||
src: string; | ||
alt: string; | ||
name?: string; | ||
default?: boolean | ||
} | ||
|
||
export const DefaultUserPhoto: Image = { | ||
src: '/img/default-profile.svg', | ||
alt: ' user default picture' | ||
} | ||
|
||
export interface ProviderData { | ||
providerType: string | ||
} | ||
|
||
export interface StoredUser { | ||
export interface UserDTO { | ||
name: string | ||
email: string | ||
profilePhoto: Image | ||
userId: string, | ||
verified: boolean | ||
providers: ProviderData[] | ||
} | ||
|
||
export interface User extends BaseCollection { | ||
id: string | ||
name: string | ||
surname: string | ||
profilePhoto: Image | ||
coverPhoto: Image | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<template> | ||
<Profile v-if="storedUser" :stored-user="storedUser" :cover-photo="coverPhoto"/> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { Component, Vue } from 'nuxt-property-decorator'; | ||
import Profile from "~/components/profile/Profile.vue"; | ||
import { Image, StateNamespace, StoredUser, User } from "~/types"; | ||
import { getUser } from "~/service/firebase/firestore-service"; | ||
@Component({ | ||
components: { Profile }, | ||
}) | ||
export default class Account extends Vue { | ||
coverPhoto: Image | null = null; | ||
@StateNamespace.auth.Getter storedUser !: StoredUser; | ||
async created() { | ||
await getUser(this.storedUser.userId) | ||
.then((user: User) => { | ||
console.log('created ', user) | ||
this.coverPhoto = user.coverPhoto as Image | ||
}) | ||
} | ||
// async asyncData({}: Context) { | ||
// getUser(this.storedUser.userId) | ||
// .then((user: User) => { | ||
// return { | ||
// coverPhoto: user.coverPhoto | ||
// } | ||
// }) | ||
// } | ||
} | ||
</script> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.