Skip to content

Commit 87a6bd0

Browse files
committed
chore: formatting.
1 parent 04cb3be commit 87a6bd0

File tree

10 files changed

+268
-278
lines changed

10 files changed

+268
-278
lines changed
Lines changed: 83 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,87 @@
1-
import type { CommentType } from "./types";
1+
import type { CommentType } from './types';
22
export const dummyPosts = Array.from({ length: 100 }, (_, i) => ({
3-
id: (i + 1).toString(),
4-
avatar: "https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250",
5-
userId: (i + 1).toString(),
6-
handle: `user${i + 1}`,
7-
imgUris: [
8-
"https://picsum.photos/800",
9-
"https://picsum.photos/600",
10-
"https://picsum.photos/800",
11-
"https://picsum.photos/600",
12-
],
13-
caption: `This is post number ${i + 1}. Loving how these shots came out! :camera_with_flash:`,
14-
time: `${i + 1} hours ago`,
15-
count: {
16-
likes: Math.floor(Math.random() * 500),
17-
comments: Math.floor(Math.random() * 200),
18-
},
3+
id: (i + 1).toString(),
4+
avatar: 'https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250',
5+
userId: (i + 1).toString(),
6+
handle: `user${i + 1}`,
7+
imgUris: [
8+
'https://picsum.photos/800',
9+
'https://picsum.photos/600',
10+
'https://picsum.photos/800',
11+
'https://picsum.photos/600'
12+
],
13+
caption: `This is post number ${i + 1}. Loving how these shots came out! :camera_with_flash:`,
14+
time: `${i + 1} hours ago`,
15+
count: {
16+
likes: Math.floor(Math.random() * 500),
17+
comments: Math.floor(Math.random() * 200)
18+
}
1919
}));
2020
export const comments: CommentType[] = Array.from({ length: 50 }, (_, i) => ({
21-
userImgSrc: "https://picsum.photos/800",
22-
name: `user${i + 1}`,
23-
commentId: `${i + 1}p`,
24-
comment: `this is the dummy comment which is commented by user${i + 1}`,
25-
isUpVoted: false,
26-
isDownVoted: false,
27-
upVotes: 0,
28-
time: "2 minutes ago",
29-
replies: [
30-
{
31-
userImgSrc: "https://picsum.photos/800",
32-
name: `user${i + 1}x`,
33-
commentId: `${i + 1}x`,
34-
comment: `this is the dummy reply which is replied by another${i}x`,
35-
isUpVoted: false,
36-
isDownVoted: false,
37-
upVotes: 0,
38-
time: "1 minute ago",
39-
replies: [
40-
{
41-
userImgSrc: "https://picsum.photos/800",
42-
name: `user${i + 1}a`,
43-
commentId: `${i + 1}a`,
44-
comment: `this is the dummy reply which is replied by another${i}a`,
45-
isUpVoted: false,
46-
isDownVoted: false,
47-
upVotes: 0,
48-
time: "1 minute ago",
49-
replies: [],
50-
},
51-
],
52-
},
53-
{
54-
userImgSrc: "https://picsum.photos/800",
55-
name: `user${i + 1}y`,
56-
commentId: `${i + 1}y`,
57-
comment: `this is the dummy reply which is replied by another${i}y`,
58-
isUpVoted: false,
59-
isDownVoted: false,
60-
upVotes: 0,
61-
time: "1 minute ago",
62-
replies: [],
63-
},
64-
{
65-
userImgSrc: "https://picsum.photos/800",
66-
name: `user${i + 1}y`,
67-
commentId: `${i + 1}y`,
68-
comment: `this is the dummy reply which is replied by another${i}y`,
69-
isUpVoted: false,
70-
isDownVoted: false,
71-
upVotes: 0,
72-
time: "1 minute ago",
73-
replies: [],
74-
},
75-
{
76-
userImgSrc: "https://picsum.photos/800",
77-
name: `user${i + 1}y`,
78-
commentId: `${i + 1}y`,
79-
comment: `this is the dummy reply which is replied by another${i}y`,
80-
isUpVoted: false,
81-
isDownVoted: false,
82-
upVotes: 0,
83-
time: "1 minute ago",
84-
replies: [],
85-
},
86-
],
21+
userImgSrc: 'https://picsum.photos/800',
22+
name: `user${i + 1}`,
23+
commentId: `${i + 1}p`,
24+
comment: `this is the dummy comment which is commented by user${i + 1}`,
25+
isUpVoted: false,
26+
isDownVoted: false,
27+
upVotes: 0,
28+
time: '2 minutes ago',
29+
replies: [
30+
{
31+
userImgSrc: 'https://picsum.photos/800',
32+
name: `user${i + 1}x`,
33+
commentId: `${i + 1}x`,
34+
comment: `this is the dummy reply which is replied by another${i}x`,
35+
isUpVoted: false,
36+
isDownVoted: false,
37+
upVotes: 0,
38+
time: '1 minute ago',
39+
replies: [
40+
{
41+
userImgSrc: 'https://picsum.photos/800',
42+
name: `user${i + 1}a`,
43+
commentId: `${i + 1}a`,
44+
comment: `this is the dummy reply which is replied by another${i}a`,
45+
isUpVoted: false,
46+
isDownVoted: false,
47+
upVotes: 0,
48+
time: '1 minute ago',
49+
replies: []
50+
}
51+
]
52+
},
53+
{
54+
userImgSrc: 'https://picsum.photos/800',
55+
name: `user${i + 1}y`,
56+
commentId: `${i + 1}y`,
57+
comment: `this is the dummy reply which is replied by another${i}y`,
58+
isUpVoted: false,
59+
isDownVoted: false,
60+
upVotes: 0,
61+
time: '1 minute ago',
62+
replies: []
63+
},
64+
{
65+
userImgSrc: 'https://picsum.photos/800',
66+
name: `user${i + 1}y`,
67+
commentId: `${i + 1}y`,
68+
comment: `this is the dummy reply which is replied by another${i}y`,
69+
isUpVoted: false,
70+
isDownVoted: false,
71+
upVotes: 0,
72+
time: '1 minute ago',
73+
replies: []
74+
},
75+
{
76+
userImgSrc: 'https://picsum.photos/800',
77+
name: `user${i + 1}y`,
78+
commentId: `${i + 1}y`,
79+
comment: `this is the dummy reply which is replied by another${i}y`,
80+
isUpVoted: false,
81+
isDownVoted: false,
82+
upVotes: 0,
83+
time: '1 minute ago',
84+
replies: []
85+
}
86+
]
8787
}));
Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
1-
import type { ComponentProps } from "svelte";
2-
import Message from "./Message.svelte";
1+
import type { ComponentProps } from 'svelte';
2+
import Message from './Message.svelte';
33

