diff --git a/RiotSwiftUI/Modules/Common/InfoSheet/InfoView.swift b/RiotSwiftUI/Modules/Common/InfoSheet/InfoView.swift index 07bf98850..ae88ee61e 100644 --- a/RiotSwiftUI/Modules/Common/InfoSheet/InfoView.swift +++ b/RiotSwiftUI/Modules/Common/InfoSheet/InfoView.swift @@ -27,45 +27,46 @@ struct InfoView: View { private let description: String private let action: Action - init(title: String, descripion: String, action: Action) { + init(title: String, description: String, action: Action) { self.title = title - self.description = descripion + self.description = description self.action = action } var body: some View { - GeometryReader { proxy in - VStack(alignment: .leading, spacing: 24) { - VStack(alignment: .leading, spacing: 16) { - Text(title) - .font(theme.fonts.calloutSB) - .foregroundColor(theme.colors.primaryContent) - - Text(description) - .font(theme.fonts.footnote) - .foregroundColor(theme.colors.primaryContent) - } + VStack(alignment: .leading, spacing: 24) { + VStack(alignment: .leading, spacing: 16) { + Text(title) + .font(theme.fonts.calloutSB) + .foregroundColor(theme.colors.primaryContent) + .accessibilityIdentifier(title) - Button(action: action.action) { - Text(action.text) - .font(theme.fonts.bodySB) - .foregroundColor(theme.colors.background) - .frame(height: 48) - .frame(maxWidth: .infinity) - } - .background(theme.colors.accent) - .cornerRadius(8) + Text(description) + .font(theme.fonts.footnote) + .foregroundColor(theme.colors.primaryContent) + .accessibilityIdentifier(description) } - .padding(24) - .frame(maxWidth: .infinity, maxHeight: .infinity) + + Button(action: action.action) { + Text(action.text) + .font(theme.fonts.bodySB) + .foregroundColor(theme.colors.background) + .frame(height: 48) + .frame(maxWidth: .infinity) + .accessibilityIdentifier(action.text) + } + .background(theme.colors.accent) + .cornerRadius(8) } + .padding(24) + .frame(maxWidth: .infinity, maxHeight: .infinity) } } struct InfoView_Previews: PreviewProvider { static var previews: some View { InfoView(title: "Verified sessions", - descripion: "Verified sessions have logged in with your credentials and then been verified, either using your secure passphrase or by cross-verifying.\n\nThis means they hold encryption keys for your previous messages, and confirm to other users you are communicating with that these sessions are really you.", + description: "Verified sessions have logged in with your credentials and then been verified, either using your secure passphrase or by cross-verifying.\n\nThis means they hold encryption keys for your previous messages, and confirm to other users you are communicating with that these sessions are really you.", action: .init(text: "GOT IT", action: {})) } } diff --git a/RiotSwiftUI/Modules/UserSessions/UserOtherSessions/View/UserOtherSessions.swift b/RiotSwiftUI/Modules/UserSessions/UserOtherSessions/View/UserOtherSessions.swift index 4814b5b0a..2784d191e 100644 --- a/RiotSwiftUI/Modules/UserSessions/UserOtherSessions/View/UserOtherSessions.swift +++ b/RiotSwiftUI/Modules/UserSessions/UserOtherSessions/View/UserOtherSessions.swift @@ -60,7 +60,7 @@ struct UserOtherSessions: View { .accentColor(theme.colors.accent) .bottomSheet(isPresented: $viewModel.showBottomSheet) { InfoView(title: viewModel.viewState.bottomSheetTitle, - descripion: viewModel.viewState.bottomSheetDescription, + description: viewModel.viewState.bottomSheetDescription, action: .init(text: VectorL10n.userSessionGotIt, action: { viewModel.showBottomSheet = false })) } } diff --git a/RiotSwiftUI/Modules/UserSessions/UserSessionName/View/UserSessionName.swift b/RiotSwiftUI/Modules/UserSessions/UserSessionName/View/UserSessionName.swift index 57356e6f7..6a9ad2715 100644 --- a/RiotSwiftUI/Modules/UserSessions/UserSessionName/View/UserSessionName.swift +++ b/RiotSwiftUI/Modules/UserSessions/UserSessionName/View/UserSessionName.swift @@ -32,7 +32,7 @@ struct UserSessionName: View { .accentColor(theme.colors.accent) .bottomSheet(isPresented: $viewModel.showBottomSheet) { InfoView(title: VectorL10n.userSessionRenameSessionTitle, - descripion: VectorL10n.userSessionRenameSessionDescription, + description: VectorL10n.userSessionRenameSessionDescription, action: .init(text: VectorL10n.userSessionGotIt, action: { viewModel.showBottomSheet = false })) } } diff --git a/RiotSwiftUI/Modules/UserSessions/UserSessionOverview/View/UserSessionOverview.swift b/RiotSwiftUI/Modules/UserSessions/UserSessionOverview/View/UserSessionOverview.swift index f43145c56..036d90a47 100644 --- a/RiotSwiftUI/Modules/UserSessions/UserSessionOverview/View/UserSessionOverview.swift +++ b/RiotSwiftUI/Modules/UserSessions/UserSessionOverview/View/UserSessionOverview.swift @@ -84,7 +84,7 @@ struct UserSessionOverview: View { .accentColor(theme.colors.accent) .bottomSheet(isPresented: $viewModel.showBottomSheet) { InfoView(title: viewModel.viewState.bottomSheetTitle, - descripion: viewModel.viewState.bottomSheetDescription, + description: viewModel.viewState.bottomSheetDescription, action: .init(text: VectorL10n.userSessionGotIt, action: { viewModel.showBottomSheet = false })) } }