Configured the Login module and moved all its files in it.

This commit is contained in:
Javier Cicchelli 2022-12-02 20:23:10 +01:00
parent 8b34dc54ad
commit 9ed753b2fe
5 changed files with 38 additions and 27 deletions

View File

@ -36,6 +36,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
02784F03293A8331005F839D /* Modules */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Modules; sourceTree = "<group>"; };
02AE64EB29363DBF005A4AF3 /* BeReal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BeReal.app; sourceTree = BUILT_PRODUCTS_DIR; };
02AE64EE29363DBF005A4AF3 /* BeRealApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeRealApp.swift; sourceTree = "<group>"; };
02AE64F029363DBF005A4AF3 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
@ -47,7 +48,6 @@
02AE650929363DC1005A4AF3 /* BeRealUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeRealUITests.swift; sourceTree = "<group>"; };
02AE650B29363DC1005A4AF3 /* BeRealUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeRealUITestsLaunchTests.swift; sourceTree = "<group>"; };
02FFFD7A29395DD200306533 /* String+Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Constants.swift"; sourceTree = "<group>"; };
4694AA9D293A7B8B00D54903 /* Modules */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = Modules; path = ../../../../../../Users/logansama/Desktop/Modules; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -79,23 +79,14 @@
027F60592937662300467238 /* Login */ = {
isa = PBXGroup;
children = (
02FFFD7629395D7F00306533 /* Components */,
027F605C29376EEB00467238 /* Views */,
);
path = Login;
sourceTree = "<group>";
};
027F605C29376EEB00467238 /* Views */ = {
isa = PBXGroup;
children = (
);
path = Views;
sourceTree = "<group>";
};
02AE64E229363DBF005A4AF3 = {
isa = PBXGroup;
children = (
4694AA9D293A7B8B00D54903 /* Modules */,
02784F03293A8331005F839D /* Modules */,
02AE64ED29363DBF005A4AF3 /* BeReal */,
02AE64FE29363DC1005A4AF3 /* BeRealTests */,
02AE650829363DC1005A4AF3 /* BeRealUITests */,
@ -152,13 +143,6 @@
path = BeRealUITests;
sourceTree = "<group>";
};
02FFFD7629395D7F00306533 /* Components */ = {
isa = PBXGroup;
children = (
);
path = Components;
sourceTree = "<group>";
};
02FFFD7929395DBF00306533 /* Extensions */ = {
isa = PBXGroup;
children = (

25
Modules/Package.swift Normal file
View File

@ -0,0 +1,25 @@
// swift-tools-version: 5.7
import PackageDescription
let package = Package(
name: "Modules",
defaultLocalization: "en",
platforms: [
.iOS(.v15)
],
products: [
.library(
name: "Modules",
targets: [
"Login"
]
),
],
targets: [
.target(
name: "Login",
resources: [.process("Resources")]
),
]
)

View File

@ -1,13 +1,11 @@
/*
Localizable.strings
BeReal
Login
Created by Javier Cicchelli on 02/12/2022.
Copyright © 2022 Röck+Cöde. All rights reserved.
*/
// Login view
"login.title.text" = "My files";
"login.text_field.username.placeholder" = "Username";
"login.text_field.password.placeholder" = "Password";

View File

@ -8,15 +8,19 @@
import SwiftUI
struct LoginView: View {
public struct LoginView: View {
// MARK: States
@State private var containerTopPadding: CGFloat = 0
// MARK: Initialisers
public init() {}
// MARK: Body
var body: some View {
public var body: some View {
ScrollView(
.vertical,
showsIndicators: false
@ -42,15 +46,15 @@ fileprivate extension LoginView {
// MARK: States
@State private var isAuthenticating: Bool = false
@State private var username: String = .empty
@State private var password: String = .empty
@State private var username: String = ""
@State private var password: String = ""
@State private var errorMessage: String?
// MARK: Body
var body: some View {
VStack(spacing: 32) {
Text("login.title.text")
Text("login.title.text", bundle: .module)
.font(.largeTitle)
.fontWeight(.bold)
.foregroundColor(.primary)
@ -67,7 +71,7 @@ fileprivate extension LoginView {
// TODO: login with the username and password.
} label: {
Label {
Text("login.button.log_in.text")
Text("login.button.log_in.text", bundle: .module)
.fontWeight(.semibold)
} icon: {
if isAuthenticating {