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

UI4: Modal Post-Migration Fixes #4718

Merged
merged 14 commits into from
Jan 18, 2024
Merged

UI4: Modal Post-Migration Fixes #4718

merged 14 commits into from
Jan 18, 2024

Conversation

Jon-edge
Copy link
Collaborator

@Jon-edge Jon-edge commented Jan 16, 2024

iOS (left) and small screen Android (right):

We need a redesign for FlipInput. Empty title whitespace, but moving the inner card up would make weird margins with the close button if it were on the top corner of the card
Screenshot 2024-01-17 at 5 38 08 PM

Screenshot 2024-01-17 at 5 40 12 PM image image image image image image image

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

@Jon-edge Jon-edge force-pushed the jon/ui4/fix/modals branch 8 times, most recently from 0ce9fad to b7f0224 Compare January 17, 2024 23:37
src/components/ui4/ModalUi4.tsx Outdated Show resolved Hide resolved
src/components/themed/ModalParts.tsx Outdated Show resolved Hide resolved
justifyContent: 'space-between',
alignSelf: 'center', // Shrink view around buttons
alignItems: 'stretch', // Stretch our children out
flexDirection: 'column'
Copy link
Contributor

Choose a reason for hiding this comment

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

Not needed, since the "column" direction is already the default.


return <MainButton key={key} label={label} marginRem={0.5} type={type} onPress={handlePress} />
})}
return <MainButton key={key} label={label} marginRem={0.25} type={type} onPress={handlePress} layout="column" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use ButtonUi4 directly, and avoid having to hack MainButton?

Copy link
Collaborator Author

@Jon-edge Jon-edge Jan 18, 2024

Choose a reason for hiding this comment

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

I wanted to avoid the rename of escape to tertiary, but you're right that's probably better since we barely use that button type in this modal.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, we can do it later then.

src/components/modals/PasswordReminderModal.tsx Outdated Show resolved Hide resolved
</View>
<ModalUi4
bridge={bridge}
warning={warning}
Copy link
Collaborator Author

@Jon-edge Jon-edge Jan 18, 2024

Choose a reason for hiding this comment

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

I was unable to get the corner of the yellow border to round on iOS...

{
// Hack around the Android keyboard glitch:
Platform.OS === 'android' ? <View style={{ flex: 1 }} /> : null
}
<ButtonsViewUi4
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hack not needed. Keyboard is fine on Android on a small screen

<ModalMessage>{lstrings.password_reminder_enter_password_below}</ModalMessage>
</ScrollView>
<ModalUi4 bridge={bridge} title={lstrings.password_reminder_remember_your_password} onCancel={this.handleCancel}>
<ModalMessage>{lstrings.password_reminder_you_will_need_your_password}</ModalMessage>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No need for a scrollview here, looks fine on a small Android.

Copy link
Collaborator Author

@Jon-edge Jon-edge left a comment

Choose a reason for hiding this comment

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

Added some comments in this PR

Copy link
Contributor

@swansontec swansontec left a comment

Choose a reason for hiding this comment

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

Some small stuff we can hit post-staging if needed, but let's get this in.

@@ -220,59 +220,60 @@ export function WalletListModal(props: Props) {
// #endregion Renderers

return (
<ThemedModal bridge={bridge} onCancel={handleCancel}>
<ModalTitle center>{headerTitle}</ModalTitle>
<ModalUi4
Copy link
Contributor

Choose a reason for hiding this comment

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

We might need to port the WalletList to use a FlatList from react-native-gesture-handler. When I tried this last week the list was not scrollable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's scrollable right now. The trick was to let the modal deal with the scroll directly.

@@ -72,7 +72,7 @@ export function ListModal<T>({
return (
<ModalUi4 title={title} bridge={bridge} onCancel={handleCancel}>
{message == null ? null : <ModalMessage>{message}</ModalMessage>}
{textInput == null ? null : (
{textInput == null || !textInput ? null : (
Copy link
Contributor

Choose a reason for hiding this comment

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

Since textInput has a default value up above, it will never be null. You can simply remove the == null check.

@Jon-edge Jon-edge force-pushed the jon/ui4/fix/modals branch 4 times, most recently from 5df29c8 to bcd561b Compare January 18, 2024 19:13
- Fix blur positioning for fullscreen modals
- Remove extra view for rounding BlurView bounds
- Remove extra view around non-scrolling children. This allows `flex: 1` children without a modal-wide scroll to work as they did before.
- Move title handling into the modal itself.
This is an interim quick fix before we just fully remove dependencies on ModalParts.
There's no need to retain anything from ModalParts anymore once fully migrated to UI4 - they weren't really doing anything special to begin with.
Quick hack fix to kind of obtain the result of ButtonsViewUi4 with consistent button widths.
An additional audit will need to be performed to determine which buttons should be primary/secondary/tertiary before we can migrate them to ButtonsViewUi4 and enforce our rule of not having multiple buttons of the same type in a column layout.
Some modals have inconsistent centered titles and this change unifies them all.
Making this change will allow us to easily center all titles later if that's what we prefer.
Needs a redesign. We have a bunch of empty title space here, and at the same time we can't push the FlipInput card all the way up there because then the X button would have weird alignment over the inner FlipInput card
@Jon-edge Jon-edge merged commit 93c0faf into develop Jan 18, 2024
2 checks passed
@Jon-edge Jon-edge deleted the jon/ui4/fix/modals branch January 18, 2024 19:56
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