diff --git a/Shared/Views/Tab/Profile/ProfileContentTabbedGrid.swift b/Shared/Views/Tab/Profile/ProfileContentTabbedGrid.swift index 00c8743..4a7be25 100644 --- a/Shared/Views/Tab/Profile/ProfileContentTabbedGrid.swift +++ b/Shared/Views/Tab/Profile/ProfileContentTabbedGrid.swift @@ -43,15 +43,7 @@ struct ProfileContentTabbedGrid: View { .cornerRadius(8) .font(.subheadline) - Button { - // Создать пост - } label: { - Label("Создать", systemImage: "plus") - .font(.subheadline) - .padding(8) - .background(Color.blue.opacity(0.2)) - .cornerRadius(8) - } + } else { TextField("Поиск", text: $searchQuery) .padding(.horizontal, 10) diff --git a/Shared/Views/Tab/ProfileTab.swift b/Shared/Views/Tab/ProfileTab.swift index 0806505..ef31400 100644 --- a/Shared/Views/Tab/ProfileTab.swift +++ b/Shared/Views/Tab/ProfileTab.swift @@ -30,41 +30,57 @@ struct ProfileTab: View { if !isContentLoaded { SplashScreenView() } else { - VStack(spacing: 0) { - // Скрытые NavigationLink для программного перехода - NavigationLink(destination: FollowersView(followers: followers), isActive: $isShowingFollowers) { EmptyView() } - NavigationLink(destination: FollowingView(following: following), isActive: $isShowingFollowing) { EmptyView() } - - if let (post, posts) = selectedPostData { - NavigationLink( - destination: PostFeedView(posts: posts, selectedPostID: post.id), - isActive: Binding( - get: { selectedPostData != nil }, - set: { if !$0 { selectedPostData = nil } } - ), - label: { EmptyView() } - ) - } - - RefreshableScrollView(isRefreshing: $isRefreshing, onRefresh: { - fetchData() - }) { - VStack(spacing: 12) { - header -// .frame(minHeight: 300) - .frame(maxWidth: .infinity) - .background(Color(.systemBackground)) - - ProfileContentTabbedGrid( - isContentLoaded: isContentLoaded, - allPosts: $allPosts, - isLoading: $isLoading, - onPostTapped: { post, posts in - self.selectedPostData = (post, posts) - } + ZStack(alignment: .bottomTrailing) { + VStack(spacing: 0) { + // Скрытые NavigationLink для программного перехода + NavigationLink(destination: FollowersView(followers: followers), isActive: $isShowingFollowers) { EmptyView() } + NavigationLink(destination: FollowingView(following: following), isActive: $isShowingFollowing) { EmptyView() } + + if let (post, posts) = selectedPostData { + NavigationLink( + destination: PostFeedView(posts: posts, selectedPostID: post.id), + isActive: Binding( + get: { selectedPostData != nil }, + set: { if !$0 { selectedPostData = nil } } + ), + label: { EmptyView() } ) } + + RefreshableScrollView(isRefreshing: $isRefreshing, onRefresh: { + fetchData() + }) { + VStack(spacing: 12) { + header + // .frame(minHeight: 300) + .frame(maxWidth: .infinity) + .background(Color(.systemBackground)) + + ProfileContentTabbedGrid( + isContentLoaded: isContentLoaded, + allPosts: $allPosts, + isLoading: $isLoading, + onPostTapped: { post, posts in + self.selectedPostData = (post, posts) + } + ) + } + } } + + // FAB + Button(action: { + // TODO: Действие для создания поста + }) { + Image(systemName: "plus") + .font(.system(size: 24, weight: .bold)) + .foregroundColor(.white) + .padding() + .background(Color.blue) + .clipShape(Circle()) + .shadow(radius: 5) + } + .padding() } .navigationBarTitleDisplayMode(.inline) .toolbar {