Skip to content

Commit

Permalink
fix: spacing above server and channel list
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoAlgorithm committed Feb 26, 2023
1 parent 79563c1 commit 80cfa50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Swiftcord/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ struct ContentView: View {
assetIconName: "DiscordIcon"
) {
state.selectedGuildID = "@me"
}.padding(.top, 8)
}.padding(.top, 4)

HorizontalDividerView().frame(width: 32)

Expand Down
5 changes: 5 additions & 0 deletions Swiftcord/Views/Server/ChannelList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ struct ChannelList: View {

var body: some View {
List {
Spacer(minLength: 52 - 16 + 4) // 52 (header) - 16 (unremovable section top padding) + 4 (spacing)

let filteredChannels = channels.filter {
if !nsfwShown {
return $0.parent_id == nil && $0.type != .category && ($0.nsfw == false || $0.nsfw == nil)
Expand Down Expand Up @@ -61,11 +63,14 @@ struct ChannelList: View {
}
}
}
.environment(\.defaultMinListRowHeight, 1)
.padding(.horizontal, -6)
.listStyle(.sidebar)
.frame(minWidth: 240, maxHeight: .infinity)
.introspectTableView { tableView in
tableView.enclosingScrollView!.scrollerInsets = .init(top: 0, left: 0, bottom: 0, right: 6)
tableView.enclosingScrollView!.automaticallyAdjustsContentInsets = false
tableView.enclosingScrollView!.contentInsets = .init()
}
.environment(\.defaultMinListRowHeight, 1)
}
Expand Down

0 comments on commit 80cfa50

Please sign in to comment.