fulldev-ui 0.5.0-beta.7 → 0.5.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/blocks/Product.astro
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
import { getImage } from 'astro:assets'
|
|
2
3
|
import CartForm from 'fulldev-ui/components/CartForm.astro'
|
|
3
4
|
import Element from 'fulldev-ui/components/Element.astro'
|
|
4
5
|
import Gallery from 'fulldev-ui/components/experimental/Gallery.astro'
|
|
@@ -27,8 +28,11 @@ const {
|
|
|
27
28
|
...rest
|
|
28
29
|
} = Astro.props
|
|
29
30
|
|
|
30
|
-
const slug = Astro.
|
|
31
|
+
const slug = Astro.url.pathname.replace(/^\/|\/$/g, '') || 'index'
|
|
31
32
|
const src = `/src/images/${images?.[0].id}`
|
|
33
|
+
const gotImage = await getImage({ src, width: 200, height: 200 })
|
|
34
|
+
|
|
35
|
+
console.log({ hoi: gotImage.src })
|
|
32
36
|
---
|
|
33
37
|
|
|
34
38
|
<Section
|
|
@@ -60,7 +64,7 @@ const src = `/src/images/${images?.[0].id}`
|
|
|
60
64
|
style={{ marginTop: 'var(--space-5)' }}
|
|
61
65
|
/>
|
|
62
66
|
<CartForm
|
|
63
|
-
image={src}
|
|
67
|
+
image={gotImage.src}
|
|
64
68
|
{title}
|
|
65
69
|
{price}
|
|
66
70
|
{slug}
|
|
@@ -44,7 +44,7 @@ const { title, slug, image, price, variants, ...rest } = Astro.props
|
|
|
44
44
|
<Input
|
|
45
45
|
type="hidden"
|
|
46
46
|
name="image"
|
|
47
|
-
value={image}
|
|
47
|
+
value={Astro.url.origin ? Astro.url.origin + image : undefined}
|
|
48
48
|
/>
|
|
49
49
|
{
|
|
50
50
|
Object.entries(variants ?? {}).map(([key, options]) => (
|