Skip to content

Commit

Permalink
Merge pull request #35 from techstartucalgary/login-register
Browse files Browse the repository at this point in the history
Login register
  • Loading branch information
ParsaKargari authored Jan 4, 2024
2 parents 4f9b922 + d9f3c55 commit 30a7dce
Show file tree
Hide file tree
Showing 24 changed files with 1,354 additions and 249 deletions.
81 changes: 72 additions & 9 deletions Rethread/Rethread.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
7C3A04B62B0AD9DF00E36883 /* IntroView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C3A04B22B0AD9DF00E36883 /* IntroView.swift */; };
7C3A04B82B0AD9DF00E36883 /* OnboardingApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C3A04B42B0AD9DF00E36883 /* OnboardingApp.swift */; };
983014C22B451A3E004A6A07 /* NavigationTransitions in Frameworks */ = {isa = PBXBuildFile; productRef = 983014C12B451A3E004A6A07 /* NavigationTransitions */; };
983286B92B05698F00851B19 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 983286B82B05698F00851B19 /* Assets.xcassets */; };
983286BC2B05698F00851B19 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 983286BB2B05698F00851B19 /* Preview Assets.xcassets */; };
983286C62B05698F00851B19 /* RethreadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 983286C52B05698F00851B19 /* RethreadTests.swift */; };
Expand All @@ -17,11 +17,17 @@
9868A7D82B1FAD280063D9BA /* WelcomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9868A7D72B1FAD280063D9BA /* WelcomeView.swift */; };
9868A7DA2B1FADA70063D9BA /* QuestionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9868A7D92B1FADA70063D9BA /* QuestionView.swift */; };
9868A7DE2B1FAE780063D9BA /* ButtonStyles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9868A7DD2B1FAE780063D9BA /* ButtonStyles.swift */; };
98A183862B38273B001E324A /* LoginSignupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98A183852B38273B001E324A /* LoginSignupView.swift */; };
988A0F952B3BFB4C00ACDC90 /* SignUpView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 988A0F942B3BFB4C00ACDC90 /* SignUpView.swift */; };
988A0F992B3C112300ACDC90 /* DatePickerModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 988A0F982B3C112300ACDC90 /* DatePickerModel.swift */; };
9897C7732B3E6C4000EDE9D9 /* CustomDropdownMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9897C7722B3E6C4000EDE9D9 /* CustomDropdownMenu.swift */; };
98A183862B38273B001E324A /* MainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98A183852B38273B001E324A /* MainView.swift */; };
98A183882B383C0B001E324A /* SignInView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98A183872B383C0B001E324A /* SignInView.swift */; };
98A1838A2B383C47001E324A /* VerificationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98A183892B383C47001E324A /* VerificationView.swift */; };
98A1838C2B38D32A001E324A /* ColorPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98A1838B2B38D32A001E324A /* ColorPalette.swift */; };
98AE7AB92B1FAADB0029C2F7 /* OnboardingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98AE7AB82B1FAADB0029C2F7 /* OnboardingView.swift */; };
98F525C92B469BBD00CCAD78 /* PlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98F525C82B469BBD00CCAD78 /* PlayerView.swift */; };
98F525CB2B469BEB00CCAD78 /* UIPlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98F525CA2B469BEB00CCAD78 /* UIPlayerView.swift */; };
98F525CE2B46A96F00CCAD78 /* TermsAndConditions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98F525CD2B46A96F00CCAD78 /* TermsAndConditions.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -42,7 +48,6 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
7C3A04B22B0AD9DF00E36883 /* IntroView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntroView.swift; sourceTree = "<group>"; };
7C3A04B42B0AD9DF00E36883 /* OnboardingApp.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnboardingApp.swift; sourceTree = "<group>"; };
983286B12B05698E00851B19 /* Rethread.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Rethread.app; sourceTree = BUILT_PRODUCTS_DIR; };
983286B82B05698F00851B19 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand All @@ -55,18 +60,25 @@
9868A7D72B1FAD280063D9BA /* WelcomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeView.swift; sourceTree = "<group>"; };
9868A7D92B1FADA70063D9BA /* QuestionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionView.swift; sourceTree = "<group>"; };
9868A7DD2B1FAE780063D9BA /* ButtonStyles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonStyles.swift; sourceTree = "<group>"; };
98A183852B38273B001E324A /* LoginSignupView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginSignupView.swift; sourceTree = "<group>"; };
988A0F942B3BFB4C00ACDC90 /* SignUpView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpView.swift; sourceTree = "<group>"; };
988A0F982B3C112300ACDC90 /* DatePickerModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DatePickerModel.swift; sourceTree = "<group>"; };
9897C7722B3E6C4000EDE9D9 /* CustomDropdownMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomDropdownMenu.swift; sourceTree = "<group>"; };
98A183852B38273B001E324A /* MainView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = "<group>"; };
98A183872B383C0B001E324A /* SignInView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInView.swift; sourceTree = "<group>"; };
98A183892B383C47001E324A /* VerificationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VerificationView.swift; sourceTree = "<group>"; };
98A1838B2B38D32A001E324A /* ColorPalette.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorPalette.swift; sourceTree = "<group>"; };
98AE7AB82B1FAADB0029C2F7 /* OnboardingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingView.swift; sourceTree = "<group>"; };
98F525C82B469BBD00CCAD78 /* PlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerView.swift; sourceTree = "<group>"; };
98F525CA2B469BEB00CCAD78 /* UIPlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIPlayerView.swift; sourceTree = "<group>"; };
98F525CD2B46A96F00CCAD78 /* TermsAndConditions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TermsAndConditions.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
983286AE2B05698E00851B19 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
983014C22B451A3E004A6A07 /* NavigationTransitions in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -90,6 +102,8 @@
7C9AA2CC2B0EC02600EF6F36 /* Models */ = {
isa = PBXGroup;
children = (
988A0F982B3C112300ACDC90 /* DatePickerModel.swift */,
98F525CD2B46A96F00CCAD78 /* TermsAndConditions.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -133,13 +147,15 @@
983286B32B05698E00851B19 /* Rethread */ = {
isa = PBXGroup;
children = (
7C9AA2D42B0ECADF00EF6F36 /* Styles */,
7C9AA2D12B0EC3BC00EF6F36 /* Extensions */,
7C9AA2D42B0ECADF00EF6F36 /* Styles */,
9897C7712B3E6BF600EDE9D9 /* Components */,
98F525CC2B46A8E900CCAD78 /* VideoPlayer */,
7C9AA2CC2B0EC02600EF6F36 /* Models */,
7C3A04B22B0AD9DF00E36883 /* IntroView.swift */,
98AE7AB82B1FAADB0029C2F7 /* OnboardingView.swift */,
98A183852B38273B001E324A /* LoginSignupView.swift */,
98A183852B38273B001E324A /* MainView.swift */,
98A183872B383C0B001E324A /* SignInView.swift */,
988A0F942B3BFB4C00ACDC90 /* SignUpView.swift */,
98A183892B383C47001E324A /* VerificationView.swift */,
9868A7D92B1FADA70063D9BA /* QuestionView.swift */,
9868A7D72B1FAD280063D9BA /* WelcomeView.swift */,
Expand Down Expand Up @@ -175,6 +191,23 @@
path = RethreadUITests;
sourceTree = "<group>";
};
9897C7712B3E6BF600EDE9D9 /* Components */ = {
isa = PBXGroup;
children = (
9897C7722B3E6C4000EDE9D9 /* CustomDropdownMenu.swift */,
);
path = Components;
sourceTree = "<group>";
};
98F525CC2B46A8E900CCAD78 /* VideoPlayer */ = {
isa = PBXGroup;
children = (
98F525C82B469BBD00CCAD78 /* PlayerView.swift */,
98F525CA2B469BEB00CCAD78 /* UIPlayerView.swift */,
);
path = VideoPlayer;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -191,6 +224,9 @@
dependencies = (
);
name = Rethread;
packageProductDependencies = (
983014C12B451A3E004A6A07 /* NavigationTransitions */,
);
productName = Rethread;
productReference = 983286B12B05698E00851B19 /* Rethread.app */;
productType = "com.apple.product-type.application";
Expand Down Expand Up @@ -264,6 +300,9 @@
Base,
);
mainGroup = 983286A82B05698E00851B19;
packageReferences = (
983014C02B451A3E004A6A07 /* XCRemoteSwiftPackageReference "swiftui-navigation-transitions" */,
);
productRefGroup = 983286B22B05698E00851B19 /* Products */;
projectDirPath = "";
projectRoot = "";
Expand Down Expand Up @@ -308,13 +347,18 @@
files = (
9868A7DA2B1FADA70063D9BA /* QuestionView.swift in Sources */,
7C3A04B82B0AD9DF00E36883 /* OnboardingApp.swift in Sources */,
7C3A04B62B0AD9DF00E36883 /* IntroView.swift in Sources */,
9868A7DE2B1FAE780063D9BA /* ButtonStyles.swift in Sources */,
98AE7AB92B1FAADB0029C2F7 /* OnboardingView.swift in Sources */,
988A0F952B3BFB4C00ACDC90 /* SignUpView.swift in Sources */,
98A1838C2B38D32A001E324A /* ColorPalette.swift in Sources */,
98A183862B38273B001E324A /* LoginSignupView.swift in Sources */,
98F525CE2B46A96F00CCAD78 /* TermsAndConditions.swift in Sources */,
98A183862B38273B001E324A /* MainView.swift in Sources */,
98F525C92B469BBD00CCAD78 /* PlayerView.swift in Sources */,
98A1838A2B383C47001E324A /* VerificationView.swift in Sources */,
98F525CB2B469BEB00CCAD78 /* UIPlayerView.swift in Sources */,
98A183882B383C0B001E324A /* SignInView.swift in Sources */,
988A0F992B3C112300ACDC90 /* DatePickerModel.swift in Sources */,
9897C7732B3E6C4000EDE9D9 /* CustomDropdownMenu.swift in Sources */,
9868A7D82B1FAD280063D9BA /* WelcomeView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -644,6 +688,25 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
983014C02B451A3E004A6A07 /* XCRemoteSwiftPackageReference "swiftui-navigation-transitions" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/davdroman/swiftui-navigation-transitions.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.13.3;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
983014C12B451A3E004A6A07 /* NavigationTransitions */ = {
isa = XCSwiftPackageProductDependency;
package = 983014C02B451A3E004A6A07 /* XCRemoteSwiftPackageReference "swiftui-navigation-transitions" */;
productName = NavigationTransitions;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 983286A92B05698E00851B19 /* Project object */;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"pins" : [
{
"identity" : "swiftui-introspect",
"kind" : "remoteSourceControl",
"location" : "https://github.com/siteline/swiftui-introspect",
"state" : {
"revision" : "9e1cc02a65b22e09a8251261cccbccce02731fc5",
"version" : "1.1.1"
}
},
{
"identity" : "swiftui-navigation-transitions",
"kind" : "remoteSourceControl",
"location" : "https://github.com/davdroman/swiftui-navigation-transitions.git",
"state" : {
"revision" : "a6a3c70ad5d771bd1e927fb55897231cd9592024",
"version" : "0.13.3"
}
}
],
"version" : 2
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "0220AA8C-8DDB-4B36-960E-86B8D661A58D"
type = "1"
version = "2.0">
</Bucket>
Binary file added Rethread/Rethread/.DS_Store
Binary file not shown.
21 changes: 21 additions & 0 deletions Rethread/Rethread/Assets.xcassets/starSky.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "starSky.jpg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
130 changes: 130 additions & 0 deletions Rethread/Rethread/Components/CustomDropdownMenu.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
import SwiftUI


struct CustomDropdownMenu: View {
@State var isSelecting = false
@State var selectionTitle = ""
@State var selectedRowId = 0
let items: [DropdownItem]


var body: some View {
GeometryReader { _ in
VStack {
HStack {
Text(selectionTitle)
.font(.system(size: 16, weight: .semibold, design: .rounded))
.animation(.none)
Spacer()
Image(systemName: "chevron.down")
.font(.system(size: 16, weight: .semibold))
.rotationEffect(.degrees( isSelecting ? -180 : 0))

}
.padding(.horizontal)
.padding(.vertical, 1.5)
.foregroundColor(Color.primaryTextColor)

if isSelecting {
Divider()
.background(.white)
.padding(.horizontal)

VStack(spacing: 5) {
dropDownItemsList()
}
}

}
.frame(maxWidth: .infinity)
.padding(.vertical)
.background(
RoundedRectangle(cornerRadius: 10)
.strokeBorder(Color.gray, lineWidth: 1)
.background(Color.white)
.cornerRadius(10)
)
.cornerRadius(5)
.onTapGesture {
isSelecting.toggle()
}
.onAppear {
selectedRowId = items[0].id
selectionTitle = items[0].title
}
.animation(.easeInOut(duration: 0.3))
}
}

private func dropDownItemsList() -> some View {
ForEach(items) { item in
DropdownMenuItemView(isSelecting: $isSelecting, selectionId: $selectedRowId, selectiontitle: $selectionTitle, item: item)
}
}
}

struct DropdownItem: Identifiable {
let id: Int
let title: String
let onSelect: () -> Void
}

struct DropdownMenuItemView: View {
@Binding var isSelecting: Bool
@Binding var selectionId: Int
@Binding var selectiontitle: String

let item: DropdownItem

var body: some View {
Button(action: {
isSelecting = false
DispatchQueue.main.asyncAfter(deadline: .now() + 0.4) {
selectionId = item.id
}
selectiontitle = item.title
item.onSelect()
}) {
HStack {
Text(item.title)
.font(.system(size: 16, weight: .regular, design: .rounded))

Spacer()
Image(systemName: "checkmark")
.font(.system(size: 12, weight: .bold))
.opacity(selectionId == item.id ? 1 : 0)
}
.padding(.horizontal)
.padding(.vertical, 5)
.foregroundColor(.gray)

}
}
}

struct CustomDropdownMenu_Previews: PreviewProvider {
static var previews: some View {
CustomDropdownMenu(items: [
DropdownItem(id: 1, title: "Messages", onSelect: {}),
DropdownItem(id: 2, title: "Archived", onSelect: {}),
DropdownItem(id: 3, title: "Trash", onSelect: {})
])
.padding(.horizontal)
}
}

extension View {
func customDropdownMenu(items: [DropdownItem]) -> some View {
ZStack {
VStack {
CustomDropdownMenu(items: items)
.padding(.horizontal)
Spacer()
}
.zIndex(10)
self
.offset(y: 60)
.zIndex(1)
}
}
}
28 changes: 0 additions & 28 deletions Rethread/Rethread/IntroView.swift

This file was deleted.

Loading

0 comments on commit 30a7dce

Please sign in to comment.