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(in-app-messaging): add IconButton and Paragraph feature UI components #9076

Conversation

calebpollman
Copy link
Member

Description of changes

Add IconButton and Paragraph components for use in In-App Messaging components.

These components are feature specific and not to be exported as officially supported UI Amplify components

Issue #, if available

NA

Description of how you validated changes

Manually tested in sample app

Checklist

  • PR description included
  • yarn test passes
  • Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@calebpollman calebpollman requested review from cshfang and ericclemmons and removed request for Ashish-Nanda October 22, 2021 03:28
@calebpollman calebpollman force-pushed the in-app-messaging/add-ui-components branch from 772baf7 to dbcadce Compare October 22, 2021 03:35
import { styles } from './styles';
import { ParagraphProps } from './types';

export function Paragraph({ children, style }: ParagraphProps) {
Copy link
Member

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?

Copy link
Member Author

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

@lgtm-com
Copy link

lgtm-com bot commented Oct 22, 2021

This pull request introduces 1 alert when merging 638c83b into c4df4fa - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2021

Codecov Report

Merging #9076 (ba135c9) into in-app-messaging/main (c4df4fa) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@                  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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c4df4fa...ba135c9. Read the comment docs.

Copy link
Contributor

@nickarocho nickarocho left a 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) {
Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

@ericclemmons ericclemmons left a 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 👏

@calebpollman calebpollman merged commit b8c9928 into aws-amplify:in-app-messaging/main Oct 26, 2021
@calebpollman calebpollman deleted the in-app-messaging/add-ui-components branch October 26, 2021 15:54
@github-actions
Copy link

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 *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants