-
Notifications
You must be signed in to change notification settings - Fork 734
Demo screen support injected ui #855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@mendyEdri When and if this ready, assign me as a reviewer 👍 |
…emo settings screen
with ability to controll the 'refresh app' message as a prop
eda388f
to
9440b8c
Compare
demo/src/screens/MainScreen.js
Outdated
shouldComponentUpdate = (nextProps, nextState) => { | ||
this.updateShowRefreshAppMessage(nextProps.showRefreshAppMessage); | ||
return true; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be called before each render.
Not sure that's the right way to do that..
shouldComponentUpdate
is meant to have calculation regarding whether the component should render or not.
If anything you probably want to move this part of code to componentDidUpdate
.
Anyway, maybe there's a better way to trigger a toast from the private repo..
I think the wiring here is a little more complicated then is should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
componentDidUpdate
- gotcha.
@ethanshar Triggering the toast from the private repo - you mean that the toast should be rendered in the private repo?
or some different - easier wiring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, something like that.
In the private repo we have an infrastructure for trigger Toast from anywhere in the code, we call it global toast.
It's a functionality we offer to One App and we use it ourselves in the demo app. so it might easier for you to use that..
Search in the private repo for "toggleToast" in the MainScreen.
demo/src/screens/SettingsScreen.js
Outdated
@@ -15,9 +14,11 @@ class SettingsScreen extends Component { | |||
|
|||
const data = props.navigationData || navigationData; | |||
const playground = props.playground || playgroundScreen; | |||
|
|||
const extraSettingsUI = props.extraSettingsUI; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is also redundant, no need to store this prop in state cause we're rendering it directly from props.
Added support for the demo screen to have injected UI as extra settings.