Use fluid scale custom properties and make everything mobile friendly

This commit is contained in:
thiloho
2024-08-15 16:26:32 +02:00
parent 3eb05da564
commit 2a1ada1c70
11 changed files with 244 additions and 80 deletions

View File

@@ -1,9 +1,10 @@
import type { Actions, PageServerLoad } from "./$types";
import { API_BASE_PREFIX } from "$lib/utils";
export const load: PageServerLoad = async ({ fetch, cookies, url }) => {
export const load: PageServerLoad = async ({ fetch, cookies, url, locals }) => {
const searchQuery = url.searchParams.get("website_search_query");
const sortBy = url.searchParams.get("website_sort");
const filterBy = url.searchParams.get("website_filter");
const params = new URLSearchParams();
@@ -29,6 +30,15 @@ export const load: PageServerLoad = async ({ fetch, cookies, url }) => {
break;
}
switch (filterBy) {
case "creations":
params.append("user_id", `eq.${locals.user.id}`);
break;
case "shared":
params.append("user_id", `not.eq.${locals.user.id}`);
break;
}
const constructedFetchUrl = `${baseFetchUrl}?${params.toString()}`;
const totalWebsitesData = await fetch(baseFetchUrl, {