-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Onboarding View (only UI) (#284)
* feat: Add Onboarding View (only UI) * Change names of files to WelcomeView and WelcomeViewAddVehicle Rather than WelcomeScreen and WelcomeScreenDetails. fix some indentation, and the project wasn't built with all the strings properly * Use LocalizedStringKey --------- Co-authored-by: Mikaela Caron <mikaelacaron@gmail.com>
- Loading branch information
1 parent
cb560d6
commit 6c40d55
Showing
5 changed files
with
281 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
Basic-Car-Maintenance/Shared/Onboarding/Views/WelcomeView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// | ||
// WelcomeView.swift | ||
// Basic-Car-Maintenance | ||
// | ||
// Created by Marcin Jędrzejak on 09/01/2024. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct WelcomeView: View { | ||
|
||
var body: some View { | ||
NavigationView { | ||
VStack(spacing: 15) { | ||
VStack { | ||
HStack(spacing: 5) { | ||
Text("Welcome to") | ||
Text("Basic") | ||
.foregroundStyle(Color("basicGreen")) | ||
} | ||
Text("Car Maintenance") | ||
.foregroundStyle(Color("basicGreen")) | ||
} | ||
.font(.largeTitle.bold()) | ||
.multilineTextAlignment(.center) | ||
.padding(.top, 65) | ||
.padding(.bottom, 35) | ||
.padding(15) | ||
|
||
VStack(alignment: .leading, spacing: 25) { | ||
pointView( | ||
symbol: "car", | ||
title: "Dashboard", | ||
subTitle: "User-friendly interface for controlling car maintenance tasks." | ||
) | ||
|
||
pointView( | ||
symbol: "gauge.with.dots.needle.bottom.50percent.badge.plus", | ||
title: "Odometer", | ||
subTitle: "Tracks & displays total mileage, aiding timely maintenance planning." | ||
) | ||
|
||
pointView( | ||
symbol: "lock.open", | ||
title: "Open Source", | ||
subTitle: "Built collaboratively with contributors, enhancing the app functionality." | ||
) | ||
} | ||
.frame(maxWidth: .infinity, alignment: .leading) | ||
.padding(.horizontal, 15) | ||
.padding(15) | ||
|
||
Spacer(minLength: 10) | ||
|
||
NavigationLink(destination: WelcomeViewAddVehicle()) { | ||
Text("Continue") | ||
.fontWeight(.bold) | ||
.foregroundStyle(.white) | ||
.frame(maxWidth: .infinity) | ||
.padding(.vertical, 14) | ||
.background(Color("basicGreen").gradient, in: .rect(cornerRadius: 12)) | ||
.contentShape(.rect) | ||
} | ||
.padding(15) | ||
.padding(.horizontal, 15) | ||
} | ||
.frame(maxWidth: .infinity, maxHeight: .infinity) | ||
.background { | ||
Color(UIColor.secondarySystemBackground) | ||
.ignoresSafeArea() | ||
} | ||
} | ||
} | ||
|
||
@ViewBuilder | ||
func pointView(symbol: String, title: LocalizedStringKey, subTitle: LocalizedStringKey) -> some View { | ||
HStack(spacing: 20) { | ||
Image(systemName: symbol) | ||
.font(.largeTitle) | ||
.foregroundStyle(Color("basicGreen")) | ||
.frame(width: 45) | ||
|
||
VStack(alignment: .leading, spacing: 6) { | ||
Text(title) | ||
.font(.title3) | ||
.fontWeight(.semibold) | ||
|
||
Text(subTitle) | ||
.foregroundStyle(.gray) | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
WelcomeView() | ||
} |
Oops, something went wrong.