Improve component finding api and migrate plugins to use them

This commit is contained in:
Nuckyz 2023-11-22 02:49:08 -03:00
parent 371b5b0be8
commit ffe6512693
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
14 changed files with 89 additions and 57 deletions

View file

@ -16,12 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { LazyComponent } from "@utils/react";
import { findByCode, findLazy } from "@webpack";
import { findComponentByCodeLazy } from "@utils/react";
import { findLazy } from "@webpack";
import { i18n, useToken } from "@webpack/common";
const ColorMap = findLazy(m => m.colors?.INTERACTIVE_MUTED?.css);
const VerifiedIconComponent = LazyComponent(() => findByCode(".CONNECTIONS_ROLE_OFFICIAL_ICON_TOOLTIP"));
const VerifiedIconComponent = findComponentByCodeLazy(".CONNECTIONS_ROLE_OFFICIAL_ICON_TOOLTIP");
export function VerifiedIcon() {
const color = useToken(ColorMap.colors.INTERACTIVE_MUTED).hex();