[WS-2012] Initial Implementation of Live Page Refresh button (Frontend only)#13679
[WS-2012] Initial Implementation of Live Page Refresh button (Frontend only)#13679shayneahchoon merged 59 commits intolatestfrom
Conversation
Added a visually hidden text element to announce new posts.
…bbc/simorgh into WS-2012-live-page-refresh-spike
…rgh into WS-2012-live-page-refresh-spike
…rgh into WS-2012-live-page-refresh-spike
|
|
||
| useEffect(() => { | ||
| const timerId = setInterval(() => { | ||
| if (enableFeature === false) return; |
There was a problem hiding this comment.
Added this line here so that we can merge in the PR as it is technically production ready.
| setTimeout(() => { | ||
| setShowButton(false); | ||
| }, TEN_SECONDS); |
There was a problem hiding this comment.
Should this timeout be cleaned up on unmount?
|
Just wondering if there was any thoughts towards using useReducer for this instead of a custom hook? Seems like it could fit the use case fairly well given its event driven nature. Would potentially help in the future to combine it with Context to allow passing state around more easily, as I can imagine things like the 'key points' and 'header' will want to be dynamically updated as well. This could be a something more for down the line though, just a thought. |
Just took at a look at reducers, I'm not too sure if it's the best fit for the functionality we're looking for. I'm happy to hop on a call and discuss this one further? |
Totally cool if it you think it won't be the best fit for it. You're much closer to the code/implementation for this, so it was just a thought that crossed my mind. Happy to take a steer away from the idea :) |
…rgh into WS-2012-live-page-refresh-spike
…rgh into WS-2012-live-page-refresh-spike
Isabella-Mitchell
left a comment
There was a problem hiding this comment.
Heya, looks good. I was unable to test this locally. Are there steps to get this to work locally?
I've permanently disabled it for the time being on the Live page as this work mainly focused on the visuals of the button. However, there is a model in storybook if you'd like to take a look. |
Resolves JIRA: WS-2012
WS-2153
Summary
Pre-production ready front-end for the Live Post Refresh button:
Code changes
Testing
Useful Links