Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sessionbutton component #172

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions ALUM/ALUM.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
97F1DB6C2A09DD4600DE8DB4 /* SessionButtonComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97F1DB6B2A09DD4600DE8DB4 /* SessionButtonComponent.swift */; };
97F6CDF429BD317200DFBB99 /* TopicsOfInterest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97F6CDF329BD317200DFBB99 /* TopicsOfInterest.swift */; };
97F6CDF629BD4E3D00DFBB99 /* CareerInterests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97F6CDF529BD4E3D00DFBB99 /* CareerInterests.swift */; };
CA9649C82ADE1C19000CE690 /* SessionCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA9649C72ADE1C19000CE690 /* SessionCard.swift */; };
E3F4186629E7246400FDE56D /* CalendlyBooking.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3F4186529E7246400FDE56D /* CalendlyBooking.swift */; };
E3FD958E2ACFC71500D31AA3 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = E3FD958D2ACFC71500D31AA3 /* FirebaseAnalytics */; };
E3FD95902ACFC71500D31AA3 /* FirebaseAnalyticsOnDeviceConversion in Frameworks */ = {isa = PBXBuildFile; productRef = E3FD958F2ACFC71500D31AA3 /* FirebaseAnalyticsOnDeviceConversion */; };
Expand Down Expand Up @@ -283,6 +284,7 @@
97F1DB6B2A09DD4600DE8DB4 /* SessionButtonComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionButtonComponent.swift; sourceTree = "<group>"; };
97F6CDF329BD317200DFBB99 /* TopicsOfInterest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopicsOfInterest.swift; sourceTree = "<group>"; };
97F6CDF529BD4E3D00DFBB99 /* CareerInterests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CareerInterests.swift; sourceTree = "<group>"; };
CA9649C72ADE1C19000CE690 /* SessionCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionCard.swift; sourceTree = "<group>"; };
E3F4186529E7246400FDE56D /* CalendlyBooking.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalendlyBooking.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -442,6 +444,7 @@
07A15DD32A23F69100C52798 /* ButtonStyles */,
0793B4182A19FA7200AF78C8 /* CustomNavBar */,
0757551B29FAA2AB008E73FB /* Bullet.swift */,
CA9649C72ADE1C19000CE690 /* SessionCard.swift */,
0757551C29FAA2AB008E73FB /* CircleAddButton.swift */,
0757551D29FAA2AB008E73FB /* CustomAlertView.swift */,
0757551929FAA2AB008E73FB /* DynamicProgressBarComponent.swift */,
Expand Down Expand Up @@ -839,6 +842,7 @@
979F812229B842E200D6E964 /* UniversityNames.swift in Sources */,
0757552229FAA2AB008E73FB /* CircleAddButton.swift in Sources */,
0757552E29FAA2D6008E73FB /* PostSessionConfirmationScreen.swift in Sources */,
CA9649C82ADE1C19000CE690 /* SessionCard.swift in Sources */,
974D62D129FAFA7C0096FE80 /* ViewPostSessionNotesPage.swift in Sources */,
07A042202A334CFC005A42A8 /* KeyboardAwareView.swift in Sources */,
0757553829FAA350008E73FB /* QuestionModel.swift in Sources */,
Expand Down Expand Up @@ -1006,10 +1010,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = ALUM/ALUM.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"ALUM/Preview Content\"";
DEVELOPMENT_TEAM = BV3PZFLX5U;
DEVELOPMENT_TEAM = BK7MB9J3TD;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ALUM/Info.plist;
Expand All @@ -1027,6 +1032,7 @@
MARKETING_VERSION = 0.1.2;
PRODUCT_BUNDLE_IDENTIFIER = TSE.ALUM;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
Expand All @@ -1039,10 +1045,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = ALUM/ALUM.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_ASSET_PATHS = "\"ALUM/Preview Content\"";
DEVELOPMENT_TEAM = BV3PZFLX5U;
DEVELOPMENT_TEAM = BK7MB9J3TD;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = ALUM/Info.plist;
Expand All @@ -1060,6 +1067,7 @@
MARKETING_VERSION = 0.1.2;
PRODUCT_BUNDLE_IDENTIFIER = TSE.ALUM;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 1;
Expand Down
1 change: 1 addition & 0 deletions ALUM/ALUM/Components/SessionButtonComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
.frame(width: 358, height: 118)
.foregroundColor(Color.white)


Check failure on line 21 in ALUM/ALUM/Components/SessionButtonComponent.swift

View workflow job for this annotation

GitHub Actions / lint

Trailing Whitespace Violation: Lines should not have trailing whitespace (trailing_whitespace)

Check failure on line 21 in ALUM/ALUM/Components/SessionButtonComponent.swift

