File tree Expand file tree Collapse file tree 4 files changed +64
-64
lines changed Expand file tree Collapse file tree 4 files changed +64
-64
lines changed Original file line number Diff line number Diff line change 27
27
onerror ={() => {
28
28
profileData .avatarUrl = ' /images/user.png' ;
29
29
}}
30
- alt ={profileData .username }
30
+ alt ={profileData .handle }
31
31
class =" h-20 w-20 rounded-full object-cover"
32
32
/>
33
33
<div class =" flex-1" >
65
65
<li class ="mb-6 list-none" onclick ={() => handleSinglePost (post )}>
66
66
<Post
67
67
avatar ={profileData .avatarUrl || ' https://picsum.photos/200/200' }
68
- username ={profileData ?.name ?? profileData ?.username }
68
+ username ={profileData ?.name ?? profileData ?.handle }
69
69
imgUris ={post .imgUris ?? []}
70
70
text ={post .caption }
71
71
time ={post .time ? new Date (post .time ).toLocaleDateString () : ' ' }
Original file line number Diff line number Diff line change 1
- import type { SVGAttributes } from ' svelte/elements' ;
1
+ import type { SVGAttributes } from " svelte/elements" ;
2
2
3
3
export interface ISvgProps extends SVGAttributes < SVGElement > {
4
- size ?: number | string ;
5
- color ?: string ;
4
+ size ?: number | string ;
5
+ color ?: string ;
6
6
}
7
7
8
8
export type CommentType = {
9
- commentId : string ;
10
- name : string ;
11
- userImgSrc : string ;
12
- comment : string ;
13
- isUpVoted : boolean ;
14
- isDownVoted : boolean ;
15
- upVotes : number ;
16
- time : string ;
17
- replies : CommentType [ ] ;
9
+ commentId : string ;
10
+ name : string ;
11
+ userImgSrc : string ;
12
+ comment : string ;
13
+ isUpVoted : boolean ;
14
+ isDownVoted : boolean ;
15
+ upVotes : number ;
16
+ time : string ;
17
+ replies : CommentType [ ] ;
18
18
} ;
19
19
20
20
export type PostData = {
21
- createdAt : string | number | Date ;
22
- id : string ;
23
- avatar : string ;
24
- userId : string ;
25
- username : string ;
26
- imgUris : string [ ] ;
27
- caption : string ;
28
- time : string ;
29
- count : {
30
- likes : number ;
31
- comments : number ;
32
- } ;
21
+ createdAt : string | number | Date ;
22
+ id : string ;
23
+ avatar : string ;
24
+ userId : string ;
25
+ username : string ;
26
+ imgUris : string [ ] ;
27
+ caption : string ;
28
+ time : string ;
29
+ count : {
30
+ likes : number ;
31
+ comments : number ;
32
+ } ;
33
33
} ;
34
34
35
35
export interface Post {
36
- id : string ;
37
- text : string ;
38
- images : string [ ] ;
39
- author : {
40
- id : string ;
41
- handle : string ;
42
- name : string ;
43
- avatarUrl : string ;
44
- } ;
45
- createdAt : string ;
46
- likedBy : userProfile [ ] ;
47
- comments : {
48
- id : string ;
49
- text : string ;
50
- author : {
51
- id : string ;
52
- handle : string ;
53
- name : string ;
54
- avatarUrl : string ;
55
- } ;
56
- createdAt : string ;
57
- } [ ] ;
36
+ id : string ;
37
+ text : string ;
38
+ images : string [ ] ;
39
+ author : {
40
+ id : string ;
41
+ handle : string ;
42
+ name : string ;
43
+ avatarUrl : string ;
44
+ } ;
45
+ createdAt : string ;
46
+ likedBy : userProfile [ ] ;
47
+ comments : {
48
+ id : string ;
49
+ text : string ;
50
+ author : {
51
+ id : string ;
52
+ handle : string ;
53
+ name : string ;
54
+ avatarUrl : string ;
55
+ } ;
56
+ createdAt : string ;
57
+ } [ ] ;
58
58
}
59
59
60
60
export type userProfile = {
61
- userId : string ;
62
- username : string ;
63
- avatarUrl : string ;
64
- totalPosts : number ;
65
- followers : number ;
66
- following : number ;
67
- userBio : string ;
68
- posts : PostData [ ] ;
61
+ id : string ;
62
+ handle : string ;
63
+ description : string ;
64
+ name : string ;
65
+ avatarUrl : string ;
66
+ totalPosts : number ;
67
+ followers : number ;
68
+ following : number ;
69
+ posts : PostData [ ] ;
69
70
} ;
70
71
71
72
export type Image = {
72
- url : string ;
73
- alt : string ;
73
+ url : string ;
74
+ alt : string ;
74
75
} ;
75
76
76
77
export type GroupInfo = {
77
- id : string ;
78
- name : string ;
79
- avatar : string ;
78
+ id : string ;
79
+ name : string ;
80
+ avatar : string ;
80
81
} ;
Original file line number Diff line number Diff line change 149
149
</li >
150
150
{/each }
151
151
<MessageInput
152
- class =" fixed start-0 bottom-4 mt-4 w-full px-5"
152
+ class =" fixed bottom-4 start-0 mt-4 w-full px-5"
153
153
variant =" comment"
154
154
src =" https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250"
155
155
bind:value ={commentValue }
Original file line number Diff line number Diff line change 47
47
async function handleMessage() {
48
48
try {
49
49
await apiClient .post (' /api/chats/' , {
50
- name: profile ?.username ,
50
+ name: profile ?.handle ,
51
51
participantIds: [profileId ]
52
52
});
53
53
goto (' /messages' );
62
62
selectedPost .value = post ;
63
63
// goto("/profile/post");
64
64
}
65
-
66
65
onMount (fetchProfile );
67
66
</script >
68
67
You can’t perform that action at this time.
0 commit comments