minor update on buttons and QR code to look better on iPad

pull/891/head
Ryan ZHAO 1 year ago
parent 5aaf02180a
commit ebf36c6251

@ -12,7 +12,6 @@ struct InviteAFriendScreen: View {
private let accountId: String = getUserHexEncodedPublicKey()
static private let cornerRadius: CGFloat = 13
static private let buttonWidth: CGFloat = 160
var body: some View {
ZStack(alignment: .center) {
@ -58,7 +57,7 @@ struct InviteAFriendScreen: View {
.font(.system(size: Values.mediumFontSize))
.foregroundColor(themeColor: .textPrimary)
.frame(
maxWidth: Self.buttonWidth,
maxWidth: .infinity,
minHeight: Values.mediumButtonHeight,
alignment: .center
)
@ -80,7 +79,7 @@ struct InviteAFriendScreen: View {
.font(.system(size: Values.mediumFontSize))
.foregroundColor(themeColor: .textPrimary)
.frame(
maxWidth: Self.buttonWidth,
maxWidth: .infinity,
minHeight: Values.mediumButtonHeight,
alignment: .center
)

@ -14,7 +14,7 @@ struct RecoveryPasswordScreen: View {
static private let cornerRadius: CGFloat = 13
static private let backgroundCornerRadius: CGFloat = 17
static private let buttonWidth: CGFloat = 130
static private let buttonWidth: CGFloat = UIDevice.current.isIPad ? Values.iPadButtonWidth : 130
public init() throws {
self.mnemonic = try Identity.mnemonic()
@ -136,7 +136,7 @@ struct RecoveryPasswordScreen: View {
.font(.system(size: Values.verySmallFontSize))
.foregroundColor(themeColor: .textPrimary)
.frame(
maxWidth: Self.buttonWidth,
maxWidth: .infinity,
minHeight: Values.mediumSmallButtonHeight,
alignment: .center
)
@ -157,7 +157,7 @@ struct RecoveryPasswordScreen: View {
.font(.system(size: Values.verySmallFontSize))
.foregroundColor(themeColor: .textPrimary)
.frame(
maxWidth: Self.buttonWidth,
maxWidth: .infinity,
minHeight: Values.mediumSmallButtonHeight,
alignment: .center
)

@ -73,41 +73,48 @@ struct QRCodeView: View {
var body: some View {
ZStack(alignment: .center) {
RoundedRectangle(cornerRadius: Self.cornerRadius)
.fill(themeColor: backgroundThemeColor)
Image(uiImage: QRCode.generate(for: string, hasBackground: hasBackground))
.resizable()
.renderingMode(.template)
.foregroundColor(themeColor: qrCodeThemeColor)
.scaledToFit()
.frame(
maxWidth: .infinity,
maxHeight: .infinity
)
.padding(.vertical, Values.smallSpacing)
if let logo = logo {
ZStack(alignment: .center) {
Rectangle()
.fill(themeColor: backgroundThemeColor)
Image(logo)
.resizable()
.renderingMode(.template)
.foregroundColor(themeColor: qrCodeThemeColor)
.scaledToFit()
.frame(
maxWidth: .infinity,
maxHeight: .infinity
)
.padding(.all, 4)
ZStack(alignment: .center) {
RoundedRectangle(cornerRadius: Self.cornerRadius)
.fill(themeColor: backgroundThemeColor)
Image(uiImage: QRCode.generate(for: string, hasBackground: hasBackground))
.resizable()
.renderingMode(.template)
.foregroundColor(themeColor: qrCodeThemeColor)
.scaledToFit()
.frame(
maxWidth: .infinity,
maxHeight: .infinity
)
.padding(.vertical, Values.smallSpacing)
if let logo = logo {
ZStack(alignment: .center) {
Rectangle()
.fill(themeColor: backgroundThemeColor)
Image(logo)
.resizable()
.renderingMode(.template)
.foregroundColor(themeColor: qrCodeThemeColor)
.scaledToFit()
.frame(
maxWidth: .infinity,
maxHeight: .infinity
)
.padding(.all, 4)
}
.frame(
width: Self.logoSize,
height: Self.logoSize
)
}
.frame(
width: Self.logoSize,
height: Self.logoSize
)
}
.frame(
maxWidth: 400,
maxHeight: 400
)
}
.frame(maxWidth: .infinity)
}
}

Loading…
Cancel
Save