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

Fix voucher dialog margins #5152

Conversation

rablador
Copy link
Contributor

@rablador rablador commented Sep 13, 2023

Voucher submission dialog should use the same margins as other info dialogs.
See: https://mullvad.slack.com/archives/C052D9X882U/p1694419482421749


This change is Reviewable

@linear
Copy link

linear bot commented Sep 13, 2023

Copy link
Collaborator

@mojganii mojganii left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @rablador)


ios/MullvadVPN/UI appearance/UIMetrics.swift line 41 at r1 (raw file):

        static let cornerRadius = 8.0
        static let preferredContentSize = CGSize(width: 280, height: 260)
        static let contentLayoutMargins = NSDirectionalEdgeInsets(top: 16, leading: 16, bottom: 16, trailing: 16)

we have RedeemVoucherViewConfiguration for having diffrent properties for voucher view appearance in account flow or profile.please addd directionalLayoutMargins property into RedeemVoucherViewConfiguration and set different values for them from their coordinators:

**import** Foundation

**import** UIKit

**struct** RedeemVoucherViewConfiguration {

    **let** adjustViewWhenKeyboardAppears: Bool

    **let** directionalLayoutMargins : NSDirectionalEdgeInsets

}

then in CreateAccountVoucherCoordinator set UIMetrics.contentLayoutMargins and in
ProfileVoucherCoordinator set the custom alert margin

@pronebird pronebird added the iOS Issues related to iOS label Sep 14, 2023
@rablador rablador force-pushed the voucher-submission-dialog-should-use-the-same-margins-as-ios-308 branch from 738e9bb to c51a2a6 Compare September 18, 2023 13:51
@rablador rablador requested a review from pronebird September 18, 2023 13:52
Copy link
Contributor Author

@rablador rablador left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 5 files reviewed, 1 unresolved discussion (waiting on @mojganii)


ios/MullvadVPN/UI appearance/UIMetrics.swift line 41 at r1 (raw file):

Previously, mojganii wrote…

we have RedeemVoucherViewConfiguration for having diffrent properties for voucher view appearance in account flow or profile.please addd directionalLayoutMargins property into RedeemVoucherViewConfiguration and set different values for them from their coordinators:

**import** Foundation

**import** UIKit

**struct** RedeemVoucherViewConfiguration {

    **let** adjustViewWhenKeyboardAppears: Bool

    **let** directionalLayoutMargins : NSDirectionalEdgeInsets

}

then in CreateAccountVoucherCoordinator set UIMetrics.contentLayoutMargins and in
ProfileVoucherCoordinator set the custom alert margin

Done.

@rablador rablador force-pushed the voucher-submission-dialog-should-use-the-same-margins-as-ios-308 branch from c51a2a6 to 71d4e16 Compare September 19, 2023 12:43
@rablador rablador closed this Sep 20, 2023
@rablador rablador deleted the voucher-submission-dialog-should-use-the-same-margins-as-ios-308 branch September 20, 2023 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iOS Issues related to iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants