diff --git a/Sources/GravatarUI/Resources/Media.xcassets/square.and.arrow.top.right.symbolset/Contents.json b/Sources/GravatarUI/Resources/Media.xcassets/square.and.arrow.top.right.symbolset/Contents.json
new file mode 100644
index 00000000..083f7efb
--- /dev/null
+++ b/Sources/GravatarUI/Resources/Media.xcassets/square.and.arrow.top.right.symbolset/Contents.json
@@ -0,0 +1,16 @@
+{
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ },
+ "properties" : {
+ "localizable" : true
+ },
+ "symbols" : [
+ {
+ "filename" : "square.and.arrow.top.right.svg",
+ "idiom" : "universal",
+ "language-direction" : "left-to-right"
+ }
+ ]
+}
diff --git a/Sources/GravatarUI/Resources/Media.xcassets/square.and.arrow.top.right.symbolset/square.and.arrow.top.right.svg b/Sources/GravatarUI/Resources/Media.xcassets/square.and.arrow.top.right.symbolset/square.and.arrow.top.right.svg
new file mode 100644
index 00000000..bce0dcfd
--- /dev/null
+++ b/Sources/GravatarUI/Resources/Media.xcassets/square.and.arrow.top.right.symbolset/square.and.arrow.top.right.svg
@@ -0,0 +1,151 @@
+
+
\ No newline at end of file
diff --git a/Sources/GravatarUI/Resources/ar.lproj/Localizable.strings b/Sources/GravatarUI/Resources/ar.lproj/Localizable.strings
index 3d321021..e4e48a95 100644
--- a/Sources/GravatarUI/Resources/ar.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/ar.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "عرض الملف الشخصي ←";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "عرض الملف الشخصي";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "اسمك";
diff --git a/Sources/GravatarUI/Resources/de.lproj/Localizable.strings b/Sources/GravatarUI/Resources/de.lproj/Localizable.strings
index 6550f1fa..1914b1eb 100644
--- a/Sources/GravatarUI/Resources/de.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/de.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "Profil anzeigen →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "Profil anzeigen";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "Dein Name";
diff --git a/Sources/GravatarUI/Resources/en.lproj/Localizable.strings b/Sources/GravatarUI/Resources/en.lproj/Localizable.strings
index 604e974d..d85674c1 100644
--- a/Sources/GravatarUI/Resources/en.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/en.lproj/Localizable.strings
@@ -124,6 +124,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "View profile →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "View profile";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "Your Name";
diff --git a/Sources/GravatarUI/Resources/es.lproj/Localizable.strings b/Sources/GravatarUI/Resources/es.lproj/Localizable.strings
index 337fea42..38bf99e0 100644
--- a/Sources/GravatarUI/Resources/es.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/es.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "Ver perfil →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "Ver perfil";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "Tu nombre";
diff --git a/Sources/GravatarUI/Resources/fr.lproj/Localizable.strings b/Sources/GravatarUI/Resources/fr.lproj/Localizable.strings
index 2bb91b56..b2478cee 100644
--- a/Sources/GravatarUI/Resources/fr.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/fr.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "Afficher le profil →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "Afficher le profil";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "Votre Nom";
diff --git a/Sources/GravatarUI/Resources/he.lproj/Localizable.strings b/Sources/GravatarUI/Resources/he.lproj/Localizable.strings
index ab4279f4..5947af64 100644
--- a/Sources/GravatarUI/Resources/he.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/he.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "להצגת הפרופיל ←";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "להצגת הפרופיל";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "השם שלך";
diff --git a/Sources/GravatarUI/Resources/id.lproj/Localizable.strings b/Sources/GravatarUI/Resources/id.lproj/Localizable.strings
index 058099f2..a0131be5 100644
--- a/Sources/GravatarUI/Resources/id.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/id.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "Lihat profil →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "Lihat profil";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "Nama Anda";
diff --git a/Sources/GravatarUI/Resources/it.lproj/Localizable.strings b/Sources/GravatarUI/Resources/it.lproj/Localizable.strings
index e89c74ca..e7ff10c4 100644
--- a/Sources/GravatarUI/Resources/it.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/it.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "Visualizza profilo →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "Visualizza profilo";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "Il tuo nome";
diff --git a/Sources/GravatarUI/Resources/ja.lproj/Localizable.strings b/Sources/GravatarUI/Resources/ja.lproj/Localizable.strings
index b587fd38..9c8fbed4 100644
--- a/Sources/GravatarUI/Resources/ja.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/ja.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "プロフィールを表示→";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "プロフィールを表示";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "あなたの名前";
diff --git a/Sources/GravatarUI/Resources/ko.lproj/Localizable.strings b/Sources/GravatarUI/Resources/ko.lproj/Localizable.strings
index 3f92797f..eb38904f 100644
--- a/Sources/GravatarUI/Resources/ko.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/ko.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "프로필 보기 →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "프로필 보기";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "이름";
diff --git a/Sources/GravatarUI/Resources/nl.lproj/Localizable.strings b/Sources/GravatarUI/Resources/nl.lproj/Localizable.strings
index 2cc67b2d..7283a5b5 100644
--- a/Sources/GravatarUI/Resources/nl.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/nl.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "Profiel bekijken →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "Profiel bekijken";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "Je naam";
diff --git a/Sources/GravatarUI/Resources/pt-BR.lproj/Localizable.strings b/Sources/GravatarUI/Resources/pt-BR.lproj/Localizable.strings
index 23df777e..e59dca2e 100644
--- a/Sources/GravatarUI/Resources/pt-BR.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/pt-BR.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "Visualizar perfil →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "Visualizar perfil";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "Seu nome";
diff --git a/Sources/GravatarUI/Resources/ru.lproj/Localizable.strings b/Sources/GravatarUI/Resources/ru.lproj/Localizable.strings
index fd9e283d..62e3f9e7 100644
--- a/Sources/GravatarUI/Resources/ru.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/ru.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "Просмотреть профиль →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "Просмотреть профиль";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "Ваше имя";
diff --git a/Sources/GravatarUI/Resources/sv.lproj/Localizable.strings b/Sources/GravatarUI/Resources/sv.lproj/Localizable.strings
index b2d7d8d0..ac2a2fe7 100644
--- a/Sources/GravatarUI/Resources/sv.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/sv.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "Visa profil →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "Visa profil";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "Ditt namn";
diff --git a/Sources/GravatarUI/Resources/tr.lproj/Localizable.strings b/Sources/GravatarUI/Resources/tr.lproj/Localizable.strings
index 3078def7..66899960 100644
--- a/Sources/GravatarUI/Resources/tr.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/tr.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "Profili görüntüle →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "Profili görüntüle";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "İsminiz";
diff --git a/Sources/GravatarUI/Resources/zh-Hans.lproj/Localizable.strings b/Sources/GravatarUI/Resources/zh-Hans.lproj/Localizable.strings
index 5fea6fc3..c975e7d1 100644
--- a/Sources/GravatarUI/Resources/zh-Hans.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/zh-Hans.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "查看个人资料 →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "查看个人资料";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "您的姓名";
diff --git a/Sources/GravatarUI/Resources/zh-Hant.lproj/Localizable.strings b/Sources/GravatarUI/Resources/zh-Hant.lproj/Localizable.strings
index 30b48ff6..b27379e9 100644
--- a/Sources/GravatarUI/Resources/zh-Hant.lproj/Localizable.strings
+++ b/Sources/GravatarUI/Resources/zh-Hant.lproj/Localizable.strings
@@ -129,6 +129,9 @@
/* Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view */
"AvatarPickerProfile.Button.ViewProfile.title" = "檢視個人檔案 →";
+/* Title of a button that will take you to your Gravatar profile */
+"Profile.Button.ViewProfile.title" = "檢視個人檔案";
+
/* Placeholder text for the name field */
"AvatarPickerProfile.Name.placeholder" = "你的姓名";
diff --git a/Sources/GravatarUI/SwiftUI/AvatarPicker/AvatarPickerProfileView.swift b/Sources/GravatarUI/SwiftUI/AvatarPicker/AvatarPickerProfileView.swift
index 05cbb23d..a078ebc3 100644
--- a/Sources/GravatarUI/SwiftUI/AvatarPicker/AvatarPickerProfileView.swift
+++ b/Sources/GravatarUI/SwiftUI/AvatarPicker/AvatarPickerProfileView.swift
@@ -61,8 +61,13 @@ struct AvatarPickerProfileView: View where AccessoryView: View {
if let details = model.profileDetails {
secondaryText(text: details)
}
- Button(Localized.viewProfileButtonTitle) {
+ Button {
viewProfileAction?()
+ } label: {
+ HStack(spacing: .DS.Padding.half) {
+ Text(Localized.viewProfileButtonTitle)
+ Image("square.and.arrow.top.right", bundle: .module)
+ }
}
.font(.footnote)
.foregroundColor(Color(UIColor.label))
@@ -155,9 +160,9 @@ private enum Constants {
private enum Localized {
static let viewProfileButtonTitle = SDKLocalizedString(
- "AvatarPickerProfile.Button.ViewProfile.title",
- value: "View profile →",
- comment: "Title of a button that will take you to your Gravatar profile, with an arrow indicating that this action will cause you to leave this view"
+ "Profile.Button.ViewProfile.title",
+ value: "View profile",
+ comment: "Title of a button that will take you to your Gravatar profile"
)
static let namePlaceholder = SDKLocalizedString(
"AvatarPickerProfile.Name.placeholder",
diff --git a/Sources/GravatarUI/SwiftUI/ProfileEditor/QuickEditor.swift b/Sources/GravatarUI/SwiftUI/ProfileEditor/QuickEditor.swift
index b7a6b2ec..e6d181a5 100644
--- a/Sources/GravatarUI/SwiftUI/ProfileEditor/QuickEditor.swift
+++ b/Sources/GravatarUI/SwiftUI/ProfileEditor/QuickEditor.swift
@@ -29,6 +29,7 @@ struct QuickEditor: View {
@Environment(\.oauthSession) private var oauthSession
@Environment(\.colorScheme) var colorScheme: ColorScheme
@Environment(\.verticalSizeClass) var vertcalSizeClass
+ @Environment(\.dynamicTypeSize) var dynamicTypeSize
@AppStorage("QuickEditor.startOAuthOnAppear") private var startOAuthOnAppear: Bool = false
@State private var fetchedToken: String?
@@ -230,15 +231,22 @@ struct QuickEditor: View {
let screenHeight = UIScreen.main.bounds.height
let iPhoneSE3rdGenScreenHeight: CGFloat = 667
- return (vertcalSizeClass == .compact || screenHeight <= iPhoneSE3rdGenScreenHeight) && model.isKeyboardPresented
+ return model.isKeyboardPresented && (
+ vertcalSizeClass == .compact ||
+ screenHeight <= iPhoneSE3rdGenScreenHeight ||
+ dynamicTypeSize >= .accessibility3
+ )
}
@ViewBuilder
func profileCardHeaderView() -> some View {
if !shouldHideProfileCardHeader {
- EmailText(email: model.email)
- .accumulateIntrinsicHeight()
+ if fetchedToken != nil {
+ EmailText(email: model.email)
+ .accumulateIntrinsicHeight()
+ }
profileView()
+ .dynamicTypeSize(...DynamicTypeSize.xxxLarge)
.accumulateIntrinsicHeight()
} else {
EmptyView()
diff --git a/Sources/GravatarUI/SwiftUI/QEDetent.swift b/Sources/GravatarUI/SwiftUI/QEDetent.swift
index 9e4d789c..cfef8dd7 100644
--- a/Sources/GravatarUI/SwiftUI/QEDetent.swift
+++ b/Sources/GravatarUI/SwiftUI/QEDetent.swift
@@ -54,11 +54,7 @@ enum QEDetent {
case .avatarPicker:
.init([.height(intrinsicHeight)])
case .aboutEditor:
- if intrinsicHeight >= QEModalPresentationConstants.bottomSheetEstimatedHeight {
- .init([.height(QEModalPresentationConstants.bottomSheetEstimatedHeight), .large])
- } else {
- .init([.height(intrinsicHeight)])
- }
+ .init([.height(intrinsicHeight)])
}
}
case .vertical(let presentationStyle):
diff --git a/Tests/GravatarUITests/AboutEditorViewTests.swift b/Tests/GravatarUITests/AboutEditorViewTests.swift
index d112d11b..58a0d0fc 100644
--- a/Tests/GravatarUITests/AboutEditorViewTests.swift
+++ b/Tests/GravatarUITests/AboutEditorViewTests.swift
@@ -181,7 +181,7 @@ struct AboutEditorViewTests {
await testModel.fetchProfile()
}
// Awaits for the previous task to start executing, and the view to start loading.
- try await Task.sleep(nanoseconds: 10)
+ try await Task.sleep(nanoseconds: 20)
assertSnapshots(
of: view,
as: [
diff --git a/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileView.1.png b/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileView.1.png
index 9d7c74a2..1721f9e3 100644
Binary files a/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileView.1.png and b/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileView.1.png differ
diff --git a/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileView.2.png b/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileView.2.png
index f1ea6f8a..890d8712 100644
Binary files a/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileView.2.png and b/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileView.2.png differ
diff --git a/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileViewWithoutLocation.1.png b/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileViewWithoutLocation.1.png
index 4616b4d7..f6f71137 100644
Binary files a/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileViewWithoutLocation.1.png and b/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileViewWithoutLocation.1.png differ
diff --git a/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileViewWithoutLocation.2.png b/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileViewWithoutLocation.2.png
index fdf2db59..c024ef95 100644
Binary files a/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileViewWithoutLocation.2.png and b/Tests/GravatarUITests/__Snapshots__/AvatarPickerProfileViewTests/testAvatarPickerProfileViewWithoutLocation.2.png differ