NotionX / react-notion-x

Fast and accurate React renderer for Notion. TS batteries included. ⚡️
https://react-notion-x-demo.transitivebullsh.it
MIT License
4.79k stars 562 forks source link

defaultMapImageUrl - check for signed URLs #162

Open marekhvolka opened 2 years ago

marekhvolka commented 2 years ago

Please, can we add a check to the defaultMapImageUrl for the signed URLs? So when we have a signed URL for a specific block, we will use it instead of the native URL. This was the only reason I had to override the mapImageUrl method and I guess, it would be better to have this built-in (it took some time to figure it out as well)

Something like:

if (data.signed_urls && data.signed_urls[block.id]) {
  return data.signed_urls[block.id];
}
transitive-bullshit commented 2 years ago

This is a great idea. Good catch.