View workflow job for this annotation

GitHub Actions / lint

Vertical Whitespace Violation: Limit vertical whitespace to a single empty line; currently 2 (vertical_whitespace)
HStack {
VStack {
Text("JAN")
Expand Down
176 changes: 176 additions & 0 deletions ALUM/ALUM/Components/SessionCard.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
//
// SessionCard.swift
// ALUM
//
// Created by Christen Xie on 10/16/23.
//

import SwiftUI

enum SessionCardState{

Check failure on line 10 in ALUM/ALUM/Components/SessionCard.swift

View workflow job for this annotation

GitHub Actions / lint

Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration (opening_brace)
case unpaired
case paired
case cancelled
case scheduled
}

struct SessionCard: View {

@State var currentCardState : SessionCardState = .paired

Check failure on line 19 in ALUM/ALUM/Components/SessionCard.swift

View workflow job for this annotation

GitHub Actions / lint

Colon Spacing Violation: Colons should be next to the identifier when specifying a type and next to the key in dictionary literals (colon)
@State var formIsIncomplete: Bool = false
@State var formType: String = "Pre"

var cardBackgroundColor: Color {
switch currentCardState {
case .unpaired:
return Color.white
case .paired:
return Color("ALUM Light Purple")
case .cancelled:
return Color("ALUM Light Purple")
case .scheduled:
return Color.white
}
}

var cardHeight: CGFloat{

Check failure on line 36 in ALUM/ALUM/Components/SessionCard.swift

View workflow job for this annotation

GitHub Actions / lint

Opening Brace Spacing Violation: Opening braces should be preceded by a single space and on the same line as the declaration (opening_brace)
switch currentCardState {
case .unpaired:
return 100
case .paired:
return 180
case .cancelled:
return 160
case .scheduled:
if(formIsIncomplete){

Check failure on line 45 in ALUM/ALUM/Components/SessionCard.swift

View workflow job for this annotation

GitHub Actions / lint

Control Statement Violation: `if`, `for`, `guard`, `switch`, `while`, and `catch` statements shouldn't unnecessarily wrap their conditionals or arguments in parentheses (control_statement)
return 155
}
else{
return 90
}
}
}

var cardText: String{
switch currentCardState {
case .unpaired:
return "No upcoming sessions"
case .paired:
return "You have been paired with Mentor [Mentor Name]. Schedule your first session to meet each other and exchange contacts."

Check failure on line 59 in ALUM/ALUM/Components/SessionCard.swift

View workflow job for this annotation

GitHub Actions / lint

Line Length Violation: Line should be 120 characters or less; currently it has 142 characters (line_length)
case .cancelled:
return "Session with [Mentor name] on [date] at [time] has been cancelled by your mentor."
case .scheduled:
return "Complete Pre-Session Notes"
}
}

var buttonText: String {
switch currentCardState {
case .unpaired:
return "Book Session via Calendly"
case .paired:
return "Book Session via Calendly"
case .cancelled:
return "Reschedule via Calendly"
case .scheduled:
return "Complete Pre-Session Notes"
}
}

var body: some View {
ZStack {
if currentCardState == .scheduled {
RoundedRectangle(cornerRadius: 12.0)
.stroke(Color("ALUM Light Purple"))
.frame(width: 358, height: cardHeight)
} else {
RoundedRectangle(cornerRadius: 12.0)
.fill(cardBackgroundColor)
.frame(width: 358, height: cardHeight)
.foregroundColor(Color.white)
}
if(currentCardState != .scheduled){

Check failure on line 92 in ALUM/ALUM/Components/SessionCard.swift

View workflow job for this annotation

GitHub Actions / lint

Control Statement Violation: `if`, `for`, `guard`, `switch`, `while`, and `catch` statements shouldn't unnecessarily wrap their conditionals or arguments in parentheses (control_statement)
HStack{
VStack{
Text(cardText).font(.custom("Metropolis-Regular", size: 20, relativeTo: .headline))
.padding(.top)
.padding([.leading, .trailing])

Spacer()

Button(action: {
print("Button was tapped!")
}) {

Check failure on line 103 in ALUM/ALUM/Components/SessionCard.swift

View workflow job for this annotation

GitHub Actions / lint

Multiple Closures with Trailing Closure Violation: Trailing closure syntax should not be used when passing more than one closure argument (multiple_closures_with_trailing_closure)
Text(buttonText)
.font(.custom("Metropolis-Regular", size: 20, relativeTo: .headline))
.padding()
}
.frame(width: 300)
.buttonStyle(FilledInButtonStyle(disabled: false))
.padding(.bottom)

}
}
.frame(width: 358, height: cardHeight)
}else{
VStack {
HStack {
VStack {
Text("JAN")
.font(.custom("Metropolis-Regular", size: 13, relativeTo: .headline))
.foregroundColor(Color("TextGray"))
.padding(.bottom, 2)
Text("23")
.font(.custom("Metropolis-Regular", size: 34, relativeTo: .headline))
}
.padding(.leading, 18)
.padding(.trailing, 18)
VStack{
Text("Session with Mentor")
.font(.custom("Metropolis-Regular", size: 17, relativeTo: .headline))
.padding(.bottom, 4)

HStack {
Text("Monday, 9:00 - 10:00 AM PT")
.font(.custom("Metropolis-Regular", size: 13, relativeTo: .headline))
.foregroundColor(Color("TextGray"))
.padding(.bottom, 4)

}
}
Spacer()
Image(systemName: "chevron.right")
.foregroundColor(Color("NeutralGray3"))
.padding(.trailing, 22)
}
if formIsIncomplete {
HStack{
Button(action: {
print("Button was tapped!")
}) {

Check failure on line 150 in ALUM/ALUM/Components/SessionCard.swift

View workflow job for this annotation

GitHub Actions / lint

Multiple Closures with Trailing Closure Violation: Trailing closure syntax should not be used when passing more than one closure argument (multiple_closures_with_trailing_closure)
Text(buttonText)
.font(.custom("Metropolis-Regular", size: 18, relativeTo: .headline))
.padding()
}
.frame(width: 320, height: 50)
.buttonStyle(FilledInButtonStyle(disabled: false))
.padding(.bottom, 6)
}
}



}
.frame(width: 358, height: cardHeight)
}
}
.padding(.leading, 16).padding(.trailing, 16)
.padding(.top, 16).padding(.bottom, 16)
}
}

struct SessionCardComponent_Previews: PreviewProvider {
static var previews: some View {
SessionCard()
}
}
19 changes: 19 additions & 0 deletions admin-portal/backend/confug.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import dotenv from "dotenv";

dotenv.config({
path: ".env",
});


console.log("PROCESSENV:", process.env);
let serviceAccountKeyV = "";

if (!process.env.SERVICE_ACCOUNT_KEY) {
throw new Error();
} else {
serviceAccountKeyV = process.env.SERVICE_ACCOUNT_KEY;
}

const serviceAccountKey = serviceAccountKeyV;

export {serviceAccountKey}
16 changes: 16 additions & 0 deletions admin-portal/backend/firebase.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { initializeApp } from "firebase/app";

const firebaseConfig = {
apiKey: "AIzaSyDXhNQM8U0GUoCEG3Qj5tz_GoFStXQ5Mxs",
authDomain: "alum-mobile-app.firebaseapp.com",
projectId: "alum-mobile-app",
storageBucket: "alum-mobile-app.appspot.com",
messagingSenderId: "41074817131",
appId: "1:41074817131:web:ee680262ab40d1e4e4592e",
measurementId: "G-F5667G1HLP"
};
const app = initializeApp(firebaseConfig);

export const initializeFirebase = () => {
return app;
}
12 changes: 12 additions & 0 deletions admin-portal/backend/serviceKey.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "service_account",
"project_id": "alum-mobile-app",
"private_key_id": "7142be2bbd1b12a2fa961b5965f003464f4436e1",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDSOapFcemxAGGt\n2sTnc/sLXxjyDLO/YhsUdhY6dMbzQbaFDoevrsgyMaYfafZxA2I9TjN9JDyN/wsJ\nuDStUbaOXokmfkDaSKOzdhW/ZlC2FNNngrsCrNSfu2keuehNwhN00CAonsjXj2wT\ny1uWroVTXo8gc2qWPe0Ssnh/PMl75PMOCdMl4O6qbO4I0Ir4+GMp1uFEO7rYZTjv\nUIm8XWRyfQVln3GE8JXyJkPc3r0YCh6iOax+0l/8LxdhSQFYgaWg619h9tdesips\nMTqa3atEkAQH5y7HoiMC1Ksor118gmASE+/84J0A389K5a+T8M8u+Fzl8Q2J3MZo\nk5wFMIPPAgMBAAECggEAAx0ShyqihzWDvNfNR30mMFjbAfEG7xIRHnc/ROPxcz+W\n+oTNNzv4QBailnIXiKqJF5bsanFsvHVeDmmU8iWimlNX+Id6mSE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LOHb+W+Y2vTx5XNwhpTylsiwD9qT7I0I8ODMrbx6csKK52+01Nrk/6nULHJRL\nGiXMclIPLSM1hGgI/TwNyw==\n-----END PRIVATE KEY-----\n",
"client_email": "[email protected]",
"client_id": "107661110524926286768",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-zco7l%40alum-mobile-app.iam.gserviceaccount.com"
}
Loading