-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(iosApp): add partners activities screens.
- Loading branch information
1 parent
24a7e56
commit 9431af0
Showing
10 changed files
with
161 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+25.8 KB
(110%)
...oj/project.xcworkspace/xcuserdata/mac-GPALIG05.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// ActivityItemView.swift | ||
// iosApp | ||
// | ||
// Created by Gérard PALIGOT on 04/12/2024. | ||
// Copyright © 2024 orgName. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import SharedDi | ||
|
||
struct ActivityItemView: View { | ||
var activity: ActivityUi | ||
var titleColor: Color = Color.c4hOnBackground | ||
var titleTextStyle: Font = Font.title3 | ||
|
||
var body: some View { | ||
VStack(alignment: .leading) { | ||
Text(activity.activityName) | ||
.foregroundColor(titleColor) | ||
.font(titleTextStyle) | ||
HStack { | ||
TagUnStyledView( | ||
text: activity.startTime, | ||
icon: "clock" | ||
) | ||
TagUnStyledView( | ||
text: activity.partnerName, | ||
icon: "suitcase" | ||
) | ||
} | ||
} | ||
.frame(maxWidth: .infinity, alignment: .topLeading) | ||
} | ||
} | ||
|
||
#Preview { | ||
ActivityItemView( | ||
activity: ActivityUi.companion.fake | ||
) | ||
.padding() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// PartnerListView.swift | ||
// iosApp | ||
// | ||
// Created by Gérard PALIGOT on 04/12/2024. | ||
// Copyright © 2024 orgName. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import SharedDi | ||
|
||
struct PartnerListView: View { | ||
let partners: PartnerGroupsUi | ||
let horizontalSpacing: CGFloat = 16 | ||
let maxItems: Int = 3 | ||
|
||
var body: some View { | ||
GeometryReader { geometry in | ||
let parentWidth = geometry.size.width - (self.horizontalSpacing * 2) | ||
ScrollView { | ||
LazyVStack(spacing: 8) { | ||
ForEach(partners.groups, id: \.type) { partnerGroup in | ||
Section { | ||
LazyVGrid(columns: [GridItem(.adaptive(minimum: parentWidth)), GridItem(.adaptive(minimum: parentWidth)), GridItem(.adaptive(minimum: parentWidth))], content: { | ||
ForEach(partnerGroup.partners, id: \.id) { partner in | ||
PartnerItemNavigation(partner: partner) | ||
} | ||
}) | ||
} header : { | ||
PartnerDividerView(text: partnerGroup.type) | ||
.padding(.horizontal, self.horizontalSpacing) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
PartnerListView(partners: PartnerGroupsUi.companion.fake) | ||
.environmentObject(ViewModelFactory()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
iosApp/iosApp/screens/partners/PartnersActivitiesView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// PartnersActivitiesView.swift | ||
// iosApp | ||
// | ||
// Created by Gérard PALIGOT on 04/12/2024. | ||
// Copyright © 2024 orgName. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import SharedDi | ||
|
||
struct PartnersActivitiesView: View { | ||
var activities: [String: [ActivityUi]] | ||
|
||
var body: some View { | ||
List { | ||
ForEach(activities.keys.sorted(), id: \.self) { time in | ||
Section { | ||
let activities = activities[time]! | ||
ForEach(0..<activities.count, id: \.self) { index in | ||
let activity = activities[index] | ||
ActivityItemView(activity: activity) | ||
} | ||
} header: { | ||
Text(time) | ||
.accessibilityLabel(toSpelloutAccessibleTime(time: time)) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
PartnersActivitiesView( | ||
activities: [ | ||
"09:00": [ | ||
ActivityUi.companion.fake | ||
], | ||
"10:00": [ | ||
ActivityUi.companion.fake | ||
] | ||
] | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters