Skip to content
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

[Feat] ExploreShortcutViewModel 생성 #480

Merged
merged 2 commits into from
Aug 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,11 @@ extension ExploreShortcutView {

ForEach(Array(shortcuts.enumerated()), id:\.offset) { index, shortcut in
if index < 3 {
let data = NavigationReadShortcutType(shortcutID:shortcut.id,
navigationParentView: .shortcuts)

ShortcutCell(shortcut: shortcut,
rankNumber: index + 1,
navigationParentView: .shortcuts)
.navigationLinkRouter(data: data)
.navigationLinkRouter(data: shortcut)
}
}
.background(Color.shortcutsZipBackground)
Expand All @@ -158,15 +156,11 @@ extension ExploreShortcutView {
ScrollView(.horizontal, showsIndicators: false) {
HStack {
ForEach(viewModel.fetchShortcuts(by: category).prefix(7), id: \.self) { shortcut in
let data = NavigationReadShortcutType(
shortcutID: shortcut.id,
navigationParentView: .shortcuts)

ShortcutCardCell(
categoryShortcutIcon: shortcut.sfSymbol,
categoryShortcutName: shortcut.title,
categoryShortcutColor: shortcut.color)
.navigationLinkRouter(data: data)
ShortcutCardCell(categoryShortcutIcon: shortcut.sfSymbol,
categoryShortcutName: shortcut.title,
categoryShortcutColor: shortcut.color)
.navigationLinkRouter(data: shortcut)
}
}
.padding(.horizontal, 16)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ struct ListCategoryShortcutView: View {
categoryHeader

LazyVStack(spacing: 0) {
ForEach(data.shortcuts, id: \.self) { shortcut in
ForEach(viewModel.shortcuts, id: \.self) { shortcut in

ShortcutCell(shortcut: shortcut,
navigationParentView: self.data.navigationParentView)
.navigationLinkRouter(data: shortcut)
.listRowInsets(EdgeInsets())
.listRowSeparator(.hidden)
ShortcutCell(shortcut: shortcut, navigationParentView: .shortcuts)
.navigationLinkRouter(data: shortcut)
.listRowInsets(EdgeInsets())
.listRowSeparator(.hidden)
}
}
.padding(.bottom, 44)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ struct ListShortcutView: View {
ForEach(shortcuts, id: \.self) { shortcut in

ShortcutCell(shortcut: shortcut,
sectionType: data.sectionType,
navigationParentView: data.navigationParentView)
sectionType: viewModel.sectionType,
navigationParentView: .shortcuts)
.navigationLinkRouter(data: shortcut)

}
Expand Down