Skip to content

Commit b9b7193

Browse files
authored
Merge pull request #185 from makinosp/develop
Develop
2 parents 51fde2d + b5515d2 commit b9b7193

File tree

6 files changed

+43
-19
lines changed

6 files changed

+43
-19
lines changed

Harmonie.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

harmonie/Components/IconSet.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ enum IconSet {
7272
static var logout: some Iconizable {
7373
Icon("rectangle.portrait.and.arrow.forward")
7474
}
75+
static var platform: some Iconizable {
76+
Icon("square.stack.3d.up")
77+
}
7578
static var plusCircleFilled: some Iconizable {
7679
Icon("plus.circle.fill")
7780
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// Favorite.swift
3+
// Harmonie
4+
//
5+
// Created by makinosp on 2024/11/04.
6+
//
7+
8+
import Foundation
9+
import VRCKit
10+
11+
extension PreviewData {
12+
static let favoriteGroups = FavoriteType.allCases.flatMap { type in
13+
(1...3).map { number in
14+
FavoriteGroup(
15+
id: "fvgrp_\(UUID().uuidString)",
16+
displayName: "\(type.rawValue.capitalized) Group \(number)",
17+
name: "group_\(number)",
18+
ownerId: PreviewData.shared.previewUser.id,
19+
tags: [],
20+
type: type,
21+
visibility: .private
22+
)
23+
}
24+
}
25+
}

harmonie/Previews/Models/Instance.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private extension Instance {
4343
name: world.name,
4444
ownerId: "usr_\(UUID().uuidString)",
4545
permanent: false,
46-
platforms: Platforms(),
46+
platforms: Platforms([.android, .standalonewindows]),
4747
recommendedCapacity: capacity,
4848
region: Region.allCases.randomElement() ?? .us,
4949
tags: [],

harmonie/Previews/Services/WorldPreviewService.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ final actor WorldPreviewService: APIService, WorldServiceProtocol {
1818
}
1919

2020
func fetchFavoritedWorlds() async throws -> [FavoriteWorld] {
21-
(0..<100).map { number in
21+
[PreviewData.casino, PreviewData.nightCity, PreviewData.chinatown].map { world in
2222
FavoriteWorld(
23-
world: PreviewData.casino,
23+
world: world,
2424
favoriteId: "fvrt_\(UUID())",
25-
favoriteGroup: number.description
25+
favoriteGroup: PreviewData.favoriteGroups[0].name
2626
)
2727
}
2828
}

harmonie/Views/World/WorldView.swift

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,16 @@ struct WorldView: View {
3636
}
3737

3838
private var topOverlay: some View {
39-
Label {
40-
Text(world.platform.description)
41-
} icon: {
42-
Image(systemName: "vision.pro.fill")
43-
}
44-
.font(.footnote.bold())
45-
.padding(.horizontal, 12)
46-
.padding(.vertical, 4)
47-
.background(.thinMaterial)
48-
.cornerRadius(8)
49-
.foregroundStyle(.white)
50-
.frame(maxWidth: .infinity, alignment: .trailing)
51-
.padding(.vertical, 8)
52-
.padding(.horizontal, 12)
39+
Label(world.platform.description, systemImage: IconSet.platform.systemName)
40+
.font(.footnote.bold())
41+
.padding(.horizontal, 12)
42+
.padding(.vertical, 4)
43+
.background(.thinMaterial)
44+
.cornerRadius(8)
45+
.foregroundStyle(.white)
46+
.frame(maxWidth: .infinity, alignment: .trailing)
47+
.padding(.vertical, 8)
48+
.padding(.horizontal, 12)
5349
}
5450

5551
private var bottomOverlay: some View {

0 commit comments

Comments
 (0)