Skip to content

Commit d2bfbff

Browse files
authored
"Event" -> "Activity" (#221)
2 parents 6942576 + edf63cc commit d2bfbff

File tree

65 files changed

+1680
-1734
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1680
-1734
lines changed

Spawn-App-iOS-SwiftUI/Assets.xcassets/EventNotFound.imageset/Contents.json renamed to Spawn-App-iOS-SwiftUI/Assets.xcassets/ActivityNotFound.imageset/Contents.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"images" : [
33
{
4-
"filename" : "EventNotFound.png",
4+
"filename" : "ActivityNotFound.png",
55
"idiom" : "universal",
66
"scale" : "1x"
77
},
88
{
9-
"filename" : "EventNotFound2.png",
9+
"filename" : "ActivityNotFound2.png",
1010
"idiom" : "universal",
1111
"scale" : "2x"
1212
},
1313
{
14-
"filename" : "EventNotFound3.png",
14+
"filename" : "ActivityNotFound3.png",
1515
"idiom" : "universal",
1616
"scale" : "3x"
1717
}

Spawn-App-iOS-SwiftUI/ContentView.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import SwiftUI
99

1010
struct ContentView: View {
1111
var user: BaseUserDTO
12-
@State private var showEventCreationDrawer: Bool = false
12+
@State private var showActivityCreationDrawer: Bool = false
1313
@State private var selectedTab: Int = 0
1414

1515
var body: some View {
@@ -74,7 +74,7 @@ struct ContentView: View {
7474
let previousTab = selectedTab
7575
// Return to previous tab (but avoid returning to the create tab itself)
7676
selectedTab = previousTab == 2 ? 0 : previousTab
77-
showEventCreationDrawer = true
77+
showActivityCreationDrawer = true
7878
}
7979
}
8080
}
@@ -87,11 +87,11 @@ struct ContentView: View {
8787
UITabBar.appearance().unselectedItemTintColor = UIColor.black
8888
}
8989
}
90-
.sheet(isPresented: $showEventCreationDrawer) {
91-
EventCreationView(
90+
.sheet(isPresented: $showActivityCreationDrawer) {
91+
ActivityCreationView(
9292
creatingUser: user,
9393
closeCallback: {
94-
showEventCreationDrawer = false
94+
showActivityCreationDrawer = false
9595
}
9696
)
9797
.presentationDragIndicator(.visible)

Spawn-App-iOS-SwiftUI/Extensions/NotificationNameExtensions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ extension Notification.Name {
77
// Notification sent when user logs out
88
static let userDidLogout = Notification.Name("userDidLogout")
99

10-
// Notification for event creation
11-
static let eventCreated = Notification.Name("eventCreated")
10+
// Notification for activity creation
11+
static let activityCreated = Notification.Name("activityCreated")
1212
}

Spawn-App-iOS-SwiftUI/Models/Event.swift renamed to Spawn-App-iOS-SwiftUI/Models/Activity.swift

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
//
2-
// Event.swift
2+
// Activity.swift
33
// Spawn-App-iOS-SwiftUI
44
//
55
// Created by Daniel Agapov on 11/4/24.
66
//
77

88
import Foundation
99

10-
class Event: Identifiable, Codable {
10+
class Activity: Identifiable, Codable {
1111
var id: UUID
1212
var title: String?
1313

1414
// MARK: Info
1515
var startTime: Date?
1616
var endTime: Date?
1717
var location: Location?
18-
var note: String? // this corresponds to Figma design "my place at 10? I'm cooking guys" note in event
18+
var note: String? // this corresponds to Figma design "my place at 10? I'm cooking guys" note in activity
19+
var createdAt: Date?
1920

2021
// MARK: Relations
2122
var creatorUser: UserDTO?
2223

23-
// tech note: I'll be able to check if current user is in an event's partipants to determine which symbol to show in feed
24+
// tech note: I'll be able to check if current user is in an activity's partipants to determine which symbol to show in feed
2425
var participantUsers: [UserDTO]?
2526
var invitedUsers: [UserDTO]?
26-
var chatMessages: [FullEventChatMessageDTO]?
27+
var chatMessages: [FullActivityChatMessageDTO]?
2728
var participationStatus: ParticipationStatus?
2829

2930
init(
@@ -36,8 +37,9 @@ class Event: Identifiable, Codable {
3637
creatorUser: UserDTO? = UserDTO.danielAgapov,
3738
participantUsers: [UserDTO]? = nil,
3839
invitedUsers: [UserDTO]? = nil,
39-
chatMessages: [FullEventChatMessageDTO]? = nil,
40-
participationStatus: ParticipationStatus? = nil
40+
chatMessages: [FullActivityChatMessageDTO]? = nil,
41+
participationStatus: ParticipationStatus? = nil,
42+
createdAt: Date? = nil
4143
) {
4244
self.id = id
4345
self.title = title
@@ -50,10 +52,11 @@ class Event: Identifiable, Codable {
5052
self.invitedUsers = invitedUsers
5153
self.chatMessages = chatMessages
5254
self.participationStatus = participationStatus
55+
self.createdAt = createdAt
5356
}
5457
}
5558

56-
extension Event {
59+
extension Activity {
5760

5861
static func dateFromTimeString(_ timeString: String) -> Date? {
5962
let dateFormatter = DateFormatter()
@@ -74,7 +77,7 @@ extension Event {
7477
return nil
7578
}
7679

77-
static let mockDinnerEvent: Event = Event(
80+
static let mockDinnerActivity: Activity = Activity(
7881
id: UUID(),
7982
title: "Dinner time!!!!!!",
8083
startTime: dateFromTimeString("10:00 PM"),
@@ -92,9 +95,9 @@ extension Event {
9295
]
9396
)
9497

95-
static let mockEvents: [Event] = [
96-
mockDinnerEvent,
97-
Event(
98+
static let mockActivities: [Activity] = [
99+
mockDinnerActivity,
100+
Activity(
98101
id: UUID(),
99102
title: "wanna run 5k with me?",
100103
startTime: Date(),
@@ -107,23 +110,23 @@ extension Event {
107110
UserDTO.danielLee,
108111
],
109112
chatMessages: [
110-
FullEventChatMessageDTO(
113+
FullActivityChatMessageDTO(
111114
id: UUID(),
112115
content: "yo guys, wya?",
113116
timestamp: Date().addingTimeInterval(-30), // 30 seconds ago
114117
senderUser: BaseUserDTO.danielAgapov,
115-
eventId: mockDinnerEvent.id
118+
activityId: mockDinnerActivity.id
116119
),
117-
FullEventChatMessageDTO(
120+
FullActivityChatMessageDTO(
118121
id: UUID(),
119122
content: "I just saw you",
120123
timestamp: Date().addingTimeInterval(-120), // 2 minutes ago
121124
senderUser: BaseUserDTO.danielLee,
122-
eventId: mockDinnerEvent.id
125+
activityId: mockDinnerActivity.id
123126
),
124127
]
125128
),
126-
Event(
129+
Activity(
127130
id: UUID(),
128131
title: "playing basketball!!!",
129132
endTime: Date(),
@@ -133,7 +136,7 @@ extension Event {
133136
note: "let's play basketball!",
134137
creatorUser: UserDTO.danielAgapov
135138
),
136-
Event(
139+
Activity(
137140
id: UUID(),
138141
title: "Im painting rn lol",
139142
startTime: Date(),
@@ -144,7 +147,7 @@ extension Event {
144147
creatorUser: UserDTO.shannon,
145148
participantUsers: [UserDTO.danielLee]
146149
),
147-
Event(
150+
Activity(
148151
id: UUID(),
149152
title: "Grabbing Udon",
150153
startTime: Date(),
@@ -154,7 +157,7 @@ extension Event {
154157
longitude: -123.11026665974741),
155158
creatorUser: UserDTO.danielAgapov
156159
),
157-
Event(
160+
Activity(
158161
id: UUID(),
159162
title: "Calendar Party",
160163
startTime: Date(),
@@ -164,7 +167,7 @@ extension Event {
164167
longitude: -123.25036565366581),
165168
creatorUser: UserDTO.danielLee
166169
),
167-
Event(
170+
Activity(
168171
id: UUID(),
169172
title: "Gym - Leg Day",
170173
startTime: Date(),
@@ -175,4 +178,4 @@ extension Event {
175178
creatorUser: UserDTO.michael
176179
),
177180
]
178-
}
181+
}

Spawn-App-iOS-SwiftUI/Models/DTOs/Event/EventCreationDTO.swift renamed to Spawn-App-iOS-SwiftUI/Models/DTOs/Activity/ActivityCreationDTO.swift

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
//
2-
// EventCreationDTO.swift
2+
// ActivityCreationDTO.swift
33
// Spawn-App-iOS-SwiftUI
44
//
55
// Created by Daniel Agapov on 2025-02-04.
66
//
77

88
import Foundation
99

10-
// Should match `EventCreationDTO`, as written in back-end:
11-
class EventCreationDTO: Identifiable, Codable {
10+
// Should match `ActivityCreationDTO`, as written in back-end:
11+
class ActivityCreationDTO: Identifiable, Codable {
1212
var id: UUID
1313
var title: String?
1414

@@ -21,8 +21,7 @@ class EventCreationDTO: Identifiable, Codable {
2121
This is the literal emoji character, not a shortcode or description.
2222
It's rendered directly in the UI and stored as a single UTF-8 string in the database. */
2323
var icon: String?
24-
var category: EventCategory = .general
25-
var createdAt: Date?
24+
var category: ActivityCategory = .general
2625

2726
// MARK: Relations
2827
var creatorUserId: UUID
@@ -36,10 +35,9 @@ class EventCreationDTO: Identifiable, Codable {
3635
location: Location? = nil,
3736
note: String? = nil,
3837
icon: String? = nil,
39-
category: EventCategory = .general,
38+
category: ActivityCategory = .general,
4039
creatorUserId: UUID,
41-
invitedFriendUserIds: [UUID]? = nil,
42-
createdAt: Date? = nil
40+
invitedFriendUserIds: [UUID]? = nil
4341
) {
4442
self.id = id
4543
self.title = title
@@ -51,6 +49,5 @@ class EventCreationDTO: Identifiable, Codable {
5149
self.category = category
5250
self.creatorUserId = creatorUserId
5351
self.invitedFriendUserIds = invitedFriendUserIds
54-
self.createdAt = createdAt
5552
}
56-
}
53+
}

Spawn-App-iOS-SwiftUI/Models/DTOs/Event/FullFeedEventDTO.swift renamed to Spawn-App-iOS-SwiftUI/Models/DTOs/Activity/FullFeedActivityDTO.swift

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
//
2-
// FullFeedEventDTO.swift
2+
// FullFeedActivityDTO.swift
33
// Spawn-App-iOS-SwiftUI
44
//
55
// Created by Daniel Agapov on 2025-02-27.
66
//
77

8-
/// updated to match back-end's `FullFeedEventDTO`, after Shane's PR here: https://github.com/Daggerpov/Spawn-App-Back-End/pull/222/files
9-
108
import Foundation
119

12-
class FullFeedEventDTO: Identifiable, Codable, Equatable {
13-
static func == (lhs: FullFeedEventDTO, rhs: FullFeedEventDTO) -> Bool {
10+
class FullFeedActivityDTO: Identifiable, Codable, Equatable {
11+
static func == (lhs: FullFeedActivityDTO, rhs: FullFeedActivityDTO) -> Bool {
1412
return lhs.id == rhs.id
1513
}
1614

@@ -21,21 +19,21 @@ class FullFeedEventDTO: Identifiable, Codable, Equatable {
2119
var startTime: Date?
2220
var endTime: Date?
2321
var location: Location?
24-
var note: String? // this corresponds to Figma design "my place at 10? I'm cooking guys" note in event
22+
var note: String? // this corresponds to Figma design "my place at 10? I'm cooking guys" note in activity
2523
/* The icon is stored as a Unicode emoji character string (e.g. "⭐️", "🎉", "🏀").
2624
This is the literal emoji character, not a shortcode or description.
2725
It's rendered directly in the UI and stored as a single UTF-8 string in the database. */
2826
var icon: String?
29-
var category: EventCategory = .general
27+
var category: ActivityCategory = .general
3028
var createdAt: Date?
3129

3230
// MARK: Relations
3331
var creatorUser: BaseUserDTO
3432

35-
// tech note: I'll be able to check if current user is in an event's partipants to determine which symbol to show in feed
33+
// tech note: I'll be able to check if current user is in an activity's partipants to determine which symbol to show in feed
3634
var participantUsers: [BaseUserDTO]?
3735
var invitedUsers: [BaseUserDTO]?
38-
var chatMessages: [FullEventChatMessageDTO]?
36+
var chatMessages: [FullActivityChatMessageDTO]?
3937
var participationStatus: ParticipationStatus?
4038
var isSelfOwned: Bool?
4139

@@ -47,11 +45,11 @@ class FullFeedEventDTO: Identifiable, Codable, Equatable {
4745
location: Location? = nil,
4846
note: String? = nil,
4947
icon: String? = nil,
50-
category: EventCategory = .general,
48+
category: ActivityCategory = .general,
5149
creatorUser: BaseUserDTO,
5250
participantUsers: [BaseUserDTO]? = nil,
5351
invitedUsers: [BaseUserDTO]? = nil,
54-
chatMessages: [FullEventChatMessageDTO]? = nil,
52+
chatMessages: [FullActivityChatMessageDTO]? = nil,
5553
participationStatus: ParticipationStatus? = nil,
5654
isSelfOwned: Bool? = nil,
5755
createdAt: Date? = nil
@@ -74,7 +72,7 @@ class FullFeedEventDTO: Identifiable, Codable, Equatable {
7472
}
7573
}
7674

77-
extension FullFeedEventDTO {
75+
extension FullFeedActivityDTO {
7876

7977
static func dateFromTimeString(_ timeString: String) -> Date? {
8078
let dateFormatter = DateFormatter()
@@ -95,7 +93,7 @@ extension FullFeedEventDTO {
9593
return nil
9694
}
9795

98-
static let mockDinnerEvent: FullFeedEventDTO = FullFeedEventDTO(
96+
static let mockDinnerActivity: FullFeedActivityDTO = FullFeedActivityDTO(
9997
id: UUID(),
10098
title: "Dinner time!!!!!!",
10199
startTime: dateFromTimeString("10:00 PM"),
@@ -112,7 +110,7 @@ extension FullFeedEventDTO {
112110
BaseUserDTO.michael,
113111
]
114112
)
115-
static let mockSelfOwnedEvent: FullFeedEventDTO = FullFeedEventDTO(
113+
static let mockSelfOwnedActivity: FullFeedActivityDTO = FullFeedActivityDTO(
116114
id: UUID(),
117115
title: "Dinner time!!!!!!",
118116
startTime: dateFromTimeString("10:00 PM"),
@@ -130,7 +128,7 @@ extension FullFeedEventDTO {
130128
],
131129
isSelfOwned: true
132130
)
133-
static let mockSelfOwnedEvent2: FullFeedEventDTO = FullFeedEventDTO(
131+
static let mockSelfOwnedActivity2: FullFeedActivityDTO = FullFeedActivityDTO(
134132
id: UUID(),
135133
title: "Dinner time!!!!!!",
136134
startTime: dateFromTimeString("10:00 PM"),
@@ -143,4 +141,4 @@ extension FullFeedEventDTO {
143141
participantUsers: [],
144142
isSelfOwned: true
145143
)
146-
}
144+
}

0 commit comments

Comments
 (0)