Profile Editor
Changelog-Added: Added profile edit view Changelog-Changed: Don't fetch followers right away
This commit is contained in:
@@ -13,14 +13,9 @@ struct FollowButtonView: View {
|
||||
|
||||
let target: FollowTarget
|
||||
@State var follow_state: FollowState
|
||||
let perform: (() -> Void)?
|
||||
|
||||
var body: some View {
|
||||
Button {
|
||||
if perform != nil {
|
||||
perform!()
|
||||
}
|
||||
|
||||
follow_state = perform_follow_btn_action(follow_state, target: target)
|
||||
} label: {
|
||||
Text(follow_btn_txt(follow_state))
|
||||
@@ -71,19 +66,16 @@ struct FollowButtonPreviews: View {
|
||||
var body: some View {
|
||||
VStack {
|
||||
Text("Unfollows")
|
||||
FollowButtonView(target: target, follow_state: .unfollows, perform: nil)
|
||||
FollowButtonView(target: target, follow_state: .unfollows)
|
||||
|
||||
Text("Following")
|
||||
FollowButtonView(target: target, follow_state: .following, perform: nil)
|
||||
FollowButtonView(target: target, follow_state: .following)
|
||||
|
||||
Text("Follows")
|
||||
FollowButtonView(target: target, follow_state: .follows, perform: nil)
|
||||
FollowButtonView(target: target, follow_state: .follows)
|
||||
|
||||
Text("Unfollowing")
|
||||
FollowButtonView(target: target, follow_state: .unfollowing, perform: nil)
|
||||
|
||||
Text("Edit")
|
||||
FollowButtonView(target: target, follow_state: .edit, perform: nil)
|
||||
FollowButtonView(target: target, follow_state: .unfollowing)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,8 +98,6 @@ func perform_follow_btn_action(_ fs: FollowState, target: FollowTarget) -> Follo
|
||||
case .unfollows:
|
||||
notify(.follow, target)
|
||||
return .unfollowing
|
||||
case .edit:
|
||||
return .edit
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user