/* * Vencord, a Discord client mod * Copyright (c) 2023 Vendicated, camila314, and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import "./styles.css"; import { addServerListElement, removeServerListElement, ServerListRenderPosition } from "@api/ServerList"; import ErrorBoundary from "@components/ErrorBoundary"; import { EquicordDevs } from "@utils/constants"; import definePlugin from "@utils/types"; import { FluxDispatcher } from "@webpack/common"; import { Tooltip } from "webpack/common/components"; function SearchIcon() { return ( ); } export default definePlugin({ name: "ServerSearch", authors: [EquicordDevs.camila314], description: "Navigate your servers better with a quick search button", renderButton() { return {({ onMouseEnter, onMouseLeave }) => ( FluxDispatcher.dispatch({ type: "QUICKSWITCHER_SHOW", query: "", queryMode: null }) }> )} ; }, start() { addServerListElement(ServerListRenderPosition.Above, this.renderButton); }, stop() { removeServerListElement(ServerListRenderPosition.Above, this.renderButton); } });