+
-
+
-
+
@@ -87,6 +95,11 @@
+ {#if $account && post.account.id === $account.id}
+
+
+
+ {/if}
diff --git a/src/lib/ui/post/ReactionButton.svelte b/src/lib/ui/post/ReactionButton.svelte
index fee3a97..6b933b1 100644
--- a/src/lib/ui/post/ReactionButton.svelte
+++ b/src/lib/ui/post/ReactionButton.svelte
@@ -1,5 +1,5 @@
@@ -49,6 +49,7 @@
border-radius: 8px;
transition: background-color .1s, color .1s;
cursor: pointer;
+ border: 1px solid var(--bg-700);
}
button.active {
@@ -72,7 +73,7 @@
}
.icon {
- width: 20px;
+ min-width: 20px;
height: 20px;
display: flex;
justify-content: center;
diff --git a/src/lib/ui/post/ReplyContext.svelte b/src/lib/ui/post/ReplyContext.svelte
index ad4f620..0474460 100644
--- a/src/lib/ui/post/ReplyContext.svelte
+++ b/src/lib/ui/post/ReplyContext.svelte
@@ -1,39 +1,42 @@
{#if post.reply}
-
+ {#await post.reply then reply}
+
+ {/await}
{/if}
{mouse_pos.left = e.pageX; mouse_pos.top = e.pageY; console.log(mouse_pos)}}
- on:mouseup={e => {if (e.pageX == mouse_pos.left && e.pageY == mouse_pos.top) gotoPost()}}
+ on:mousedown={e => {mouse_pos.left = e.pageX; mouse_pos.top = e.pageY}}
+ on:mouseup={e => {if (e.pageX == mouse_pos.left && e.pageY == mouse_pos.top) gotoPost(e)}}
on:keydown={gotoPost}>
@@ -43,7 +46,9 @@
diff --git a/src/lib/user/user.js b/src/lib/user/user.js
deleted file mode 100644
index 7b91fe8..0000000
--- a/src/lib/user/user.js
+++ /dev/null
@@ -1,29 +0,0 @@
-import { Client } from '../client/client.js';
-import { parseText as parseEmojis } from '../emoji.js';
-import { get } from 'svelte/store';
-
-export default class User {
- id;
- nickname;
- username;
- host;
- avatar_url;
- emojis;
- url;
-
- get name() {
- return this.nickname || this.username;
- }
-
- get mention() {
- let res = "@" + this.username;
- if (this.host != get(Client.get()).instance.host)
- res += "@" + this.host;
- return res;
- }
-
- get rich_name() {
- if (!this.nickname) return this.username;
- return parseEmojis(this.nickname, this.host);
- }
-}
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 9f7c10f..aec6b96 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -1,21 +1,52 @@
+ {#if $notifications.length === 0}
+
+ fetching notifications...
+
+ {:else}
+ {#each $notifications as notif}
+
+ {/each}
+ {/if}
+
+
+
diff --git a/src/routes/post/+page.js b/src/routes/post/+page.js
deleted file mode 100644
index c0ac9bd..0000000
--- a/src/routes/post/+page.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import { error } from '@sveltejs/kit';
-
-export function load(event) {
- error(404, 'Not Found');
-}
diff --git a/src/routes/post/[id]/+page.js b/src/routes/post/[id]/+page.js
deleted file mode 100644
index 30569fd..0000000
--- a/src/routes/post/[id]/+page.js
+++ /dev/null
@@ -1,39 +0,0 @@
-import Post from '$lib/ui/post/Post.svelte';
-import { Client } from '$lib/client/client.js';
-import { parsePost } from '$lib/client/api.js';
-import { get } from 'svelte/store';
-import { goto } from '$app/navigation';
-
-export const ssr = false;
-
-export async function load({ params }) {
- let client = get(Client.get());
-
- if (!client.instance || !client.user) {
- goto("/");
- }
-
- const post_id = params.id;
-
- const post_data = await client.getPost(post_id);
- if (!post_data) {
- console.error(`Failed to retrieve post ${post_id}.`);
- return null;
- }
-
- const post = await parsePost(post_data, 10, true);
- let posts = [post];
- for (let i in post.replies) {
- const reply = post.replies[i];
- // if (i > 1 && reply.reply_id === post.replies[i - 1].id) {
- // let reply_head = posts.pop();
- // reply.reply = reply_head;
- // }
- posts.push(reply);
- // console.log(reply);
- }
-
- return {
- posts: posts
- };
-}
diff --git a/src/routes/post/[id]/+page.svelte b/src/routes/post/[id]/+page.svelte
deleted file mode 100644
index a5e9edc..0000000
--- a/src/routes/post/[id]/+page.svelte
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
-
- {#if data.posts.length <= 0}
-
- just a moment...
-
- {:else}
- {#key data}
-
-
- {#each replies as post}
-
- {/each}
- {/key}
- {/if}
-
-
-
diff --git a/svelte.config.js b/svelte.config.js
index b371a21..9c24c44 100644
--- a/svelte.config.js
+++ b/svelte.config.js
@@ -17,6 +17,11 @@ const config = {
}),
version: {
name: child_process.execSync('git rev-parse HEAD').toString().trim()
+ },
+ alias: {
+ '@cf/ui/*': "./src/lib/ui",
+ '@cf/icons/*': "./src/img/icons",
+ '@cf/store/*': "./src/lib/stores"
}
},
};