prezly / theme-nextjs-bea

News site built with NextJS, Typescript and Prezly SDK
https://theme-nextjs-bea-the-good-newsroom.vercel.app
MIT License
43 stars 11 forks source link

[CARE-5201] Feature - Allow communication between the theme and the parent #1155

Closed kudlajz closed 2 months ago

kudlajz commented 2 months ago

We need to be able to preserve the scroll position when live previewing the theme, but since it's not possible to access the scroll position of the iframe, we need this extra code to provide the scroll position when scrolling happens.

Similarly, we also need to listen to the messages from the parent so we can restore the scroll position after the iframe is reloaded.

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
theme-nextjs-bea-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2024 11:22am
3 Ignored Deployments | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **theme-nextjs-bea-cookbook** | ⬜️ Ignored ([Inspect](https://vercel.com/prezly/theme-nextjs-bea-cookbook/5UsXtgXm9QnqFmXjuwt7DBx1KnQL)) | [Visit Preview](https://theme-nextjs-bea-cookbook-git-feature-care-5201-99c430-prezly1.vercel.app) | | Jun 4, 2024 11:22am | | **theme-nextjs-bea-photography** | ⬜️ Ignored ([Inspect](https://vercel.com/prezly/theme-nextjs-bea-photography/F3zCBA7t3GAu7uwCQL4yD8eLSPRk)) | [Visit Preview](https://theme-nextjs-bea-photography-git-feature-care-52-d335c4-prezly1.vercel.app) | | Jun 4, 2024 11:22am | | **theme-nextjs-bea-the-good-newsroom** | ⬜️ Ignored ([Inspect](https://vercel.com/prezly/theme-nextjs-bea-the-good-newsroom/5A8p5eBjw624Ehdxq1qZmTa2Pq4v)) | [Visit Preview](https://theme-nextjs-bea-the-good-newsroom-git-feature-c-227ddd-prezly1.vercel.app) | | Jun 4, 2024 11:22am |
kudlajz commented 2 months ago

We're adding functionality to the theme app that is only necessary for the rock app.

But isn't that the case with literally every functionality? I mean, the themes are built in order to support stuff we have in the app. They have to work well with Prezly, it's not like we're building these themes to be their standalone thing, is it?

Either way, I would recommend posting your concerns in Linear, Discourse or some other platform where other people can see it, otherwise no one is gonna read it here on Github 🙂

More logic that we need to add and maintain in every theme app in order for it to work with the rock app properly.

That is true currently, but I think the plan is to get rid of Greta and Lena and merge their "differences" into Bea as customization options so we end up with one theme that is much more customizable rather than have several slightly different themes. That should make the maintenance much easier in the long term.