Skip to content

Commit 809aa94

Browse files
committed
add avatars to other topics
1 parent 6402da1 commit 809aa94

File tree

6 files changed

+43
-42
lines changed

6 files changed

+43
-42
lines changed

V2exOS.xcodeproj/project.pbxproj

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
0D033B3E288D0FF700129C9B /* SidebarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D033B3D288D0FF700129C9B /* SidebarView.swift */; };
1414
0D033B40288D140C00129C9B /* TopicListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D033B3F288D140C00129C9B /* TopicListView.swift */; };
1515
0D033B42288D15CF00129C9B /* TopicDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D033B41288D15CF00129C9B /* TopicDetailView.swift */; };
16-
0D12614A28A94AA3009DBCE2 /* V2exAPI in Frameworks */ = {isa = PBXBuildFile; productRef = 0D12614928A94AA3009DBCE2 /* V2exAPI */; };
1716
0D139DE228E7E06C00E4CF88 /* UserName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D139DE128E7E06C00E4CF88 /* UserName.swift */; };
1817
0D40378C28E6E4EA00B1A341 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D40378B28E6E4EA00B1A341 /* SettingsView.swift */; };
1918
0D40378E28E6E4F500B1A341 /* ProxyHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D40378D28E6E4F500B1A341 /* ProxyHelper.swift */; };
@@ -28,6 +27,7 @@
2827
0DA3F3A728A412FE00E7224D /* CurrentUserStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DA3F3A628A412FE00E7224D /* CurrentUserStore.swift */; };
2928
0DF3300E28A55DEA00AEF312 /* InboxListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DF3300D28A55DEA00AEF312 /* InboxListView.swift */; };
3029
0DF3301028A56A3600AEF312 /* StringExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DF3300F28A56A3600AEF312 /* StringExt.swift */; };
30+
109A0137290A8A7400CFE602 /* V2exAPI in Frameworks */ = {isa = PBXBuildFile; productRef = 109A0136290A8A7400CFE602 /* V2exAPI */; };
3131
/* End PBXBuildFile section */
3232

3333
/* Begin PBXFileReference section */
@@ -51,6 +51,7 @@
5151
0DA4235228E3585C005BD63F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
5252
0DF3300D28A55DEA00AEF312 /* InboxListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboxListView.swift; sourceTree = "<group>"; };
5353
0DF3300F28A56A3600AEF312 /* StringExt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringExt.swift; sourceTree = "<group>"; };
54+
109A0135290A875700CFE602 /* V2exAPI */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = V2exAPI; path = ../V2exAPI; sourceTree = "<group>"; };
5455
/* End PBXFileReference section */
5556

