Skip to content

Commit 1e05ab8

Browse files
authored
Merge pull request #265 from tarekfb/dev
Owner section drawer, view profile
2 parents fec3baf + 3896bbc commit 1e05ab8

17 files changed

Lines changed: 886 additions & 2088 deletions

File tree

package-lock.json

Lines changed: 757 additions & 2007 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"format:check": "prettier --check --plugin prettier-plugin-svelte ./src",
2222
"prepare": "husky && husky install",
2323
"db:types": "supabase gen types typescript --local > src/supabase.ts",
24-
"db:reset": "supabase db reset",
25-
"postinstall": "patch-package"
24+
"db:reset": "supabase db reset"
2625
},
2726
"devDependencies": {
2827
"@melt-ui/pp": "^0.3.2",
@@ -51,7 +50,6 @@
5150
"jsdom": "^24.1.0",
5251
"lucide-svelte": "^0.473.0",
5352
"msw": "^2.3.1",
54-
"patch-package": "^8.0.0",
5553
"postcss": "^8.4.31",
5654
"prettier": "^3.4.2",
5755
"prettier-plugin-svelte": "^3.0.3",
@@ -65,7 +63,6 @@
6563
},
6664
"type": "module",
6765
"dependencies": {
68-
"@sentry/sveltekit": "^9.5.0",
6966
"@square/svelte-store": "^0.2.1",
7067
"@supabase/ssr": "^0.3.0",
7168
"@supabase/supabase-js": "^2.33.0",
@@ -84,7 +81,7 @@
8481
"svelte-file-dropzone": "^2.0.8",
8582
"svelte-legos": "^0.2.2",
8683
"svelte-sonner": "^0.3.22",
87-
"sveltekit-superforms": "^2.3.0",
84+
"sveltekit-superforms": "2.11.0",
8885
"svelty-email": "^0.0.11",
8986
"tailwind-merge": "^2.3.0",
9087
"tailwind-variants": "^0.2.1",
@@ -104,4 +101,4 @@
104101
],
105102
"*./src": "prettier --write"
106103
}
107-
}
104+
}

src/hooks.client.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import { PUBLIC_ENVIRONMENT } from '$env/static/public';
2-
import * as Sentry from '@sentry/sveltekit';
3-
import { handleErrorWithSentry } from '@sentry/sveltekit';
1+
// import { PUBLIC_ENVIRONMENT } from '$env/static/public';
2+
// import * as Sentry from '@sentry/sveltekit';
3+
// import { handleErrorWithSentry } from '@sentry/sveltekit';
44

5-
Sentry.init({
6-
dsn: 'https://485a49edf664c4bad08c2ab0bf87a8eb@o4507622077169664.ingest.de.sentry.io/4507622079660112',
7-
environment: PUBLIC_ENVIRONMENT,
8-
enabled: PUBLIC_ENVIRONMENT !== "local",
9-
tracesSampleRate: 1.0,
10-
// For instance, initialize Session Replay:
11-
replaysSessionSampleRate: 0.1,
12-
replaysOnErrorSampleRate: 1.0,
13-
integrations: [Sentry.replayIntegration()],
14-
});
5+
// Sentry.init({
6+
// dsn: 'https://485a49edf664c4bad08c2ab0bf87a8eb@o4507622077169664.ingest.de.sentry.io/4507622079660112',
7+
// environment: PUBLIC_ENVIRONMENT,
8+
// enabled: PUBLIC_ENVIRONMENT !== "local",
9+
// tracesSampleRate: 1.0,
10+
// // For instance, initialize Session Replay:
11+
// replaysSessionSampleRate: 0.1,
12+
// replaysOnErrorSampleRate: 1.0,
13+
// integrations: [Sentry.replayIntegration()],
14+
// });
1515

1616

17-
export const handleError = handleErrorWithSentry();
17+
// export const handleError = handleErrorWithSentry();
1818
// or alternatively, if you don't have a custom error handler:
1919
// export const handleError = handleErrorWithSentry();

src/hooks.server.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ import { sequence } from "@sveltejs/kit/hooks";
55
import {
66
PUBLIC_SUPABASE_URL,
77
PUBLIC_SUPABASE_ANON_KEY,
8-
PUBLIC_ENVIRONMENT,
98
// PUBLIC_ENVIRONMENT,
109
} from "$env/static/public";
1110
import { createClient } from "@supabase/supabase-js";
1211
import { PRIVATE_SUPABASE_SERVICE_ROLE } from "$env/static/private";
13-
import { initCloudflareSentryHandle, sentryHandle } from '@sentry/sveltekit';
12+
// import { initCloudflareSentryHandle, sentryHandle } from '@sentry/sveltekit';
1413

1514
const supabase: Handle = async ({ event, resolve }) => {
1615
/**
@@ -98,9 +97,13 @@ const authGuard: Handle = async ({ event, resolve }) => {
9897
};
9998

10099

101-
export const handle: Handle = sequence(initCloudflareSentryHandle({
100+
export const handle: Handle = sequence(
101+
/*initCloudflareSentryHandle(
102+
{
102103
dsn: "https://485a49edf664c4bad08c2ab0bf87a8eb@o4507622077169664.ingest.de.sentry.io/4507622079660112",
103104
tracesSampleRate: 1.0,
104105
environment: PUBLIC_ENVIRONMENT,
105106
enabled: PUBLIC_ENVIRONMENT !== "local",
106-
}), sentryHandle(), supabase, authGuard);
107+
})
108+
, sentryHandle(),*/
109+
supabase, authGuard);

