|
@ -22,11 +22,19 @@ struct ProfileView: View { |
|
|
@EnvironmentObject var profiles: Profiles |
|
|
@EnvironmentObject var profiles: Profiles |
|
|
|
|
|
|
|
|
var TopSection: some View { |
|
|
var TopSection: some View { |
|
|
HStack(alignment: .top) { |
|
|
VStack{ |
|
|
let data = profiles.lookup(id: profile.pubkey) |
|
|
let data = profiles.lookup(id: profile.pubkey) |
|
|
ProfilePicView(picture: data?.picture, size: PFP_SIZE!, highlight: .custom(Color.black, 4), image_cache: damus.image_cache) |
|
|
HStack { |
|
|
//.border(Color.blue) |
|
|
ProfilePicView(pubkey: profile.pubkey, size: PFP_SIZE!, highlight: .custom(Color.black, 2), image_cache: damus.image_cache) |
|
|
VStack(alignment: .leading) { |
|
|
.environmentObject(profiles) |
|
|
|
|
|
|
|
|
|
|
|
Spacer() |
|
|
|
|
|
|
|
|
|
|
|
Button("Follow") { |
|
|
|
|
|
print("follow \(profile.pubkey)") |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if let pubkey = profile.pubkey { |
|
|
if let pubkey = profile.pubkey { |
|
|
ProfileName(pubkey: pubkey, profile: data) |
|
|
ProfileName(pubkey: pubkey, profile: data) |
|
|
.font(.title) |
|
|
.font(.title) |
|
@ -37,40 +45,21 @@ struct ProfileView: View { |
|
|
.foregroundColor(id_to_color(pubkey)) |
|
|
.foregroundColor(id_to_color(pubkey)) |
|
|
} |
|
|
} |
|
|
Text(data?.about ?? "") |
|
|
Text(data?.about ?? "") |
|
|
//.border(Color.red) |
|
|
|
|
|
} |
|
|
} |
|
|
//.border(Color.purple) |
|
|
|
|
|
//Spacer() |
|
|
|
|
|
} |
|
|
|
|
|
//.border(Color.indigo) |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var body: some View { |
|
|
var body: some View { |
|
|
VStack(alignment: .leading) { |
|
|
VStack(alignment: .leading) { |
|
|
|
|
|
ScrollView { |
|
|
TopSection |
|
|
TopSection |
|
|
/* |
|
|
|
|
|
Picker("", selection: $selected_tab) { |
|
|
|
|
|
Text("Posts").tag(ProfileTab.posts) |
|
|
|
|
|
Text("Following").tag(ProfileTab.following) |
|
|
|
|
|
} |
|
|
|
|
|
.pickerStyle(SegmentedPickerStyle()) |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Divider() |
|
|
Divider() |
|
|
|
|
|
|
|
|
Group { |
|
|
InnerTimelineView(events: $profile.events, damus: damus) |
|
|
switch(selected_tab) { |
|
|
|
|
|
case .posts: |
|
|
|
|
|
TimelineView(events: $profile.events, damus: damus) |
|
|
|
|
|
.environmentObject(profiles) |
|
|
.environmentObject(profiles) |
|
|
case .following: |
|
|
|
|
|
Text("Following") |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
.frame(maxHeight: .infinity, alignment: .topLeading) |
|
|
.frame(maxHeight: .infinity, alignment: .topLeading) |
|
|
} |
|
|
} |
|
|
//.border(Color.white) |
|
|
|
|
|
.padding([.leading, .trailing], 6) |
|
|
.padding([.leading, .trailing], 6) |
|
|
.frame(maxWidth: .infinity, alignment: .topLeading) |
|
|
.frame(maxWidth: .infinity, alignment: .topLeading) |
|
|
|
|
|
|
|
|