5657
/* Begin PBXFrameworksBuildPhase section */
@@ -60,7 +61,7 @@
6061
files = (
6162
0DA3F3A428A411ED00E7224D /* KeychainAccess in Frameworks */,
6263
0D8F3356288D245300C27AF1 /* Kingfisher in Frameworks */,
63-
0D12614A28A94AA3009DBCE2 /* V2exAPI in Frameworks */,
64+
109A0137290A8A7400CFE602 /* V2exAPI in Frameworks */,
6465
0D8F3353288D243A00C27AF1 /* MarkdownUI in Frameworks */,
6566
);
6667
runOnlyForDeploymentPostprocessing = 0;
@@ -71,6 +72,7 @@
7172
0D033B19288CD64500129C9B = {
7273
isa = PBXGroup;
7374
children = (
75+
109A0134290A875700CFE602 /* Packages */,
7476
0D033B24288CD64500129C9B /* V2exOS */,
7577
0D033B23288CD64500129C9B /* Products */,
7678
0D033B43288D162400129C9B /* Frameworks */,
@@ -174,6 +176,14 @@
174176
path = TopicList;
175177
sourceTree = "<group>";
176178
};
179+
109A0134290A875700CFE602 /* Packages */ = {
180+
isa = PBXGroup;
181+
children = (
182+
109A0135290A875700CFE602 /* V2exAPI */,
183+
);
184+
name = Packages;
185+
sourceTree = "<group>";
186+
};
177187
/* End PBXGroup section */
178188

179189
/* Begin PBXNativeTarget section */
@@ -194,7 +204,7 @@
194204
0D8F3352288D243A00C27AF1 /* MarkdownUI */,
195205
0D8F3355288D245300C27AF1 /* Kingfisher */,
196206
0DA3F3A328A411ED00E7224D /* KeychainAccess */,
197-
0D12614928A94AA3009DBCE2 /* V2exAPI */,
207+
109A0136290A8A7400CFE602 /* V2exAPI */,
198208
);
199209
productName = V2exOS;
200210
productReference = 0D033B22288CD64500129C9B /* V2exOS.app */;
@@ -228,7 +238,6 @@
228238
0D8F3351288D243A00C27AF1 /* XCRemoteSwiftPackageReference "MarkdownUI" */,
229239
0D8F3354288D245300C27AF1 /* XCRemoteSwiftPackageReference "Kingfisher" */,
230240
0DA3F3A228A411ED00E7224D /* XCRemoteSwiftPackageReference "KeychainAccess" */,
231-
0D12614828A94963009DBCE2 /* XCRemoteSwiftPackageReference "V2exAPI" */,
232241
);
233242
productRefGroup = 0D033B23288CD64500129C9B /* Products */;
234243
projectDirPath = "";
@@ -401,13 +410,13 @@
401410
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
402411
CODE_SIGN_ENTITLEMENTS = V2exOS/V2exOS.entitlements;
403412
CODE_SIGN_IDENTITY = "Apple Development";
404-
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
405-
CODE_SIGN_STYLE = Automatic;
413+
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
414+
CODE_SIGN_STYLE = Manual;
406415
COMBINE_HIDPI_IMAGES = YES;
407416
CURRENT_PROJECT_VERSION = 1;
408417
DEAD_CODE_STRIPPING = YES;
409418
DEVELOPMENT_ASSET_PATHS = "\"V2exOS/Preview Content\"";
410-
DEVELOPMENT_TEAM = S4XH6LVQ6A;
419+
DEVELOPMENT_TEAM = "";
411420
ENABLE_HARDENED_RUNTIME = YES;
412421
ENABLE_PREVIEWS = YES;
413422
GENERATE_INFOPLIST_FILE = YES;
@@ -435,13 +444,13 @@
435444
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
436445
CODE_SIGN_ENTITLEMENTS = V2exOS/V2exOS.entitlements;
437446
CODE_SIGN_IDENTITY = "Apple Development";
438-
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
439-
CODE_SIGN_STYLE = Automatic;
447+
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
448+
CODE_SIGN_STYLE = Manual;
440449
COMBINE_HIDPI_IMAGES = YES;
441450
CURRENT_PROJECT_VERSION = 1;
442451
DEAD_CODE_STRIPPING = YES;
443452
DEVELOPMENT_ASSET_PATHS = "\"V2exOS/Preview Content\"";
444-
DEVELOPMENT_TEAM = S4XH6LVQ6A;
453+
DEVELOPMENT_TEAM = "";
445454
ENABLE_HARDENED_RUNTIME = YES;
446455
ENABLE_PREVIEWS = YES;
447456
GENERATE_INFOPLIST_FILE = YES;
@@ -486,14 +495,6 @@
486495
/* End XCConfigurationList section */
487496