src/lib/components/atoms/delete-account.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
variant="destructive"
2525
disabled={$delayed}
2626
aria-label="Delete account"
27-
class="md:min-w-wider md:self-center"
27+
class="wide-button md:self-center"
2828
>
2929
{#if $delayed}
3030
<LoadingSpinner class="mr-2" /> <span>Laddar...</span>

src/lib/components/molecules/avatar-form.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
<FormMessage {message} scroll />
157157
<Button
158158
type="submit"
159-
class="md:min-w-wider md:self-center"
159+
class="wide-button md:self-center"
160160
disabled={$allErrors.length > 0 || $delayed || !$form.avatar}
161161
>
162162
{#if $timeout}

src/lib/components/molecules/owner-section.svelte

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,20 @@
1010
export let listing: ListingWithProfile | undefined = undefined;
1111
1212
const { slug } = $page.params;
13-
const url = `/profile/${slug}?${listing && `id=${listing.id}`}${listing ? "&" : "?"}preview=true`;
13+
const url = `/profile/${slug}?${listing ? `id=${listing.id}&` : ""}preview=true`;
1414
</script>
1515

16-
<div class="mt-6 flex flex-col items-center gap-y-4">
17-
<Button
18-
on:click={() => goto(url)}
19-
variant="outline"
20-
class="flex w-full items-center gap-x-2 self-center bg-card md:w-auto"
21-
><ExternalLink class="h-4 w-4" />visa som student</Button
22-
>
16+
<div class="mb-2 mt-4 flex flex-col items-center gap-y-4 md:mb-6">
2317
<IsPublished
2418
isPublished={listing?.visible}
2519
class="self-center"
2620
variant="accent"
2721
/>
28-
<small class="mb-8 flex flex-col gap-y-4 px-8 text-center text-lg">
29-
<p class="text-muted-foreground">
22+
<small class="flex flex-col gap-y-4 px-8 text-center text-lg">
23+
<p class="flex flex-col text-muted-foreground">
3024
Vill du göra ändringar på din profilbeskrivning eller annan informationen
31-
om dig själv? <Link href="/account/settings" class="whitespace-nowrap"
25+
om dig själv?
26+
<Link href="/account/settings" class="whitespace-nowrap"
3227
>Gå till din profil</Link
3328
>
3429
</p>
@@ -42,4 +37,10 @@
4237
{/if}
4338
<p class="italic text-muted-foreground">Bara du kan se detta.</p>
4439
</small>
40+
<Button
41+
on:click={() => goto(url)}
42+
variant="outline-card"
43+
class="wide-button icon-button"
44+
><ExternalLink class="size-4" />visa som student</Button
45+
>
4546
</div>

src/lib/components/molecules/profile-header-info.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
{#if listing}
3636
<div class="flex flex-col gap-y-1">
3737
<SecondaryTitle>
38-
{listing.hourlyPrice} SEK
38+
{#if listing.hourlyPrice < 1}
39+
Gratis
40+
{:else}
41+
{listing.hourlyPrice} SEK
42+
{/if}
3943
</SecondaryTitle>
4044
<p class="text-sm text-muted-foreground">60 minuter</p>
4145
</div>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<script lang="ts">
2+
import type { ListingWithProfile } from "src/lib/shared/models/listing.ts";
3+
import { Button } from "$lib/components/ui/button/index.js";
4+
import OwnerSection from "./owner-section.svelte";
5+
import * as Drawer from "$lib/components/ui/drawer/index.js";
6+
7+
export let listing: ListingWithProfile | undefined = undefined;
8+
</script>
9+
10+
<Drawer.Root>
11+
<Drawer.Trigger class="mt-4 md:mb-8 md:mt-0"
12+
><Button class="wide-button" variant="outline-card">Inställningar</Button
13+
></Drawer.Trigger
14+
>
15+
<Drawer.Content>
16+
<div class="mx-auto mt-0 h-2 w-[100px] rounded-full bg-black/10"></div>
17+
<Drawer.Header>
18+
<Drawer.Title>Inställningar</Drawer.Title>
19+
<Drawer.Description>
20+
<OwnerSection {listing} />
21+
</Drawer.Description>
22+
</Drawer.Header>
23+
</Drawer.Content>
24+
</Drawer.Root>

src/lib/components/molecules/search-result-item.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@
6363
</div>
6464
<div class="flex flex-col items-center gap-y-1">
6565
<h3 class="text-xl md:text-2xl {boxStyling}">
66-
{result.hourlyPrice} <span class="text-sm md:text-lg">SEK</span>
66+
<span class="text-sm md:text-lg">
67+
{#if result.hourlyPrice < 1}
68+
Gratis
69+
{:else}
70+
{result.hourlyPrice} SEK
71+
{/if}
72+
</span>
6773
</h3>
6874
<p class="text-sm text-muted-foreground">60 minuter</p>
6975
</div>

0 commit comments

Comments
 (0)