Skip to content

Commit

Permalink
Merge branch 'origin/main' into feature/philip/edit-profile-view
Browse files Browse the repository at this point in the history
  • Loading branch information
petabite committed May 30, 2023
2 parents 8b37e03 + e0520f5 commit 111b88e
Show file tree
Hide file tree
Showing 83 changed files with 3,106 additions and 1,700 deletions.
152 changes: 112 additions & 40 deletions ALUM/ALUM.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

23 changes: 1 addition & 22 deletions ALUM/ALUM/ALUMApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,14 @@ class AppDelegate: NSObject, UIApplicationDelegate {
}
}

struct RootView: View {
@ObservedObject var currentUser: CurrentUserModel = CurrentUserModel.shared

var body: some View {
if self.currentUser.isLoading {
LoadingView(text: "RootView")
.onAppear(perform: {
Task {
await self.currentUser.setForInSessionUser()
}
})
} else if self.currentUser.isLoggedIn == false {
NavigationView {
LoginScreen()
}
} else {
MenteeSessionsDetailsPage()
}
}
}

@main
struct ALUMApp: App {
// register app delegate for Firebase setup
@UIApplicationDelegateAdaptor(AppDelegate.self) var delegate

var body: some Scene {
WindowGroup {
RootView()
RootRouter()
}
}
}
20 changes: 20 additions & 0 deletions ALUM/ALUM/Assets.xcassets/ALUM Beige.colorset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF6",
"green" : "0xFA",
"red" : "0xFC"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 3 additions & 3 deletions ALUM/ALUM/Assets.xcassets/ALUM White.colorset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF6",
"green" : "0xFA",
"red" : "0xFC"
"blue" : "0.965",
"green" : "0.980",
"red" : "0.988"
}
},
"idiom" : "universal"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 95 additions & 3 deletions ALUM/ALUM/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,101 @@
{
"images" : [
{
"filename" : "ALUM app icon.png",
"idiom" : "universal",
"platform" : "ios",
"filename" : "ALUM app icon (40x40).png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "ALUM app icon (60x60).png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "ALUM app icon (58x58).png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "ALUM app icon (87x87).png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "ALUM app icon (80x80).png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "ALUM app icon (120x120).png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "ALUM app icon (120x120) 1.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "ALUM app icon (180x180).png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
Expand Down
21 changes: 21 additions & 0 deletions ALUM/ALUM/Assets.xcassets/Logout Icon.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "log-out.png",
"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.
21 changes: 21 additions & 0 deletions ALUM/ALUM/Assets.xcassets/NoConnectionIcon.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "no-connection.svg",
"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.
31 changes: 31 additions & 0 deletions ALUM/ALUM/Components/ButtonStyles/FullWidthButtonStyle.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// FullWidthButtonStyle.swift
// ALUM
//
// Created by Aman Aggarwal on 5/28/23.
//

import SwiftUI

struct FullWidthButtonStyle: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label
.frame(maxWidth: .infinity)
.padding(.vertical, 16)
.background(ALUMColor.white.color)
}
}

struct FullWidthButtonStyle_Previews: PreviewProvider {
static var previews: some View {
Button(action: {
print("out")
}, label: {
HStack {
ALUMText(text: "Log out", textColor: ALUMColor.red)
Image("Logout Icon")
}
})
.buttonStyle(FullWidthButtonStyle())
}
}
63 changes: 63 additions & 0 deletions ALUM/ALUM/Components/CustomNavBar/CustomNavBarContainerView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
//
// CustomNavBarContainerView.swift
// ALUM
//
// Created by Yash Ravipati on 5/18/23.
//

import SwiftUI

struct CustomNavBarDefaultValues {
static var showBackButton: Bool = true
static var title: String = ""
static var barIsPurple: Bool = false
static var barIsHidden: Bool = false
}

struct CustomNavBarContainerView<Content: View>: View {
let content: Content

// By default, we show the back button unless some view explicitly sets
// this to false
@State private var showBackButton: Bool = CustomNavBarDefaultValues.showBackButton

@State private var title: String = CustomNavBarDefaultValues.title
@State private var isPurple: Bool = CustomNavBarDefaultValues.barIsPurple
@State private var isHidden: Bool = CustomNavBarDefaultValues.barIsHidden

init(@ViewBuilder content: () -> Content) {
self.content = content()
}

var body: some View {
return VStack(spacing: 0) {
if !isHidden {
CustomNavBarView(showBackButton: showBackButton, title: title, isPurple: isPurple)
}
content
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
.onPreferenceChange(CustomNavBarTitlePreferenceKey.self, perform: { value in
self.title = value
})
.onPreferenceChange(CustomNavBarIsPurplePreferenceKey.self, perform: { value in
self.isPurple = value
})
.onPreferenceChange(CustomNavBarBackHiddenPreferenceKey.self, perform: { value in
self.showBackButton = !value
})
.onPreferenceChange(CustomNavBarIsHiddenPreferenceKey.self, perform: { value in
self.isHidden = value
})
}
}

struct CustomNavBarContainerView_Previews: PreviewProvider {
static var previews: some View {
CustomNavBarContainerView {
VStack(spacing: 0) {
LoginReviewPage(text: ["Hello", "Hi"])
}
}
}
}
66 changes: 66 additions & 0 deletions ALUM/ALUM/Components/CustomNavBar/CustomNavBarPreferenceKeys.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
//
// CustomNavBarPreferenceKeys.swift
// ALUM
//
// Created by Yash Ravipati on 5/18/23.
//

import Foundation
import SwiftUI

struct CustomNavBarTitlePreferenceKey: PreferenceKey {
static var defaultValue: String = CustomNavBarDefaultValues.title

static func reduce(value: inout String, nextValue: () -> String) {
value = nextValue()
}
}

struct CustomNavBarIsHiddenPreferenceKey: PreferenceKey {
static var defaultValue: Bool = CustomNavBarDefaultValues.barIsHidden

static func reduce(value: inout Bool, nextValue: () -> Bool) {
value = nextValue()
}
}

struct CustomNavBarIsPurplePreferenceKey: PreferenceKey {
static var defaultValue: Bool = CustomNavBarDefaultValues.barIsPurple

static func reduce(value: inout Bool, nextValue: () -> Bool) {
value = nextValue()
}
}

struct CustomNavBarBackHiddenPreferenceKey: PreferenceKey {
static var defaultValue: Bool = !CustomNavBarDefaultValues.showBackButton

static func reduce(value: inout Bool, nextValue: () -> Bool) {
value = nextValue()
}
}

extension View {
func customNavigationIsHidden(_ isHidden: Bool) -> some View {
preference(key: CustomNavBarIsHiddenPreferenceKey.self, value: isHidden)
}

func customNavigationTitle(_ title: String) -> some View {
preference(key: CustomNavBarTitlePreferenceKey.self, value: title)
}

func customNavigationIsPurple(_ isPurple: Bool) -> some View {
preference(key: CustomNavBarIsPurplePreferenceKey.self, value: isPurple)
}

func customNavigationBarBackButtonHidden(_ hidden: Bool) -> some View {
preference(key: CustomNavBarBackHiddenPreferenceKey.self, value: hidden)
}

func customNavBarItems(title: String, isPurple: Bool, backButtonHidden: Bool) -> some View {
self
.customNavigationTitle(title)
.customNavigationIsPurple(isPurple)
.customNavigationBarBackButtonHidden(backButtonHidden)
}
}
Loading

0 comments on commit 111b88e

Please sign in to comment.