44
export default {
5-
title: "UI/Message",
6-
component: Message,
7-
tags: ["autodocs"],
8-
render: (args: {
9-
Component: Message;
10-
props: ComponentProps<typeof Message>;
11-
}) => ({
12-
Component: Message,
13-
props: args,
14-
}),
5+
title: 'UI/Message',
6+
component: Message,
7+
tags: ['autodocs'],
8+
render: (args: { Component: Message; props: ComponentProps<typeof Message> }) => ({
9+
Component: Message,
10+
props: args
11+
})
1512
};
1613

1714
export const Primary = {
18-
args: {
19-
avatar: "https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250",
20-
handle: "donaldthefirstt",
21-
text: "i was thinking of making it to the conference so we could take some more fire pictures like last time",
22-
unread: false,
23-
callback: () => alert("Message clicked"),
24-
},
15+
args: {
16+
avatar: 'https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250',
17+
handle: 'donaldthefirstt',
18+
text: 'i was thinking of making it to the conference so we could take some more fire pictures like last time',
19+
unread: false,
20+
callback: () => alert('Message clicked')
21+
}
2522
};
2623

2724
export const Unread = {
28-
args: {
29-
avatar: "https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250",
30-
handle: "donaldthefirstt",
31-
text: "i was thinking of making it to the conference so we could take some more fire pictures like last time",
32-
unread: true,
33-
callback: () => alert("Message clicked"),
34-
},
25+
args: {
26+
avatar: 'https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250',
27+
handle: 'donaldthefirstt',
28+
text: 'i was thinking of making it to the conference so we could take some more fire pictures like last time',
29+
unread: true,
30+
callback: () => alert('Message clicked')
31+
}
3532
};
Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,41 @@
1-
import type { ComponentProps } from "svelte";
2-
import Post from "./Post.svelte";
1+
import type { ComponentProps } from 'svelte';
2+
import Post from './Post.svelte';
33

44
export default {
5-
title: "ui/Post",
6-
component: Post,
7-
tags: ["autodocs"],
8-
render: (args: {
9-
Component: Post;
10-
props: ComponentProps<typeof Post>;
11-
}) => ({
12-
Component: Post,
13-
props: args,
14-
}),
5+
title: 'ui/Post',
6+
component: Post,
7+
tags: ['autodocs'],
8+
render: (args: { Component: Post; props: ComponentProps<typeof Post> }) => ({
9+
Component: Post,
10+
props: args
11+
})
1512
};
1613

