Skip to content

Instantly share code, notes, and snippets.

@stevedylandev
Created June 14, 2022 01:03
Show Gist options
  • Save stevedylandev/fb9bbebc62f468848bc3e688ecb913fc to your computer and use it in GitHub Desktop.
Save stevedylandev/fb9bbebc62f468848bc3e688ecb913fc to your computer and use it in GitHub Desktop.
IPFS Image Optimization
import './App.css';
function App() {
let imageIds = []
for (let id = 1; id <= 8; id++){
imageIds.push(id)
}
return (
<div className="App">
<div className="grid">
{imageIds.map((id) => {
let url = `https://stevedsimkins.mypinata.cloud/ipfs/QmTwDNr6LyRzW8H3XorFDArfKEH3GRV1SkF6bAEBF3P4GJ/${id}.jpg?img-width=1080&img-height=1080`
let name = `nft ${id}`
return (
<div className="image-container">
<img src={url} alt={name}/>
</div>
)
})}
</div>
</div>
);
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment