Compare commits

...

3 Commits

Author SHA1 Message Date
Ching
a1e95529bf feat(View): 增加 AccountListView
增加 AccountListView

Signed-off-by: Ching <loooching@gmail.com>
2023-05-04 21:02:38 +08:00
Ching
241aca5f23 feat(Component): 增加 InstanceInfo 组件
增加 InstanceInfo 组件

Signed-off-by: Ching <loooching@gmail.com>
2023-05-03 21:47:38 +08:00
Ching
f07fcf9d9b feat(View): 添加 AddAccountView
添加 AddAccountView

Signed-off-by: Ching <loooching@gmail.com>
2023-05-03 21:08:30 +08:00
5 changed files with 229 additions and 5 deletions

View File

@ -11,6 +11,9 @@
24A07CD22A026DDA00F4ECA8 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A07CD12A026DDA00F4ECA8 /* ContentView.swift */; };
24A07CD42A026DDB00F4ECA8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 24A07CD32A026DDB00F4ECA8 /* Assets.xcassets */; };
24A07CD82A026DDB00F4ECA8 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 24A07CD72A026DDB00F4ECA8 /* Preview Assets.xcassets */; };
24A07CE92A02730700F4ECA8 /* AddAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A07CE82A02730700F4ECA8 /* AddAccountView.swift */; };
24A07CEB2A029C6A00F4ECA8 /* InstanceInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A07CEA2A029C6A00F4ECA8 /* InstanceInfo.swift */; };
24A07CED2A029DF200F4ECA8 /* AccountListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24A07CEC2A029DF200F4ECA8 /* AccountListView.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@ -20,6 +23,9 @@
24A07CD32A026DDB00F4ECA8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
24A07CD52A026DDB00F4ECA8 /* duduji.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = duduji.entitlements; sourceTree = "<group>"; };
24A07CD72A026DDB00F4ECA8 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
24A07CE82A02730700F4ECA8 /* AddAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddAccountView.swift; sourceTree = "<group>"; };
24A07CEA2A029C6A00F4ECA8 /* InstanceInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstanceInfo.swift; sourceTree = "<group>"; };
24A07CEC2A029DF200F4ECA8 /* AccountListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountListView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -52,11 +58,15 @@
24A07CCE2A026DDA00F4ECA8 /* duduji */ = {
isa = PBXGroup;
children = (
24A07CCF2A026DDA00F4ECA8 /* dudujiApp.swift */,
24A07CD12A026DDA00F4ECA8 /* ContentView.swift */,
24A07CD32A026DDB00F4ECA8 /* Assets.xcassets */,
24A07CD52A026DDB00F4ECA8 /* duduji.entitlements */,
24A07CE02A02702800F4ECA8 /* Core */,
24A07CE12A02703300F4ECA8 /* Extensions */,
24A07CDE2A02701A00F4ECA8 /* Model */,
24A07CDF2A02702200F4ECA8 /* Service */,
24A07CD62A026DDB00F4ECA8 /* Preview Content */,
24A07CD32A026DDB00F4ECA8 /* Assets.xcassets */,
24A07CD12A026DDA00F4ECA8 /* ContentView.swift */,
24A07CCF2A026DDA00F4ECA8 /* dudujiApp.swift */,
24A07CD52A026DDB00F4ECA8 /* duduji.entitlements */,
);
path = duduji;
sourceTree = "<group>";
@ -69,6 +79,69 @@
path = "Preview Content";
sourceTree = "<group>";
};
24A07CDE2A02701A00F4ECA8 /* Model */ = {
isa = PBXGroup;
children = (
);
path = Model;
sourceTree = "<group>";
};
24A07CDF2A02702200F4ECA8 /* Service */ = {
isa = PBXGroup;
children = (
);
path = Service;
sourceTree = "<group>";
};
24A07CE02A02702800F4ECA8 /* Core */ = {
isa = PBXGroup;
children = (
24A07CE42A02714000F4ECA8 /* Authentication */,
24A07CE32A02709900F4ECA8 /* Components */,
);
path = Core;
sourceTree = "<group>";
};
24A07CE12A02703300F4ECA8 /* Extensions */ = {
isa = PBXGroup;
children = (
);
path = Extensions;
sourceTree = "<group>";
};
24A07CE32A02709900F4ECA8 /* Components */ = {
isa = PBXGroup;
children = (
24A07CEA2A029C6A00F4ECA8 /* InstanceInfo.swift */,
);
path = Components;
sourceTree = "<group>";
};
24A07CE42A02714000F4ECA8 /* Authentication */ = {
isa = PBXGroup;
children = (
24A07CE72A02716200F4ECA8 /* ViewModels */,
24A07CE52A02715800F4ECA8 /* Views */,
);
path = Authentication;
sourceTree = "<group>";
};
24A07CE52A02715800F4ECA8 /* Views */ = {
isa = PBXGroup;
children = (
24A07CE82A02730700F4ECA8 /* AddAccountView.swift */,
24A07CEC2A029DF200F4ECA8 /* AccountListView.swift */,
);
path = Views;
sourceTree = "<group>";
};
24A07CE72A02716200F4ECA8 /* ViewModels */ = {
isa = PBXGroup;
children = (
);
path = ViewModels;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -141,6 +214,9 @@
files = (
24A07CD22A026DDA00F4ECA8 /* ContentView.swift in Sources */,
24A07CD02A026DDA00F4ECA8 /* dudujiApp.swift in Sources */,
24A07CEB2A029C6A00F4ECA8 /* InstanceInfo.swift in Sources */,
24A07CE92A02730700F4ECA8 /* AddAccountView.swift in Sources */,
24A07CED2A029DF200F4ECA8 /* AccountListView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -0,0 +1,60 @@
//
// AccountListView.swift
// duduji
//
// Created by ching on 2023/5/3.
//
import SwiftUI
struct AccountListView: View {
var body: some View {
NavigationView {
Form {
Section {
HStack {
ZStack {
RoundedRectangle(cornerRadius: 3)
.frame(width: 50, height: 50)
Image(systemName: "checkmark.circle.fill")
.foregroundColor(.green)
.offset(x: 15, y: -15)
.font(.title)
}
VStack(alignment: .leading) {
Text("科代")
.font(.title3)
Text(verbatim: "kedai@nofan.xyz")
.textContentType(.none)
.font(.subheadline)
.foregroundColor(.gray)
}
}
}
Section {
Button {
//
} label: {
Label("添加账户", systemImage: "person.badge.plus")
}
Button {
//
} label: {
Label("设置", systemImage: "gear")
}
}
}
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button("123") {}
}
}
}
}
}
struct AccountListView_Previews: PreviewProvider {
static var previews: some View {
AccountListView()
}
}

View File

@ -0,0 +1,44 @@
//
// AddAccountView.swift
// duduji
//
// Created by ching on 2023/5/3.
//
import SwiftUI
struct AddAccountView: View {
@State private var instanceAddress = "nofan.xyz"
var body: some View {
NavigationStack {
Form {
Section {
TextField("", text: $instanceAddress)
.keyboardType(.URL)
.textContentType(.URL)
.textInputAutocapitalization(.never)
.autocorrectionDisabled()
}
Section {
Button("登录") {
print("DEBUG: login button")
}
.foregroundColor(.white)
.frame(maxWidth: .infinity) // 使
}
.listRowBackground(Color.green)
InstanceInfoSection()
}
}
.navigationTitle("添加账户")
.navigationBarTitleDisplayMode(.inline)
}
}
struct AddAccountView_Previews: PreviewProvider {
static var previews: some View {
AddAccountView()
}
}

View File

@ -0,0 +1,43 @@
//
// InstanceInfo.swift
// duduji
//
// Created by ching on 2023/5/3.
//
import SwiftUI
struct InstanceInfo: View {
var body: some View {
Form {
InstanceInfoSection()
}
}
}
struct InstanceInfoSection: View {
var body: some View {
Section("服务器信息") {
LabeledContent("名称", value: "nofan | Fanyou in Mastodon")
Text("给饭友的自留地")
LabeledContent("邮件", value: "^^")
LabeledContent("版本") {
Text("3.5.3").monospaced()
}
LabeledContent("用户", value: "1206")
LabeledContent("嘟文", value: "489974")
LabeledContent("域名", value: "11648")
}
Section("服务器规则") {
Text("保持友善,善用折叠屏蔽功能")
Text("不鼓励发布色情暴力内容,如发布,务必主动标记为敏感内容")
Text("请尽量避免将用户消息截图转发至其他平台")
}
}
}
struct InstanceInfo_Previews: PreviewProvider {
static var previews: some View {
InstanceInfo()
}
}

View File

@ -11,7 +11,8 @@ import SwiftUI
struct dudujiApp: App {
var body: some Scene {
WindowGroup {
ContentView()
// ContentView()
AccountListView()
}
}
}