mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Update the welcome screen with the latest designs. (#2067)
This commit is contained in:
parent
61af01e6fb
commit
b4ec04ec26
@ -76,6 +76,7 @@ struct AnalyticsPromptScreen: View {
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.frame(maxWidth: .infinity)
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(.compound.bgSubtleSecondary))
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
@ -34,10 +34,16 @@ enum ListPosition {
|
||||
}
|
||||
|
||||
struct RoundedLabelItem<Icon: View>: View {
|
||||
@Environment(\.backgroundStyle) private var backgroundStyle
|
||||
|
||||
let title: String
|
||||
let listPosition: ListPosition
|
||||
let iconContent: () -> Icon
|
||||
|
||||
private var backgroundColor: AnyShapeStyle {
|
||||
backgroundStyle ?? AnyShapeStyle(.compound.bgSubtleSecondary)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
Label { Text(title) } icon: {
|
||||
iconContent()
|
||||
@ -46,7 +52,7 @@ struct RoundedLabelItem<Icon: View>: View {
|
||||
.padding(.horizontal, 20)
|
||||
.padding(.vertical, 12)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.background(Color.compound.bgSubtleSecondary, in: RoundedCornerShape(radius: 16, corners: listPosition.roundedCorners))
|
||||
.background(backgroundColor, in: RoundedCornerShape(radius: 16, corners: listPosition.roundedCorners))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
|
||||
struct WelcomeScreen: View {
|
||||
@ScaledMetric var iconSize = 20
|
||||
@ObservedObject var context: WelcomeScreenScreenViewModel.Context
|
||||
|
||||
var body: some View {
|
||||
@ -32,57 +31,42 @@ struct WelcomeScreen: View {
|
||||
context.send(viewAction: .appeared)
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
||||
private var mainContent: some View {
|
||||
VStack(spacing: 42) {
|
||||
VStack(spacing: 80) {
|
||||
header
|
||||
list
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
||||
private var header: some View {
|
||||
VStack(spacing: 32) {
|
||||
OnboardingLogo(isOnGradient: true)
|
||||
.scaleEffect(x: 0.75, y: 0.75)
|
||||
.padding(.vertical, -20)
|
||||
|
||||
title
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var title: some View {
|
||||
VStack(spacing: 12) {
|
||||
Text(context.viewState.title)
|
||||
Text(L10n.screenWelcomeTitle(InfoPlistReader.main.bundleDisplayName))
|
||||
.font(Font.compound.headingLGBold)
|
||||
.foregroundColor(Color.compound.textPrimary)
|
||||
.multilineTextAlignment(.center)
|
||||
Text(context.viewState.subtitle)
|
||||
.font(Font.compound.bodyMD)
|
||||
.foregroundColor(Color.compound.textPrimary)
|
||||
.multilineTextAlignment(.center)
|
||||
}
|
||||
}
|
||||
|
||||
private var list: some View {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
RoundedLabelItem(title: context.viewState.bullet1, listPosition: .top) {
|
||||
Image(systemName: "exclamationmark.transmission")
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
}
|
||||
RoundedLabelItem(title: context.viewState.bullet2, listPosition: .middle) {
|
||||
RoundedLabelItem(title: L10n.screenWelcomeBullet2, listPosition: .top) {
|
||||
Image(systemName: "lock")
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
.foregroundColor(.compound.iconSecondaryAlpha)
|
||||
}
|
||||
RoundedLabelItem(title: context.viewState.bullet3, listPosition: .bottom) {
|
||||
Image(systemName: "plus.bubble")
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
RoundedLabelItem(title: L10n.screenWelcomeBullet3, listPosition: .bottom) {
|
||||
Image(systemName: "exclamationmark.bubble")
|
||||
.padding(.horizontal, -3)
|
||||
.foregroundColor(.compound.iconSecondaryAlpha)
|
||||
}
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.frame(maxWidth: .infinity)
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(.compound.bgCanvasDefaultLevel1))
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
@ -90,7 +74,7 @@ struct WelcomeScreen: View {
|
||||
Button {
|
||||
context.send(viewAction: .doneTapped)
|
||||
} label: {
|
||||
Text(context.viewState.buttonTitle)
|
||||
Text(L10n.screenWelcomeButton)
|
||||
}
|
||||
.buttonStyle(.compound(.primary))
|
||||
.accessibilityIdentifier(A11yIdentifiers.welcomeScreen.letsGo)
|
||||
|
@ -20,14 +20,7 @@ enum WelcomeScreenScreenViewModelAction {
|
||||
case dismiss
|
||||
}
|
||||
|
||||
struct WelcomeScreenScreenViewState: BindableState {
|
||||
let title = L10n.screenWelcomeTitle(InfoPlistReader.main.bundleDisplayName)
|
||||
let subtitle = L10n.screenWelcomeSubtitle
|
||||
let bullet1 = L10n.screenWelcomeBullet1
|
||||
let bullet2 = L10n.screenWelcomeBullet2
|
||||
let bullet3 = L10n.screenWelcomeBullet3
|
||||
let buttonTitle = L10n.screenWelcomeButton
|
||||
}
|
||||
struct WelcomeScreenScreenViewState: BindableState { }
|
||||
|
||||
enum WelcomeScreenScreenViewAction {
|
||||
case doneTapped
|
||||
|
BIN
UnitTests/__Snapshots__/PreviewTests/test_welcomeScreen.1.png
(Stored with Git LFS)
BIN
UnitTests/__Snapshots__/PreviewTests/test_welcomeScreen.1.png
(Stored with Git LFS)
Binary file not shown.
1
changelog.d/2053.change
Normal file
1
changelog.d/2053.change
Normal file
@ -0,0 +1 @@
|
||||
Update the Welcome Screen to the latest designs.
|
Loading…
x
Reference in New Issue
Block a user