1714
export const Primary = {
18-
args: {
19-
avatar: "https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250",
20-
handle: "blurryface",
21-
imgUris: [
22-
"https://graphicsfamily.com/wp-content/uploads/edd/2023/01/Free-Photographer-Social-Media-Post-Design-Template-870x870.jpg",
23-
"https://picsum.photos/200",
24-
],
25-
postAlt: "Sample",
26-
text: "Took some pictures today! Really love how this one in particular turned out! ",
27-
time: "2 hours ago",
28-
count: {
29-
likes: 100,
30-
comments: 50,
31-
},
32-
callback: {
33-
like: () => {
34-
alert("Like clicked");
35-
},
36-
comment: () => {
37-
alert("Comment clicked");
38-
},
39-
menu: () => {
40-
alert("Menu clicked");
41-
},
42-
},
43-
},
15+
args: {
16+
avatar: 'https://www.gravatar.com/avatar/2c7d99fe281ecd3bcd65ab915bac6dd5?s=250',
17+
handle: 'blurryface',
18+
imgUris: [
19+
'https://graphicsfamily.com/wp-content/uploads/edd/2023/01/Free-Photographer-Social-Media-Post-Design-Template-870x870.jpg',
20+
'https://picsum.photos/200'
21+
],
22+
postAlt: 'Sample',
23+
text: 'Took some pictures today! Really love how this one in particular turned out! ',
24+
time: '2 hours ago',
25+
count: {
26+
likes: 100,
27+
comments: 50
28+
},
29+
callback: {
30+
like: () => {
31+
alert('Like clicked');
32+
},
33+
comment: () => {
34+
alert('Comment clicked');
35+
},
36+
menu: () => {
37+
alert('Menu clicked');
38+
}
39+
}
40+
}
4441
};

platforms/pictique/src/lib/fragments/Post/Post.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,22 +121,22 @@
121121
<div
122122
bind:this={galleryRef}
123123
onscroll={handleScroll}
124-
class="hide-scrollbar rounded-4xl flex aspect-[4/5] snap-x snap-mandatory flex-nowrap gap-2 overflow-hidden overflow-x-scroll md:aspect-[16/9]"
124+
class="hide-scrollbar flex aspect-[4/5] snap-x snap-mandatory flex-nowrap gap-2 overflow-hidden overflow-x-scroll rounded-4xl md:aspect-[16/9]"
125125
>
126126
{#each imgUris as img, i (i)}
127127
<div class="aspect-[4/5] h-full w-full snap-center md:aspect-[16/9]">
128128
<img
129129
src={img}
130130
alt={text}
131-
class="rounded-4xl h-full w-full object-cover"
131+
class="h-full w-full rounded-4xl object-cover"
132132
onerror={handleImageError}
133133
/>
134134
</div>
135135
{/each}
136136
</div>
137137
{#if imgUris.length > 1}
138138
<div
139-
class="absolute bottom-4 start-[50%] mt-2 flex translate-x-[-50%] items-center justify-center gap-1"
139+
class="absolute start-[50%] bottom-4 mt-2 flex translate-x-[-50%] items-center justify-center gap-1"
140140
>
141141
{#if imgUris.length > 1}
142142
<div class="mt-2 flex items-center justify-center gap-1">

platforms/pictique/src/lib/fragments/PostModal/PostModal.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
<div
146146
bind:this={galleryRef}
147147
onscroll={handleScroll}
148-
class="hide-scrollbar rounded-4xl flex aspect-[4/5] snap-x snap-mandatory flex-nowrap gap-2 overflow-hidden overflow-x-scroll md:aspect-[16/9]"
148+
class="hide-scrollbar flex aspect-[4/5] snap-x snap-mandatory flex-nowrap gap-2 overflow-hidden overflow-x-scroll rounded-4xl md:aspect-[16/9]"
149149
>
150150
{#each imgUris as img, i (i)}
151151
<div
@@ -154,15 +154,15 @@
154154
<img
155155
src={img}
156156
alt={text}
157-
class="rounded-4xl h-full w-full object-cover md:h-auto md:min-w-96"
157+
class="h-full w-full rounded-4xl object-cover md:h-auto md:min-w-96"
158158
onerror={handleImageError}
159159
/>
160160
</div>
161161
{/each}
162162
</div>
163163
{#if imgUris.length > 1}
164164
<div
165-
class="absolute bottom-4 start-[50%] mt-2 flex translate-x-[-50%] items-center justify-center gap-1"
165+
class="absolute start-[50%] bottom-4 mt-2 flex translate-x-[-50%] items-center justify-center gap-1"
166166
>
167167
{#if imgUris.length > 1}
168168
<div class="mt-2 flex items-center justify-center gap-1">
@@ -250,7 +250,7 @@
250250
<h2>{handle}</h2>
251251
</div>
252252
</div>
253-
<hr class="border-1 rounded-xl border-gray-200" />
253+
<hr class="rounded-xl border-1 border-gray-200" />
254254
<div class="flex h-1/2 w-full flex-col gap-2 overflow-y-auto">
255255
<div class="flex w-full items-start justify-start gap-2">
256256
{#key avatar}
@@ -285,7 +285,7 @@
285285
{/each}
286286
{/if}
287287
</div>
288-
<hr class="border-1 rounded-xl border-gray-200" />
288+
<hr class="rounded-xl border-1 border-gray-200" />
289289
<div class="flex w-full flex-col justify-between gap-3">
290290
<div class="flex gap-4">
291291
<button

0 commit comments

Comments
 (0)