-
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/445 stretchfield #603
Changes from 7 commits
441bcc0
8c9a4a1
b9b5c79
a903966
d1969a6
325766f
b07adb0
f42a6b4
4ef7e99
66b245b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -95,9 +95,9 @@ struct TimetableListView: View { | |||||
ForEach(store.timetableItems, id: \.self) { item in | ||||||
TimeGroupMiniList(contents: item, onItemTap: { item in | ||||||
store.send(.view(.timetableItemTapped(item))) | ||||||
}) { | ||||||
}, onFavoriteTap: { | ||||||
store.send(.view(.favoriteTapped($0))) | ||||||
} | ||||||
}) | ||||||
} | ||||||
}.scrollContentBackground(.hidden) | ||||||
.onAppear { | ||||||
|
@@ -130,6 +130,7 @@ struct TimetableGridView: View { | |||||
.frame(width: 192) | ||||||
} | ||||||
} | ||||||
|
||||||
ForEach(store.timetableItems, id: \.self) { timeBlock in | ||||||
GridRow { | ||||||
VStack { | ||||||
|
@@ -138,17 +139,27 @@ struct TimetableGridView: View { | |||||
|
||||||
}.frame(height: 153) | ||||||
|
||||||
ForEach(rooms, id: \.self) { room in | ||||||
if (timeBlock.items.count == 1 && timeBlock.isTopLunch()) { | ||||||
|
||||||
timeBlock.getCellForRoom( | ||||||
room: RoomType.roomJ, | ||||||
cellCount: 5, | ||||||
onTap: { item in | ||||||
store.send(.view(.timetableItemTapped(item))) | ||||||
}).gridCellColumns(5) | ||||||
|
||||||
if let cell = timeBlock.getCellForRoom(room: room, onTap: { item in | ||||||
store.send(.view(.timetableItemTapped(item)))}) { | ||||||
cell | ||||||
} else { | ||||||
Color.clear | ||||||
.frame(maxWidth: .infinity) | ||||||
.padding(12) | ||||||
.frame(width: 192, height: 153) | ||||||
.background(Color.clear, in: RoundedRectangle(cornerRadius: 4)) | ||||||
} else { | ||||||
ForEach(rooms, id: \.self) { room in | ||||||
if let cell = timeBlock.getCellForRoom(room: room, onTap: { item in | ||||||
store.send(.view(.timetableItemTapped(item)))}) { | ||||||
cell | ||||||
} else { | ||||||
Color.clear | ||||||
.frame(maxWidth: .infinity) | ||||||
.padding(12) | ||||||
.frame(width: 192, height: 153) | ||||||
.background(Color.clear, in: RoundedRectangle(cornerRadius: 4)) | ||||||
} | ||||||
} | ||||||
} | ||||||
} | ||||||
|
@@ -265,9 +276,9 @@ extension RoomType { | |||||
} | ||||||
|
||||||
extension TimetableTimeGroupItems { | ||||||
func getCellForRoom(room: RoomType, onTap: @escaping (TimetableItemWithFavorite) -> Void) -> TimetableGridCard? { | ||||||
func getCellForRoom(room: RoomType, cellCount: Int?=1, onTap: @escaping (TimetableItemWithFavorite) -> Void) -> TimetableGridCard? { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I might be wrong, but I think the intended change is removing "?=1" not the Int part... correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry it's wrong😅
is correct👍 |
||||||
return if let cell = getItem(for: room) { | ||||||
TimetableGridCard(timetableItem: cell.timetableItem) { timetableItem in | ||||||
TimetableGridCard(timetableItem: cell.timetableItem, cellCount: cellCount ?? 1) { timetableItem in | ||||||
onTap(cell) | ||||||
} | ||||||
} else { | ||||||
|
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.
you have
?? 1
is never used used warning yet.you should remove it👍