Fix PreviewMessage icon being offcentre

This commit is contained in:
Vendicated 2024-02-06 16:50:21 +01:00
parent bf977e0047
commit 2c198e547c
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
4 changed files with 22 additions and 6 deletions

4
src/api/ChatButton.css Normal file
View file

@ -0,0 +1,4 @@
.vc-chatbar-button {
display: flex;
align-items: center;
}

View file

@ -4,12 +4,18 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import "./ChatButton.css";
import ErrorBoundary from "@components/ErrorBoundary";
import { Logger } from "@utils/Logger";
import { waitFor } from "@webpack";
import { Button, ButtonLooks, ButtonWrapperClasses, Tooltip } from "@webpack/common";
import { Channel } from "discord-types/general";
import { HTMLProps, MouseEventHandler, ReactNode } from "react";
let CssClasses: { buttonContainer: string; };
waitFor(["buttonContainer", "channelTextArea"], m => CssClasses = m);
export interface ChatBarProps {
channel: Channel;
disabled: boolean;
@ -100,7 +106,7 @@ export const ChatBarButton = ErrorBoundary.wrap((props: ChatBarButtonProps) => {
return (
<Tooltip text={props.tooltip}>
{({ onMouseEnter, onMouseLeave }) => (
<div style={{ display: "flex" }}>
<div className={`expression-picker-chat-input-button ${CssClasses?.buttonContainer ?? ""} vc-chatbar-button`}>
<Button
aria-label={props.tooltip}
size=""