feat: mrmory页面布局

This commit is contained in:
jinyaqiu 2025-08-29 20:57:00 +08:00
parent 96e58806d4
commit 0c75e1b446

View File

@ -61,6 +61,7 @@ enum MemoryMediaType: Equatable {
} }
struct MemoriesView: View { struct MemoriesView: View {
@Environment(\.dismiss) private var dismiss
@State private var memories: [MemoryItem] = [] @State private var memories: [MemoryItem] = []
@State private var isLoading = false @State private var isLoading = false
@State private var errorMessage: String? @State private var errorMessage: String?
@ -72,6 +73,27 @@ struct MemoriesView: View {
var body: some View { var body: some View {
NavigationView { NavigationView {
VStack(spacing: 0) {
//
HStack {
Button(action: {
//
self.dismiss()
}) {
Image(systemName: "chevron.left")
.foregroundColor(.themeTextMessageMain)
.font(.system(size: 20))
}
Spacer()
Text("My Memories")
.foregroundColor(.themeTextMessageMain)
.font(Typography.font(for: .body, family: .quicksandBold))
Spacer()
}
.padding()
.background(Color.themeTextWhiteSecondary)
//
ZStack { ZStack {
Color.themeTextWhiteSecondary.ignoresSafeArea() Color.themeTextWhiteSecondary.ignoresSafeArea()
@ -96,19 +118,13 @@ struct MemoriesView: View {
} }
} }
} }
.navigationTitle("My Memories") }
.navigationBarTitleDisplayMode(.inline) }
.navigationBarBackButtonHidden(true) .navigationBarBackButtonHidden(true)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
EmptyView()
}
}
.onAppear { .onAppear {
fetchMemories() fetchMemories()
} }
} }
}
private func fetchMemories() { private func fetchMemories() {
isLoading = true isLoading = true
@ -140,7 +156,7 @@ struct MemoryCard: View {
let memory: MemoryItem let memory: MemoryItem
var body: some View { var body: some View {
VStack(alignment: .leading, spacing: 4) { VStack(alignment: .leading, spacing: 12) {
ZStack { ZStack {
// Media content // Media content
Group { Group {
@ -194,18 +210,18 @@ struct MemoryCard: View {
} }
// Title and Subtitle // Title and Subtitle
VStack(alignment: .leading, spacing: 1) { VStack(alignment: .leading, spacing: 8) {
Text(memory.title) Text(memory.title)
.font(.subheadline) .font(Typography.font(for: .body, family: .quicksandBold))
.foregroundColor(.themeTextMessageMain)
.lineLimit(1) .lineLimit(1)
Text(memory.subtitle) Text(memory.subtitle)
.font(.caption) .font(.system(size: 14))
.foregroundColor(.secondary) .foregroundColor(.themeTextMessageMain)
.lineLimit(1)
} }
.padding(.horizontal, 2) .padding(.horizontal, 2)
.padding(.bottom, 4) .padding(.bottom, 8)
} }
} }
} }