-
Notifications
You must be signed in to change notification settings - Fork 200
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
Feature/timetable feature grid2 #367
Merged
Merged
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
6be1dfa
WIP
charles-b-stb ab2c5e5
Merge branch 'main' of github.com:DroidKaigi/conference-app-2024 into…
charles-b-stb 3d84fe1
wip
charles-b-stb 42a0f8f
Grid showing, data not displayable yet.
charles-b-stb a8ec52f
Very basic grid in operation. Still needs to fix click operation. Sti…
charles-b-stb 398d589
Code cleanup
charles-b-stb 16190a5
Update app-ios/Sources/CommonComponents/Timetable/TimetableGridCard.s…
charles-b-stb 3ec6e7f
Fixes as per pull request comments.
charles-b-stb 7ce2c62
Merge branch 'main' of github.com:DroidKaigi/conference-app-2024 into…
charles-b-stb 3458ce9
Merge branch 'main' of github.com:DroidKaigi/conference-app-2024 into…
charles-b-stb 0c5fac1
Fixed build with suggestions.
charles-b-stb 404fec3
Merge branch 'main' of github.com:DroidKaigi/conference-app-2024 into…
charles-b-stb 7ef8e12
Update app-ios/Sources/TimetableFeature/TimetableListView.swift
charles-b-stb 01a633e
Update app-ios/Sources/CommonComponents/Timetable/TimetableGridCard.s…
charles-b-stb c75137c
Update app-ios/Sources/CommonComponents/Timetable/TimetableGridCard.s…
charles-b-stb 1085d24
Update app-ios/Sources/CommonComponents/Timetable/TimetableGridCard.s…
charles-b-stb 38eaa49
Fixed various issues.
charles-b-stb 34c3e46
Merge branch 'feature/timetable-feature-grid2' of github.com:DroidKai…
charles-b-stb f201358
Fixed various issues that came up during pull request.
charles-b-stb 2a8d3eb
Merge branch 'main' of github.com:DroidKaigi/conference-app-2024 into…
charles-b-stb 0900ab1
Merge branch 'main' into feature/timetable-feature-grid2
charles-b-stb f48e5ba
Replaced Spacer with Color as per PR comment
charles-b-stb 2563d07
Merge branch 'feature/timetable-feature-grid2' of github.com:DroidKai…
charles-b-stb ab85531
Update app-ios/Sources/TimetableFeature/TimetableListView.swift
charles-b-stb bdf3b12
Update app-ios/Sources/CommonComponents/Timetable/TimetableGridCard.s…
charles-b-stb 348203e
Update app-ios/Sources/TimetableFeature/TimetableDataItems.swift
charles-b-stb b39f2d6
Fixed items broken by pullrequest suggest commits.
charles-b-stb 16262aa
Moved GridItem back into the Timetable module.
charles-b-stb 45d96ec
Rewrote to move clear outside TimetableGridCard
charles-b-stb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
app-ios/Sources/CommonComponents/Timetable/TimetableGridCard.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,86 @@ | ||
import Foundation | ||
import SwiftUI | ||
import Theme | ||
import class shared.TimetableItem | ||
|
||
public struct TimetableGridCard: View { | ||
let timetableItem: TimetableItem? | ||
let onTap: (TimetableItem) -> Void | ||
|
||
public init( | ||
timetableItem: TimetableItem?, | ||
onTap: @escaping (TimetableItem) -> Void | ||
) { | ||
self.timetableItem = timetableItem | ||
self.onTap = onTap | ||
} | ||
|
||
public var body: some View { | ||
if let timetableItem { | ||
Button { | ||
onTap(timetableItem) | ||
} label: { | ||
VStack(alignment: .leading, spacing: 8) { | ||
HStack(spacing: 4) { | ||
timetableItem.room.type.shape | ||
.foregroundStyle(timetableItem.room.roomTheme.primaryColor) | ||
Text("\(timetableItem.startsTimeString) - \(timetableItem.endsTimeString)") | ||
.textStyle(.labelMedium) | ||
.foregroundStyle(timetableItem.room.roomTheme.primaryColor) | ||
Spacer() | ||
} | ||
|
||
Text(timetableItem.title.currentLangTitle) | ||
.textStyle(.titleMedium) | ||
.foregroundStyle(timetableItem.room.roomTheme.primaryColor) | ||
.multilineTextAlignment(.leading) | ||
|
||
Spacer() | ||
|
||
ForEach(timetableItem.speakers, id: \.id) { speaker in | ||
HStack(spacing: 8) { | ||
Group { | ||
AsyncImage(url: URL(string: speaker.iconUrl)) { | ||
$0.resizable() | ||
} placeholder: { | ||
Color.gray | ||
} | ||
} | ||
.frame(width: 32, height: 32) | ||
.clipShape(Circle()) | ||
|
||
Text(speaker.name) | ||
.textStyle(.titleSmall) | ||
.foregroundStyle(AssetColors.Surface.onSurfaceVariant.swiftUIColor) | ||
.lineLimit(1) | ||
} | ||
} | ||
} | ||
.frame(maxWidth: .infinity) | ||
.padding(12) | ||
.frame(width: 192, height: 153) | ||
.background(timetableItem.room.roomTheme.containerColor, in: RoundedRectangle(cornerRadius: 4)) | ||
.overlay(RoundedRectangle(cornerRadius: 4).stroke(timetableItem.room.roomTheme.primaryColor, lineWidth: 1)) | ||
} | ||
} else { | ||
Color.clear | ||
.frame(maxWidth: .infinity) | ||
.padding(12) | ||
.frame(width: 192, height: 153) | ||
.background(Color.clear, in: RoundedRectangle(cornerRadius: 4)) | ||
charles-b-stb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
} | ||
} | ||
|
||
#Preview { | ||
VStack { | ||
TimetableGridCard( | ||
timetableItem: TimetableItem.Session.companion.fake(), | ||
onTap: { _ in } | ||
) | ||
.padding(.horizontal, 16) | ||
} | ||
.frame(maxWidth: .infinity, maxHeight: .infinity) | ||
.background(Color.black) | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This view isn't common component I think.
you should move to Timetable package please🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved it, but it did require me to make one shared class between the card classes public (it was package before)