-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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(in-app-messaging): add IconButton and Paragraph feature UI components #9076
feat(in-app-messaging): add IconButton and Paragraph feature UI components #9076
Conversation
772baf7
to
dbcadce
Compare
packages/aws-amplify-react-native/src/InAppMessaging/ui/IconButton/styles.ts
Outdated
Show resolved
Hide resolved
packages/aws-amplify-react-native/src/InAppMessaging/ui/IconButton/IconButton.tsx
Outdated
Show resolved
Hide resolved
import { styles } from './styles'; | ||
import { ParagraphProps } from './types'; | ||
|
||
export function Paragraph({ children, style }: ParagraphProps) { |
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.
What's the intended usage of this component?
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.
Basically a wrapper component for the multiple text components, rn it is very scoped to the feature use case
This pull request introduces 1 alert when merging 638c83b into c4df4fa - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## in-app-messaging/main #9076 +/- ##
======================================================
Coverage 78.01% 78.01%
======================================================
Files 250 250
Lines 18105 18105
Branches 3881 3881
======================================================
Hits 14124 14124
Misses 3851 3851
Partials 130 130 Continue to review full report at Codecov.
|
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.
LGTM! Just added a couple clarifying questions revolving around scalability.
import { getStyles } from './styles'; | ||
import { IconButtonProps } from './types'; | ||
|
||
export function IconButton({ color, source, size = 16, ...pressableProps }: IconButtonProps) { |
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.
Would we need to worry about color
or source
being undefined
here? Should these be defaulted to something to avoid any funky errors?
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.
Good question :)
For color
, React Native will handle a style key with an undefined
value as "removing" the property, so in this case it has no impact as it is used to set tintColor
which is the value it would "remove" (hoping that makes sense)
With source
, if undefined
is passed, the underlying Image
component will just render as a View
with no content
packages/aws-amplify-react-native/src/InAppMessaging/ui/Paragraph/styles.ts
Outdated
Show resolved
Hide resolved
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.
@calebpollman does good work 👏
This pull request has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Description of changes
Add
IconButton
andParagraph
components for use in In-App Messaging components.Issue #, if available
NA
Description of how you validated changes
Manually tested in sample app
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.