diff --git a/src/equicordplugins/serverSearch/index.tsx b/src/equicordplugins/serverSearch/index.tsx index 849d255c..9f1f1df9 100644 --- a/src/equicordplugins/serverSearch/index.tsx +++ b/src/equicordplugins/serverSearch/index.tsx @@ -4,14 +4,19 @@ * 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 { findByCodeLazy } from "@webpack"; +import { Tooltip } from "webpack/common/components"; const openPopout = findByCodeLazy(".QUICKSWITCHER_OPENED,{"); function SearchIcon() { return ( - + $1)" - } - }, - { - find: "__invalid_circleButtonMask", - replacement: { - match: /let (\i)=(\i)\.forwardRef/, - replace: "let $1 = $self.BigComponent = $2.forwardRef" - } - }, - ], - insertSearch(Elem) { - return (<> - } - onClick={() => openPopout("DM_SEARCH")} - search={true} - /> + renderButton() { + return +
+ + {({ onMouseEnter, onMouseLeave }) => ( +
openPopout("DM_SEARCH")}> + +
+ )} +
+
+ ; + }, - - ); + start() { + addServerListElement(ServerListRenderPosition.Above, this.renderButton); + }, + + stop() { + removeServerListElement(ServerListRenderPosition.Above, this.renderButton); } }); diff --git a/src/equicordplugins/serverSearch/styles.css b/src/equicordplugins/serverSearch/styles.css new file mode 100644 index 00000000..196d9535 --- /dev/null +++ b/src/equicordplugins/serverSearch/styles.css @@ -0,0 +1,33 @@ +#vc-searchbutton-container { + width: 100%; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 8px; +} + +#vc-searchbutton { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + background-color: var(--background-secondary); + height: 48px; + width: 48px; + border-radius: 100%; + transition: border-radius 0.15s ease-out, background-color 0.15s ease-out; +} + +#vc-searchbutton-icon { + color: var(--text-normal); +} + +#vc-searchbutton:hover { + border-radius: 34%; + background-color: var(--green-360); + cursor: pointer; +} + +#vc-searchbutton:hover #vc-searchbutton-icon { + color: var(--white-500); +}