Compare commits

...

4 Commits

Author SHA1 Message Date
Diogo d91d9f8c15 initial screen 2024-10-18 14:35:59 +01:00
Diogo caa4cd74b3 not use toolbar 2024-10-18 11:42:54 +01:00
Diogo 140609317a how it works to top bar 2024-10-18 11:34:54 +01:00
Diogo da71ecdc28 how it works 2024-10-18 11:25:22 +01:00
2 changed files with 64 additions and 66 deletions
@@ -13,38 +13,33 @@ struct HowItWorks: View {
var onboarding: Bool
var body: some View {
VStack(alignment: .leading) {
List {
Text("How SimpleX works")
.font(.largeTitle)
.bold()
.fixedSize(horizontal: false, vertical: true)
.padding(.vertical)
ScrollView {
VStack(alignment: .leading) {
Group {
Text("Many people asked: *if SimpleX has no user identifiers, how can it deliver messages?*")
Text("To protect privacy, instead of user IDs used by all other platforms, SimpleX has identifiers for message queues, separate for each of your contacts.")
Text("You control through which server(s) **to receive** the messages, your contacts the servers you use to message them.")
Text("Only client devices store user profiles, contacts, groups, and messages sent with **2-layer end-to-end encryption**.")
if onboarding {
Text("Read more in our GitHub repository.")
} else {
Text("Read more in our [GitHub repository](https://github.com/simplex-chat/simplex-chat#readme).")
}
}
.padding(.bottom)
.listRowBackground(Color.clear)
.listRowSeparator(.hidden)
.listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0))
VStack(alignment: .leading, spacing: 18) {
Text("Many people asked: *if SimpleX has no user identifiers, how can it deliver messages?*")
Text("To protect privacy, instead of user IDs used by all other platforms, SimpleX has identifiers for message queues, separate for each of your contacts.")
Text("You control through which server(s) **to receive** the messages, your contacts the servers you use to message them.")
Text("Only client devices store user profiles, contacts, groups, and messages sent with **2-layer end-to-end encryption**.")
if onboarding {
Text("Read more in our GitHub repository.")
} else {
Text("Read more in our [GitHub repository](https://github.com/simplex-chat/simplex-chat#readme).")
}
}
Spacer()
if onboarding {
OnboardingActionButton()
.padding(.bottom, 8)
}
.listRowBackground(Color.clear)
.listRowInsets(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 0))
.frame(maxWidth: .infinity, alignment: .leading)
}
.lineLimit(10)
.padding()
.frame(maxHeight: .infinity, alignment: .top)
.modifier(ThemedBackground())
.modifier(ThemedBackground(grouped: true))
}
}
@@ -12,61 +12,59 @@ import SimpleXChat
struct SimpleXInfo: View {
@EnvironmentObject var m: ChatModel
@Environment(\.colorScheme) var colorScheme: ColorScheme
@State private var showHowItWorks = false
var onboarding: Bool
var body: some View {
GeometryReader { g in
ScrollView {
HStack {
Spacer()
InfoSheetButton {
HowItWorks(onboarding: onboarding)
}
}
.padding(.bottom, 40)
VStack(alignment: .leading) {
Image(colorScheme == .light ? "logo" : "logo-light")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: g.size.width * 0.67)
.padding(.bottom, 8)
.padding(.bottom, 40)
.frame(maxWidth: .infinity, minHeight: 48, alignment: .top)
VStack(alignment: .leading) {
Text("The next generation of private messaging")
.font(.title2)
.font(.title3)
.padding(.bottom, 30)
.padding(.horizontal, 40)
.frame(maxWidth: .infinity)
.multilineTextAlignment(.center)
infoRow("privacy", "Privacy redefined",
"The 1st platform without any user identifiers private by design.", width: 48)
infoRow("shield", "Immune to spam and abuse",
"People can connect to you only via the links you share.", width: 46)
infoRow(colorScheme == .light ? "decentralized" : "decentralized-light", "Decentralized",
"Open-source protocol and code anybody can run the servers.", width: 44)
}
Spacer()
if onboarding {
OnboardingActionButton()
Spacer()
Button {
m.migrationState = .pasteOrScanLink
} label: {
Label("Migrate from another device", systemImage: "tray.and.arrow.down")
.font(.subheadline)
VStack(alignment: .leading) {
infoRow("privacy", "Privacy redefined",
"No user identifiers.", width: 48)
infoRow("shield", "Immune to spam",
"You decide who can connect.", width: 46)
infoRow(colorScheme == .light ? "decentralized" : "decentralized-light", "Decentralized",
"Anybody can host servers.", width: 44)
}
.padding(.bottom, 8)
.frame(maxWidth: .infinity)
}
Button {
showHowItWorks = true
} label: {
Label("How it works", systemImage: "info.circle")
.font(.subheadline)
if onboarding {
VStack {
OnboardingActionButton()
Button {
m.migrationState = .pasteOrScanLink
} label: {
Label("Migrate from another device", systemImage: "tray.and.arrow.down")
.font(.subheadline)
}
.frame(maxWidth: .infinity)
}
.padding(.top, 40)
}
.padding(.bottom, 8)
.frame(maxWidth: .infinity)
}
.frame(minHeight: g.size.height)
//.frame(minHeight: g.size.height)
}
.sheet(isPresented: Binding(
get: { m.migrationState != nil },
@@ -82,9 +80,6 @@ struct SimpleXInfo: View {
.modifier(ThemedBackground(grouped: true))
}
}
.sheet(isPresented: $showHowItWorks) {
HowItWorks(onboarding: onboarding)
}
}
.frame(maxHeight: .infinity)
.padding()
@@ -97,13 +92,14 @@ struct SimpleXInfo: View {
.scaledToFit()
.frame(width: width, height: 54)
.frame(width: 54)
.padding(.top, 4)
.padding(.leading, 4)
.padding(.trailing, 10)
VStack(alignment: .leading, spacing: 4) {
//.padding(.top, 4)
//.padding(.leading, 50)
.padding(.trailing, 4)
VStack(alignment: .leading, spacing: 8) {
Text(title).font(.headline)
Text(text).frame(minHeight: 40, alignment: .top)
Text(text).font(.subheadline).frame(alignment: .top)
}
.padding(4)
}
.padding(.bottom, 20)
.padding(.trailing, 6)
@@ -113,6 +109,7 @@ struct SimpleXInfo: View {
struct OnboardingActionButton: View {
@EnvironmentObject var m: ChatModel
@Environment(\.colorScheme) var colorScheme
@EnvironmentObject var theme: AppTheme
var body: some View {
if m.currentUser == nil {
@@ -130,12 +127,18 @@ struct OnboardingActionButton: View {
}
} label: {
HStack {
Text(label).font(.title2)
Image(systemName: "greaterthan")
Text(label)
.font(.headline)
.foregroundColor(theme.colors.background)
.padding(.vertical, 20)
.padding(.horizontal, 80)
}
}
.background(theme.colors.primary)
.clipShape(RoundedRectangle(cornerRadius: 50))
.frame(maxWidth: .infinity)
.padding(.bottom)
.padding(.bottom, 20)
.padding(.horizontal)
}
private func actionButton(_ label: LocalizedStringKey, action: @escaping () -> Void) -> some View {