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

chore(js-ts): Convert app/components/UI/SettingsNotification/index.js to TypeScript #11339

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

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Sep 20, 2024

Link to Devin run: https://preview.devin.ai/devin/b44f5f30e5ac4f9bb3f19ec2b4bf235f

If you have any feedback, you can leave comments in the PR and I'll address them in the app!

@devin-ai-integration devin-ai-integration bot added No QA Needed Apply this label when your PR does not need any QA effort. needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) team-mobile-platform labels Sep 20, 2024
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Comment on lines 67 to 72
interface SettingsNotificationProps {
style?: StyleProp<ViewStyle>;
isWarning?: boolean;
isNotification?: boolean;
children?: React.ReactNode;
}
Copy link
Contributor

@Daniel-Cross Daniel-Cross Sep 20, 2024

Choose a reason for hiding this comment

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

Are all these props optional? It seems from the component body that if isNotification is true then style is required.

It would also seem that children is required as there is no condition check such as { children.length > 0 && children }

Hard to anticipate, I'm aware. However, as a developer, when I come to import and use this component I won't get a TypeScript warning that a prop is missing, which defeats the purpose of using TypeScript to check props that are necessary.

Choose a reason for hiding this comment

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

@Daniel-Cross Thanks for pointing these out. I have made the children prop as necessary. However, style is breaking existing test cases; that's why I made it optional only. Since it won't be required when isNotification is false, this can't be made required straightforwardly in the interface. Maybe we can add extra validation for this when isNotification is true

@devin-ai-integration devin-ai-integration bot added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Sep 25, 2024
Copy link
Contributor Author

Triggering CI rerun

Copy link

sonarcloud bot commented Oct 1, 2024

@devin-ai-integration devin-ai-integration bot marked this pull request as ready for review October 1, 2024 22:13
@devin-ai-integration devin-ai-integration bot requested a review from a team as a code owner October 1, 2024 22:13
Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) No QA Needed Apply this label when your PR does not need any QA effort. skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-mobile-platform
Projects
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

4 participants