feat: Testimonial Integration
This commit is contained in:
@@ -1,11 +1,26 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { Skeleton } from '$lib/components/ui/skeleton';
|
||||||
|
|
||||||
|
let { testimonial } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section class="mt-12">
|
<section class="mt-12 flex flex-col gap-8">
|
||||||
<h5 class="text-center text-4xl font-bold capitalize">Trust that speak for itself</h5>
|
<h5 class="text-center text-4xl font-bold capitalize">Trust that speak for itself</h5>
|
||||||
<!-- <div>
|
|
||||||
<a href="#">
|
{#await testimonial}
|
||||||
<video src="#"></video>
|
<div class="flex items-center justify-center gap-4">
|
||||||
</a>
|
{#each Array.from({ length: 10 })}
|
||||||
</div> -->
|
<Skeleton class="aspect-[9/16] h-full w-full bg-gray-400"></Skeleton>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{:then reviews}
|
||||||
|
<div class="flex items-center justify-center gap-4">
|
||||||
|
{#each reviews?.testimonial.slice(0, 4) as review}
|
||||||
|
<div class="relative aspect-[9/16] h-full">
|
||||||
|
<iframe src={review?.media} title={review?.name} frameborder="0" class="h-full w-full"
|
||||||
|
></iframe>
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
</div>
|
||||||
|
{/await}
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -32,5 +32,9 @@ export const endpoints = {
|
|||||||
celebrity: '/products/celebrity',
|
celebrity: '/products/celebrity',
|
||||||
recommended: '/products/recommended',
|
recommended: '/products/recommended',
|
||||||
flashSale: '/products/flash-sales'
|
flashSale: '/products/flash-sales'
|
||||||
|
},
|
||||||
|
testimonial: {
|
||||||
|
show: '/testimonial/',
|
||||||
|
create: '/testimonial/'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { PageServerLoad } from './$types';
|
|||||||
|
|
||||||
export const load: PageServerLoad = async ({ fetch }) => {
|
export const load: PageServerLoad = async ({ fetch }) => {
|
||||||
try {
|
try {
|
||||||
const [banner, celebrity, newArival, trending] = await Promise.all([
|
const [banner, celebrity, newArival, trending, testimonial] = await Promise.all([
|
||||||
fetch(`${VITE_BACKEND_URL}${endpoints.category.banner}`, {
|
fetch(`${VITE_BACKEND_URL}${endpoints.category.banner}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
@@ -32,6 +32,14 @@ export const load: PageServerLoad = async ({ fetch }) => {
|
|||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Accept: 'application/json'
|
Accept: 'application/json'
|
||||||
}
|
}
|
||||||
|
}),
|
||||||
|
|
||||||
|
fetch(`${VITE_BACKEND_URL}${endpoints.testimonial.show}`, {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
Accept: 'application/json'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -46,7 +54,8 @@ export const load: PageServerLoad = async ({ fetch }) => {
|
|||||||
banner: banner.json(),
|
banner: banner.json(),
|
||||||
// celebrity: celebrity.json(),
|
// celebrity: celebrity.json(),
|
||||||
newArrival: newArival.json(),
|
newArrival: newArival.json(),
|
||||||
trending: trending.json()
|
trending: trending.json(),
|
||||||
|
testimonial: testimonial.json()
|
||||||
};
|
};
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{/await}
|
{/await}
|
||||||
|
|
||||||
<!-- <Testimonial /> -->
|
<Testimonial testimonial={data?.testimonial} />
|
||||||
|
|
||||||
<section class="py-12">
|
<section class="py-12">
|
||||||
<h6 class="text-center text-8xl font-semibold text-primary">20 Years of Clinical Trust</h6>
|
<h6 class="text-center text-8xl font-semibold text-primary">20 Years of Clinical Trust</h6>
|
||||||
|
|||||||
Reference in New Issue
Block a user