ui done for one convo
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
896CE70727711BAB00DB474E /* FindFriendsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 896CE70627711BAB00DB474E /* FindFriendsView.swift */; };
|
||||
896CE70927712CED00DB474E /* StringExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 896CE70827712CED00DB474E /* StringExtension.swift */; };
|
||||
89814683277D83F300DA46CD /* ConvosView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89814682277D83F300DA46CD /* ConvosView.swift */; };
|
||||
89814685277D857300DA46CD /* Convo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89814684277D857300DA46CD /* Convo.swift */; };
|
||||
89A107E5277476CC00B971FD /* PushNotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89A107E4277476CC00B971FD /* PushNotificationService.swift */; };
|
||||
89A107E927753AB600B971FD /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 89A107E827753AB500B971FD /* GoogleService-Info.plist */; };
|
||||
89AD5573276DD790001658E0 /* SplashView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89AD5572276DD790001658E0 /* SplashView.swift */; };
|
||||
@@ -127,6 +128,7 @@
|
||||
896CE70627711BAB00DB474E /* FindFriendsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FindFriendsView.swift; sourceTree = "<group>"; };
|
||||
896CE70827712CED00DB474E /* StringExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringExtension.swift; sourceTree = "<group>"; };
|
||||
89814682277D83F300DA46CD /* ConvosView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConvosView.swift; sourceTree = "<group>"; };
|
||||
89814684277D857300DA46CD /* Convo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Convo.swift; sourceTree = "<group>"; };
|
||||
89A107E4277476CC00B971FD /* PushNotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationService.swift; sourceTree = "<group>"; };
|
||||
89A107E827753AB500B971FD /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
|
||||
89AD5572276DD790001658E0 /* SplashView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashView.swift; sourceTree = "<group>"; };
|
||||
@@ -328,6 +330,7 @@
|
||||
89BDCDF02769E64200577829 /* Message.swift */,
|
||||
891A160D27657CEA00B26659 /* User.swift */,
|
||||
89110713277166D6005797FA /* UserFriends.swift */,
|
||||
89814684277D857300DA46CD /* Convo.swift */,
|
||||
);
|
||||
path = Models;
|
||||
sourceTree = "<group>";
|
||||
@@ -598,6 +601,7 @@
|
||||
89110714277166D6005797FA /* UserFriends.swift in Sources */,
|
||||
896CE70727711BAB00DB474E /* FindFriendsView.swift in Sources */,
|
||||
891A160B2765732700B26659 /* HomeViewModel.swift in Sources */,
|
||||
89814685277D857300DA46CD /* Convo.swift in Sources */,
|
||||
89814683277D83F300DA46CD /* ConvosView.swift in Sources */,
|
||||
89BCABEB276D2A09009E9B10 /* PhoneVerificationView.swift in Sources */,
|
||||
892179E62765FECD001E6C60 /* FooterControlsViewModel.swift in Sources */,
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// Convo.swift
|
||||
// nirvana-ios
|
||||
//
|
||||
// Created by Arjun Patel on 12/29/21.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import FirebaseFirestoreSwift
|
||||
import FirebaseFirestore
|
||||
|
||||
enum ConvoState: String, Codable {
|
||||
case connected
|
||||
case disconnected
|
||||
}
|
||||
|
||||
struct Convo: Identifiable, Codable {
|
||||
@DocumentID var id: String?
|
||||
var leaderUserId: String
|
||||
var receiverUserId: String
|
||||
|
||||
var agoraToken: String
|
||||
|
||||
var state: ConvoState
|
||||
|
||||
var Users: [String]?
|
||||
|
||||
@ServerTimestamp var startedTimestamp: Date?
|
||||
@ServerTimestamp var endedTimestamp: Date?
|
||||
}
|
||||
|
||||
//struct DetailConvo: Convo {
|
||||
// func getRelativeStartTime() {
|
||||
//
|
||||
// }
|
||||
//}
|
||||
@@ -7,9 +7,39 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
// test convos
|
||||
let testConvos: [Convo] = [
|
||||
Convo(leaderUserId: "VWVPKCrNmMeZlkEeZxuJ0Wsgq0C3", receiverUserId: "zd6PpD3TmnQUDoy6noS9aZpuPWr1", agoraToken: "006c8dfd65deb5c4741bd564085627139d0IAAIlYcWj21zCp4jq/WS2BMaiMYlKSax7ohIjzBx1BtpWAx+f9gAAAAAEADQ943gX6LOYQEAAQBfos5h", state: .connected)
|
||||
]
|
||||
|
||||
struct ConvosView: View {
|
||||
var body: some View {
|
||||
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
|
||||
ScrollView([.horizontal]) {
|
||||
HStack {
|
||||
ForEach(0..<testConvos.count, id: \.self) {index in
|
||||
|
||||
|
||||
ZStack(alignment: .topTrailing) {
|
||||
Circle()
|
||||
.foregroundColor(NirvanaColor.dimTeal.opacity(0.4))
|
||||
|
||||
ZStack {
|
||||
Color.clear
|
||||
ProfilePictureOverlap()
|
||||
.shadow(radius: 10)
|
||||
}
|
||||
|
||||
Text("+2")
|
||||
.padding(5)
|
||||
.font(.caption)
|
||||
.foregroundColor(Color.white)
|
||||
.background(NirvanaColor.dimTeal)
|
||||
.cornerRadius(100)
|
||||
}
|
||||
.frame(width: 100, height: 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,3 +48,26 @@ struct ConvosView_Previews: PreviewProvider {
|
||||
ConvosView()
|
||||
}
|
||||
}
|
||||
|
||||
struct ProfilePictureOverlap: View {
|
||||
let numberAttendees:Int = 5
|
||||
let offset:Int = 15
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
ForEach(0..<numberAttendees, id: \.self) {attendeeIndex in
|
||||
if attendeeIndex < 3 {
|
||||
Image(Avatars.avatarSystemNames[attendeeIndex+1])
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.background(NirvanaColor.dimTeal)
|
||||
.clipShape(Circle())
|
||||
.offset(x: CGFloat((-15 * attendeeIndex)) + 15)
|
||||
.frame(width: 50)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user