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 modal UI component #9712

Merged
merged 28 commits into from
May 10, 2022
Merged

feat(in-app-messaging): Add modal UI component #9712

merged 28 commits into from
May 10, 2022

Conversation

Samaritan1011001
Copy link
Contributor

@Samaritan1011001 Samaritan1011001 commented Mar 17, 2022

Description of changes

Adds the modal support to in-app-messaging. Similar to a Full Screen message with a slightly different layout.
A function in utils.ts is modified to fit the needed design for modal.
Tests have been modified and added to validated the changes.

PORTRAIT

Screen Shot 2022-03-31 at 2 09 04 PM

Screen Shot 2022-03-22 at 4 27 49 PM

Screen Shot 2022-03-31 at 2 09 52 PM

LANDSCAPE

all_options_landscape_ios

Issue #, if available

Description of how you validated changes

Different test cases as mentioned below were manually validated in addition to the unit tests for Modal.

  • Only text of normal length
  • Text (Header and Body) with max length
  • Modal message with image
  • Image + text
  • Text + buttons
  • Only a single button with action to open a url link
  • Image + text + 2 buttons
  • Image + long text + 2 buttons

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
Copy link
Contributor

@Samaritan1011001 Thanks for opening this! Can you please add screenshots similar to the In-App Messaging FullScreenMessage PR?

Copy link
Contributor

@calebpollman calebpollman left a comment

Choose a reason for hiding this comment

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

@Samaritan1011001 Looks like a great start! Left some minor feedback

@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2022

Codecov Report

Merging #9712 (1b6b60d) into in-app-messaging/staging (5e454ad) will increase coverage by 0.82%.
The diff coverage is 100.00%.

@@                     Coverage Diff                      @@
##           in-app-messaging/staging    #9712      +/-   ##
============================================================
+ Coverage                     74.52%   75.34%   +0.82%     
============================================================
  Files                           318      319       +1     
  Lines                         20284    19750     -534     
  Branches                       4421     4312     -109     
============================================================
- Hits                          15117    14881     -236     
+ Misses                         5028     4763     -265     
+ Partials                        139      106      -33     
Impacted Files Coverage Δ
.../InAppMessaging/components/BannerMessage/styles.ts 100.00% <ø> (ø)
...Messaging/components/ModalMessage/ModalMessage.tsx 100.00% <100.00%> (+100.00%) ⬆️
...c/InAppMessaging/components/ModalMessage/styles.ts 100.00% <100.00%> (ø)
...essaging/components/hooks/useMessageProps/utils.ts 98.21% <100.00%> (+0.06%) ⬆️
...vue/src/components/authenticator/ConfirmSignIn.vue 100.00% <0.00%> (+6.25%) ⬆️
...aws-amplify-vue/src/components/storage/S3Image.vue 100.00% <0.00%> (+7.14%) ⬆️
...vue/src/components/authenticator/ConfirmSignUp.vue 100.00% <0.00%> (+9.52%) ⬆️
...fy-vue/src/components/authenticator/PhoneField.vue 100.00% <0.00%> (+11.11%) ⬆️
...vue/src/components/authenticator/Authenticator.vue 100.00% <0.00%> (+12.50%) ⬆️
...plify-vue/src/components/authenticator/SignOut.vue 100.00% <0.00%> (+21.42%) ⬆️
... and 11 more

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@Samaritan1011001 Samaritan1011001 marked this pull request as ready for review March 18, 2022 19:51
Copy link
Contributor

@calebpollman calebpollman left a comment

Choose a reason for hiding this comment

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

Left mostly styling related comments. Thanks for addressing the feedback!

imageContainer: {
flex: 1,
alignItems: 'center',
marginVertical: SPACING_LARGE,
Copy link
Contributor

Choose a reason for hiding this comment

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

Wonder if we should remove this property so the top of the close button and the top of the image line up. Also, why do we need a flex property here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, removed marginVertical
Flex is needed to center the image while keeping the x mark at the end of the row.

@Samaritan1011001
Copy link
Contributor Author

Hey @calebpollman, made the changes we discussed and the image is centered within the red box as shown below for reference. Let me know if that's what we had in mind.

Screen Shot 2022-03-31 at 2 09 04 PM

Copy link
Contributor

@calebpollman calebpollman left a comment

Choose a reason for hiding this comment

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

Thanks for working through all the styling issues @Samaritan1011001 🚢

Samaritan1011001 and others added 2 commits May 9, 2022 16:19
Co-authored-by: Caleb Pollman <cpollman1@gmail.com>
Copy link
Contributor

@cshfang cshfang left a comment

Choose a reason for hiding this comment

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

Lgtm thanks!

@Samaritan1011001 Samaritan1011001 merged commit 7caa08c into aws-amplify:in-app-messaging/staging May 10, 2022
@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 amplify-help forum.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 2023
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.

None yet

4 participants