Skip to content

Commit

Permalink
Merge branch 'main' into Custom_Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mabu2807 authored Jan 18, 2024
2 parents cd95078 + d948227 commit b6db86b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/Store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const registerUsername = writable('');

//https://server-beta.de/api
//https://server-alpha.tech/api
//http://localhost:3000
//http://localhost:3000/api
// local network http://192.168.0.126:3000/api
export const serverURL = writable('http://localhost:3000/api');

Expand Down
38 changes: 38 additions & 0 deletions src/routes/search/posts/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<script lang="ts">
import { Toast } from '@skeletonlabs/skeleton';
//import { getToastStore } from '@skeletonlabs/skeleton';
//import { createToast } from '$lib/Toasts';
import { initializeStores } from '@skeletonlabs/skeleton';
import Icon from '@iconify/svelte';
//import { serverURL } from '$lib/Store';
//import type { PostStructure } from '$lib/types/Post';
initializeStores();
//const toastStore = getToastStore();
//let response: Response;
//let hashtagInput: string;
//let serverUrl: string;
//let statusCode: number = 0;
//let posts: Array<PostStructure> = [];
//async function handleHashtagInput(event: Event) {}
</script>

<Toast />
<div class="mt-8 mb-8 w-3/5 min-h-screen mx-auto">
<div class="mb-8 flex justify-center items-center gap-4">
<a href="/search/users">
<Icon class="w-10 h-10" icon="mdi:account-search-outline" style="font-size: 32px" />
</a>
<a href="/search/posts">
<Icon
class="w-10 h-10"
icon="mdi:text-box-search"
style="font-size: 32px; border: 2px solid; border-radius: 5px;"
/>
</a>
</div>
<input class="input w-full" type="search" name="hashtag" placeholder="Search a hashtag..." />
<div class="mt-4 w-full"></div>
</div>
23 changes: 21 additions & 2 deletions src/routes/search/users/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import Icon from '@iconify/svelte';
import { serverURL } from '$lib/Store';
import type { Profil } from '$lib/types/User';
import { Avatar } from '@skeletonlabs/skeleton';
initializeStores();
const toastStore = getToastStore();
Expand Down Expand Up @@ -80,6 +81,18 @@

<Toast />
<div class="mt-8 mb-8 w-3/5 min-h-screen mx-auto">
<div class="mb-8 flex justify-center items-center gap-4">
<a href="/search/users">
<Icon
class="w-10 h-10"
icon="mdi:account-search"
style="font-size: 32px; border: 2px solid; border-radius: 5px;"
/>
</a>
<a href="/search/posts">
<Icon class="w-10 h-10" icon="mdi:text-box-search-outline" style="font-size: 32px" />
</a>
</div>
<input
class="input w-full"
type="search"
Expand All @@ -91,9 +104,15 @@
{#each users as user}
<div class="flex flex-row items-center justify-between w-full">
<div class="flex flex-row items-center">
<img class="w-12 h-12 rounded-full" src={user.profilePictureUrl} alt="Avatar" />
<Avatar
src={user.profilePictureUrl !== '' ? user.profilePictureUrl : '/default-avatar.png'}
width="w-12"
rounded="rounded-full"
/>
<div class="ml-4">
<a href="/users/{user.username}" class="text-lg font-semibold">{user.nickname}</a>
<a href="/profile?username={user.username}" class="text-lg font-semibold"
>{user.nickname}</a
>
<p class="text-gray-500">@{user.username}</p>
</div>
</div>
Expand Down

0 comments on commit b6db86b

Please sign in to comment.