Skip to content
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

feat: global screen wrapper #1321

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

MosCD3
Copy link
Contributor

@MosCD3 MosCD3 commented Nov 18, 2024

Summary of Changes

This is a first step into having a global screen wrapper to allow more customization over pages layout

Included

  • Creating the wrapper with minimal settings
  • Applying to some screens as a means of initial implementation
  • Applying to terms screen with flags to allow custom headers
  • Extend injectable screen options to allow injecting custom header

Replace this text with a high-level summary of the changes included in this PR.

Related Issues

Please reference here any issue #'s that are relevant to this PR, or simply enter "N/A" if this PR does not relate to any existing issues.

Pull Request Checklist

Tick all boxes below to demonstrate that you have completed the respective task. If the item does not apply to your this PR check it anyway to make it apparent that there's nothing to do.

  • All commits contain a DCO Signed-off-by line (we use the DCO GitHub app to enforce this);
  • Updated LICENSE-3RD-PARTY.md for any added dependencies or vendored components;
  • Updated documentation as needed for changed code and new or modified features;
  • Added sufficient tests so that overall code coverage is not reduced.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

Pro Tip 🤓

  • Read our contribution guide at least once; it will save you a few review cycles!
  • Your PR will likely not be reviewed until all the above boxes are checked and all automated tests have passed.

PR template adapted from the Python attrs project.

Signed-off-by: Mostafa Gamal <[email protected]>
@MosCD3 MosCD3 mentioned this pull request Nov 19, 2024
4 tasks
Signed-off-by: Mostafa Gamal <[email protected]>
Signed-off-by: Mostafa Gamal <[email protected]>
Signed-off-by: Mostafa Gamal <[email protected]>
@MosCD3 MosCD3 marked this pull request as ready for review November 20, 2024 17:52
@jleach jleach changed the title Global screen wrapper feat: global screen wrapper Nov 26, 2024
Copy link

sonarcloud bot commented Nov 27, 2024

Comment on lines +25 to +47
//Customizing Terms screen custom header
/*
this.container.registerInstance(TOKENS.OBJECT_ONBOARDING_CONFIG, {
...DefaultScreenOptionsDictionary,
[Screens.Terms]: {
...DefaultScreenOptionsDictionary[Screens.Terms],
headerShown: false,
},
})
this.container.registerInstance(TOKENS.OBJECT_LAYOUT_CONFIG, {
...DefaultScreenLayoutOptions,
[Screens.Terms]: {
...DefaultScreenLayoutOptions[Screens.Terms],
customEdges: ['bottom'],
safeArea: true,
Header: () => (
<View style={{ backgroundColor: 'red', height: 129, justifyContent: 'center', alignItems: 'center' }}>
<Text style={{ color: 'white' }}>Custom Header</Text>
</View>
),
},
})
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Comment on lines +29 to +34
const { safeArea, customEdges, style, Header } = screenProps || {
safeArea: false,
customEdges: ['top', 'left', 'right', 'bottom'],
style: {},
header: undefined,
}
Copy link
Contributor

@jcdrouin21 jcdrouin21 Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't be? :

const { safeArea, customEdges, style, Header } = screenProps || {
    safeArea: false,
    customEdges: ['top', 'left', 'right', 'bottom'],
    style: {},
+   Header: undefined,
  }

[Screens.Terms]: {
customEdges: ['top', 'left', 'right'],
},
//TODO: Add more screens here
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be clear that adding new screens here requires submitting a new PR to include the wrapper at the screen level as well.

However, I wonder if it might be more efficient to handle everything within this PR instead.

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