feat: provide and consume scroll offsets

This commit is contained in:
Paul Makles
2021-12-30 18:15:31 +00:00
parent 9387575372
commit bad7458560
17 changed files with 113 additions and 97 deletions

View File

@@ -30,7 +30,7 @@ export default function HeaderActions({ channel }: ChannelHeaderProps) {
const history = useHistory();
function openRightSidebar() {
const panels = document.querySelector("#app > div > div");
const panels = document.querySelector("#app > div > div > div");
panels?.scrollTo({
behavior: "smooth",
left: panels.clientWidth * 3,
@@ -84,7 +84,11 @@ export default function HeaderActions({ channel }: ChannelHeaderProps) {
)}
{(channel.channel_type === "Group" ||
channel.channel_type === "TextChannel") && (
<IconButton onClick={openSidebar}>
<IconButton
onClick={() => {
internalEmit("RightSidebar", "open", undefined);
openRightSidebar();
}}>
<Group size={25} />
</IconButton>
)}