sanity-io / sanity-plugin-iframe-pane

Display any URL in a View Pane, along with helpful buttons to copy the URL, display a mobile size, reload the iframe or open in a new tab
MIT License
47 stars 13 forks source link

Option to hide displayURL bar #21

Closed SvSven closed 1 year ago

SvSven commented 1 year ago

It would be nice to have an option to hide the displayURL in the topbar of the iframe component. This makes it a bit more of a clean/seamless experience for our editors and in addition "hides" the fact we are linking to /api/preview with a bunch of (to them) strange query parameters (we transform the URL to a more user friendly one in Next.js).

Something simple like a showDisplayUrl option that defaults to true

<Box flex={1}>
  {showDisplayUrl && (
    <Text size={0} textOverflow="ellipsis">
      {displayUrl}
    </Text>
  )}
</Box>
john-rock commented 1 year ago

I agree we need this. We just implemented this iframe plugin with a page builder type setup in our studio and I can see this cause confusion for stakeholders when they are in there.

Never worked on a Sanity plugin before but I think I may experiment with getting this feature built.

benja commented 1 year ago

Hey! 👋🏼

This will be included in the next release. Thank you for the suggestion, @SvSven, and @john-rock for taking the time to implement it!