Skip to content

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

Merged
merged 5 commits into from
Jul 21, 2020
Merged

Conversation

mendyEdri
Copy link
Contributor

Added support for the demo screen to have injected UI as extra settings.

@ethanshar
Copy link
Collaborator

@mendyEdri When and if this ready, assign me as a reviewer 👍

@mendyEdri mendyEdri requested a review from ethanshar July 19, 2020 06:42
@mendyEdri mendyEdri force-pushed the demo-screen-support-injected-ui branch from eda388f to 9440b8c Compare July 19, 2020 09:47
Comment on lines 58 to 62
shouldComponentUpdate = (nextProps, nextState) => {
this.updateShowRefreshAppMessage(nextProps.showRefreshAppMessage);
return true;
}

Copy link
Collaborator

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.

Copy link
Contributor Author

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?

Copy link
Collaborator

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.

@mendyEdri mendyEdri requested a review from ethanshar July 20, 2020 07:25
@@ -15,9 +14,11 @@ class SettingsScreen extends Component {

const data = props.navigationData || navigationData;
const playground = props.playground || playgroundScreen;

const extraSettingsUI = props.extraSettingsUI;
Copy link
Collaborator

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.

@mendyEdri mendyEdri requested a review from ethanshar July 21, 2020 09:53
@ethanshar ethanshar merged commit 56ec929 into master Jul 21, 2020
@mendyEdri mendyEdri deleted the demo-screen-support-injected-ui branch September 15, 2020 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants