-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make gallery accept a prop for images
- Loading branch information
sandroid
committed
Nov 29, 2023
1 parent
80fe43f
commit 1c1c80a
Showing
2 changed files
with
24 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
--- | ||
import MyCustomImageComponent from "./MyCustomImageComponent.astro"; | ||
import { Image } from "astro:assets"; | ||
import ImageWrapper from "../react/Images/ImageWrapper.tsx"; | ||
interface Props { | ||
images: any; | ||
} | ||
const { images } = Astro.props; | ||
--- | ||
|
||
<MyCustomImageComponent | ||
imagePath="/src/images/photography/cows_of_mendip_hills/cows-of-mendip-hills-3.jpg" | ||
altText="A picture of some cows" | ||
name="Priya" | ||
age={25} | ||
/> | ||
<div class="card"> | ||
{ | ||
Object.keys(images).map((image) => { | ||
return ( | ||
<ImageWrapper client:only> | ||
<Image src={images[image]()} alt={"image"} /> | ||
</ImageWrapper> | ||
); | ||
}) | ||
} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters