File tree Expand file tree Collapse file tree
platforms/metagram/src/lib
fragments/UploadedPostView Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { Cross } from ' $lib/icons' ;
3+ import type { Image } from ' $lib/types' ;
34 import { cn } from ' $lib/utils' ;
45 import type { HTMLAttributes } from ' svelte/elements' ;
56
6- interface IImage {
7- url: string ;
8- alt: string ;
9- }
107
118 interface IUploadedPostViewProps extends HTMLAttributes <HTMLElement > {
12- images: IImage [];
9+ images: Image [];
1310 width? : string ;
1411 height? : string ;
1512 callback: (i : number ) => void ;
Original file line number Diff line number Diff line change 1- import type { PostData } from "$lib/types" ;
1+ import type { Image , PostData } from "$lib/types" ;
22
33export const isNavigatingThroughNav = $state ( {
44 value : false ,
@@ -16,10 +16,9 @@ export const selectedPost: { value: PostData | null } = $state({
1616 value : null ,
1717} ) ;
1818
19- export const uploadedImages : { value : { url : string ; alt : string } [ ] | null } =
20- $state ( {
21- value : null ,
22- } ) ;
19+ export const uploadedImages : { value : Image [ ] | null } = $state ( {
20+ value : null ,
21+ } ) ;
2322
2423export const audience : { value : string } = $state ( {
2524 value : "Everyone" ,
Original file line number Diff line number Diff line change 1- import type { SVGAttributes } from ' svelte/elements' ;
1+ import type { SVGAttributes } from " svelte/elements" ;
22
33export interface ISvgProps extends SVGAttributes < SVGElement > {
4- size ?: number | string ;
5- color ?: string ;
4+ size ?: number | string ;
5+ color ?: string ;
66}
77
88export 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 [ ] ;
1818} ;
1919
2020export type PostData = {
21- id : string ;
22- avatar : string ;
23- userId : string ;
24- username : string ;
25- imgUris : string [ ] ;
26- caption : string ;
27- time : string ;
28- count : {
29- likes : number ;
30- comments : number ;
31- } ;
21+ id : string ;
22+ avatar : string ;
23+ userId : string ;
24+ username : string ;
25+ imgUris : string [ ] ;
26+ caption : string ;
27+ time : string ;
28+ count : {
29+ likes : number ;
30+ comments : number ;
31+ } ;
3232} ;
3333
3434export type userProfile = {
35- userId : string ;
36- username : string ;
37- avatar : string ;
38- totalPosts : number ;
39- followers : number ;
40- following : number ;
41- userBio : string ;
42- posts : PostData [ ] ;
35+ userId : string ;
36+ username : string ;
37+ avatar : string ;
38+ totalPosts : number ;
39+ followers : number ;
40+ following : number ;
41+ userBio : string ;
42+ posts : PostData [ ] ;
43+ } ;
44+
45+ export type Image = {
46+ url : string ;
47+ alt : string ;
4348} ;
You can’t perform that action at this time.
0 commit comments