488497
/* Begin XCRemoteSwiftPackageReference section */
489-
0D12614828A94963009DBCE2 /* XCRemoteSwiftPackageReference "V2exAPI" */ = {
490-
isa = XCRemoteSwiftPackageReference;
491-
repositoryURL = "https://github.com/isaced/V2exAPI.git";
492-
requirement = {
493-
kind = upToNextMajorVersion;
494-
minimumVersion = 1.0.3;
495-
};
496-
};
497498
0D8F3351288D243A00C27AF1 /* XCRemoteSwiftPackageReference "MarkdownUI" */ = {
498499
isa = XCRemoteSwiftPackageReference;
499500
repositoryURL = "https://github.com/gonzalezreal/MarkdownUI";
@@ -521,11 +522,6 @@
521522
/* End XCRemoteSwiftPackageReference section */
522523

523524
/* Begin XCSwiftPackageProductDependency section */
524-
0D12614928A94AA3009DBCE2 /* V2exAPI */ = {
525-
isa = XCSwiftPackageProductDependency;
526-
package = 0D12614828A94963009DBCE2 /* XCRemoteSwiftPackageReference "V2exAPI" */;
527-
productName = V2exAPI;
528-
};
529525
0D8F3352288D243A00C27AF1 /* MarkdownUI */ = {
530526
isa = XCSwiftPackageProductDependency;
531527
package = 0D8F3351288D243A00C27AF1 /* XCRemoteSwiftPackageReference "MarkdownUI" */;
@@ -541,6 +537,10 @@
541537
package = 0DA3F3A228A411ED00E7224D /* XCRemoteSwiftPackageReference "KeychainAccess" */;
542538
productName = KeychainAccess;
543539
};
540+
109A0136290A8A7400CFE602 /* V2exAPI */ = {
541+
isa = XCSwiftPackageProductDependency;
542+
productName = V2exAPI;
543+
};
544544
/* End XCSwiftPackageProductDependency section */
545545
};
546546
rootObject = 0D033B1A288CD64500129C9B /* Project object */;

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

Lines changed: 4 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

V2exOS/Utils/PreviewData.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import Foundation
99
import V2exAPI
1010

11+
12+
13+
1114
struct PreviewData {
1215
static let member = V2Member(id: 79764,
1316
username: "ljsh093",

V2exOS/Utils/StringExt.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Foundation
1010
extension String {
1111
func htmlToString() -> String? {
1212
do {
13+
1314
let text = try NSAttributedString(data: self.data(using: .unicode)!,
1415
options: [.documentType: NSAttributedString.DocumentType.html],
1516
documentAttributes: nil).string

V2exOS/Views/SidebarView.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ struct SidebarView: View {
1414
@EnvironmentObject private var currentUser: CurrentUserStore
1515

1616
@State var nodeList : [V2Node]?
17-
@State var isLoading = true
17+
@State var isLoading = true
1818

1919
var body: some View {
2020
List() {
2121

2222
Section(header: Text("Home")) {
23+
NavigationLink(destination: TopicListView(nodeName: "HOT")) {
24+
Label("最热", systemImage: "flame")
25+
}
2326
NavigationLink(destination: TopicListView(nodeName: "ALL")) {
24-
Label("全部", systemImage: "chart.bar")
27+
Label("最新", systemImage: "chart.bar")
2528
}
2629
}
2730

V2exOS/Views/TopicList/TopicListView.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Kingfisher
1212
struct TopicListView: View {
1313

1414
var nodeName: String
15-
var node: V2Node?
15+
// var node: V2Node?
1616

1717
@State var isLoading = true
1818
@State var topics: [V2Topic]?
@@ -32,7 +32,7 @@ struct TopicListView: View {
3232
TopicListCellView(topic: topic)
3333
}
3434

35-
if topics.count > 0 && nodeName != "ALL" {
35+
if topics.count > 0 && nodeName != "ALL" && nodeName != "HOT" {
3636
ProgressView()
3737
.onAppear {
3838
Task {
@@ -76,14 +76,17 @@ struct TopicListView: View {
7676

7777
if nodeName == "ALL" {
7878
topics = try await v2ex.latestTopics()
79-
}else{
79+
} else if nodeName == "HOT" {
80+
topics = try await v2ex.hotTopics()
81+
82+
} else {
8083
topics = try await v2ex.topics(nodeName: nodeName, page: page)?.result
8184
_node = try await v2ex.nodesShow(name: nodeName)
8285
}
8386

8487
if page == 1 {
8588
self.topics = topics
86-
}else{
89+
} else {
8790
self.page = page
8891
if let topics = topics {
8992
self.topics?.append(contentsOf: topics)

0 commit comments

Comments
 (0)