diff --git a/src/components/Footer.svelte b/src/components/Footer.svelte index 13d8370..ec1a3cf 100644 --- a/src/components/Footer.svelte +++ b/src/components/Footer.svelte @@ -12,10 +12,10 @@ - About - Privacy Policy - Terms & Conditions - Contact + About + Privacy Policy + Terms & Conditions + Contact diff --git a/src/components/ShoppingCart.svelte b/src/components/ShoppingCart.svelte index 714e4ce..6536485 100644 --- a/src/components/ShoppingCart.svelte +++ b/src/components/ShoppingCart.svelte @@ -1,25 +1,55 @@
- {#if product} + {#if isLoading} +

Loading product details...

+ {:else if error} +

{error}

+ {:else if product}
@@ -233,17 +114,17 @@
- -
@@ -294,10 +174,7 @@
- @@ -308,6 +185,6 @@
{:else} -

Loading product details...

+

Product not found

{/if}
diff --git a/src/routes/(auth)/landing/+page.svelte b/src/routes/(auth)/landing/+page.svelte index 23eba31..fc66f57 100644 --- a/src/routes/(auth)/landing/+page.svelte +++ b/src/routes/(auth)/landing/+page.svelte @@ -1,7 +1,8 @@ -
+
-

Beautiful Flowers for Every Occasion

-

+

+ Beautiful Flowers for Every Occasion +

+

Fresh, handpicked flowers delivered to your doorstep. Make every moment special with our stunning bouquets.

-
+
-
+
-
+

Fresh & Handpicked

We source the freshest flowers directly from local growers.

-
+

Fast Delivery

Get your flowers delivered the same day or schedule a future delivery.

-
+

Satisfaction Guaranteed

We stand by our products with a 100% satisfaction guarantee.

@@ -97,12 +123,12 @@
-
+
-

Featured Products

+

Featured Products

{#each featuredProducts as product} -
+
{product.title}

{product.title}

@@ -119,12 +145,14 @@
-
+
-

What Our Customers Say

+

+ What Our Customers Say +

{#each testimonials as testimonial} -
+
{#each Array(testimonial.rating) as _} @@ -139,14 +167,29 @@
-
+
-

Ready to Brighten Someone's Day?

-

+

Ready to Brighten Someone's Day?

+

Shop our collection of beautiful flowers and make every moment special.

-
+
+ + diff --git a/src/routes/(auth)/main/+page.svelte b/src/routes/(auth)/main/+page.svelte index aa0df37..35d4b41 100644 --- a/src/routes/(auth)/main/+page.svelte +++ b/src/routes/(auth)/main/+page.svelte @@ -1,6 +1,5 @@ +
+ {#if $error} +
+ {$error} +
+ {/if} +

Discover our beautiful collection of fresh flowers

+
+ {#if $isLoading}
{:else} -
+ +
{#each $paginatedProducts as product, i (product.id)}
toggleFavorite(product)} > - {#if $favorites.some((item: Product) => item.id === product.id)} + {#if $userFavorites.some((fav) => fav.product === product.id)}
@@ -385,7 +282,7 @@

${product.price.toFixed(2)}

- {#if $favorites.some((item: Product) => item.id === product.id)} + {#if $userFavorites.some((fav) => fav.product === product.id)} Favorite {/if}
@@ -405,12 +302,14 @@ {/each}
- {#if $filteredProducts.length === 0 && products.length === 0} + + {#if $filteredProducts.length === 0}

No products found matching your criteria.

{/if} + {#if $totalPages > 1}
- Login failed + + {#if !success} + {errorMessage} + {/if}
diff --git a/src/routes/login/+page.ts b/src/routes/login/+page.ts index 8aa5721..b5c44a0 100644 --- a/src/routes/login/+page.ts +++ b/src/routes/login/+page.ts @@ -1,8 +1,8 @@ -import session from '$lib/session.svelte'; +import { authService } from '$lib/services/api'; import { redirect } from '@sveltejs/kit'; export async function load() { - if (session.loggedIn()) { + if (authService.isAuthenticated()) { redirect(307, '/landing'); } }