diff options
author | Ven <vendicated@riseup.net> | 2022-11-28 13:37:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-28 13:37:55 +0100 |
commit | bad96b78879f296d5b9e7adacb03756b0f58427a (patch) | |
tree | 4ddbc57a29e9b201bee1317f18110e8e1ad320e5 /src/plugins/reviewDB | |
parent | 7a4402f1425ea9fdc6d2b3c985a4ce831f405937 (diff) | |
download | Vencord-bad96b78879f296d5b9e7adacb03756b0f58427a.tar.gz Vencord-bad96b78879f296d5b9e7adacb03756b0f58427a.tar.bz2 Vencord-bad96b78879f296d5b9e7adacb03756b0f58427a.zip |
Path aliases, better lazyWebpack (#268)
Diffstat (limited to 'src/plugins/reviewDB')
-rw-r--r-- | src/plugins/reviewDB/Utils/ReviewDBAPI.ts | 3 | ||||
-rw-r--r-- | src/plugins/reviewDB/Utils/Utils.tsx | 13 | ||||
-rw-r--r-- | src/plugins/reviewDB/components/MessageButton.tsx | 4 | ||||
-rw-r--r-- | src/plugins/reviewDB/components/ReviewComponent.tsx | 7 | ||||
-rw-r--r-- | src/plugins/reviewDB/components/ReviewsView.tsx | 7 | ||||
-rw-r--r-- | src/plugins/reviewDB/index.tsx | 10 |
6 files changed, 24 insertions, 20 deletions
diff --git a/src/plugins/reviewDB/Utils/ReviewDBAPI.ts b/src/plugins/reviewDB/Utils/ReviewDBAPI.ts index 71e6e81..a4c8dbf 100644 --- a/src/plugins/reviewDB/Utils/ReviewDBAPI.ts +++ b/src/plugins/reviewDB/Utils/ReviewDBAPI.ts @@ -16,7 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Settings } from "../../../Vencord"; +import { Settings } from "@api/settings"; + import { Review } from "../entities/Review"; import { authorize, showToast } from "./Utils"; diff --git a/src/plugins/reviewDB/Utils/Utils.tsx b/src/plugins/reviewDB/Utils/Utils.tsx index 1093c95..79d768c 100644 --- a/src/plugins/reviewDB/Utils/Utils.tsx +++ b/src/plugins/reviewDB/Utils/Utils.tsx @@ -16,12 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { Devs } from "../../../utils/constants"; -import Logger from "../../../utils/Logger"; -import { openModal } from "../../../utils/modal"; -import { Settings } from "../../../Vencord"; -import { findByProps } from "../../../webpack"; -import { FluxDispatcher, React, SelectedChannelStore, Toasts, UserUtils } from "../../../webpack/common"; +import { Settings } from "@api/settings"; +import { Devs } from "@utils/constants"; +import Logger from "@utils/Logger"; +import { openModal } from "@utils/modal"; +import { findByProps } from "@webpack"; +import { FluxDispatcher, React, SelectedChannelStore, Toasts, UserUtils } from "@webpack/common"; + import { Review } from "../entities/Review"; export async function openUserProfileModal(userId: string) { diff --git a/src/plugins/reviewDB/components/MessageButton.tsx b/src/plugins/reviewDB/components/MessageButton.tsx index 7d16630..c334ddd 100644 --- a/src/plugins/reviewDB/components/MessageButton.tsx +++ b/src/plugins/reviewDB/components/MessageButton.tsx @@ -16,8 +16,8 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { classes, LazyComponent } from "../../../utils/misc"; -import { findByProps } from "../../../webpack"; +import { classes, LazyComponent } from "@utils/misc"; +import { findByProps } from "@webpack"; export default LazyComponent(() => { const { button, dangerous } = findByProps("button", "wrapper", "disabled"); diff --git a/src/plugins/reviewDB/components/ReviewComponent.tsx b/src/plugins/reviewDB/components/ReviewComponent.tsx index ecd12da..8808ccd 100644 --- a/src/plugins/reviewDB/components/ReviewComponent.tsx +++ b/src/plugins/reviewDB/components/ReviewComponent.tsx @@ -16,9 +16,10 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ -import { classes, LazyComponent } from "../../../utils/misc"; -import { filters, findBulk } from "../../../webpack"; -import { Alerts, UserStore } from "../../../webpack/common"; +import { classes, LazyComponent } from "@utils/misc"; +import { filters, findBulk } from "@webpack"; +import { Alerts, UserStore } from "@webpack/common"; + import { Review } from "../entities/Review"; import { deleteReview, reportReview } from "../Utils/ReviewDBAPI"; import { canDeleteReview, openUserProfileModal, showToast } from "../Utils/Utils"; diff --git a/src/plugins/reviewDB/components/ReviewsView.tsx b/src/plugins/reviewDB/components/ReviewsView.tsx index 363b624..999b970 100644 --- a/src/plugins/reviewDB/components/ReviewsView.tsx +++ b/src/plugins/reviewDB/components/ReviewsView.tsx @@ -16,14 +16,15 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +import { classes, useAwaiter } from "@utils/misc"; +import { findLazy } from "@webpack"; +import { Forms, Text, UserStore } from "@webpack/common"; import type { KeyboardEvent } from "react"; -import { classes, lazyWebpack, useAwaiter } from "../../../utils/misc"; -import { Forms, Text, UserStore } from "../../../webpack/common"; import { addReview, getReviews } from "../Utils/ReviewDBAPI"; import ReviewComponent from "./ReviewComponent"; -const Classes = lazyWebpack(m => typeof m.textarea === "string"); +const Classes = findLazy(m => typeof m.textarea === "string"); export default function ReviewsView({ userId }: { userId: string; }) { const [reviews, _, isLoading, refetch] = useAwaiter(() => getReviews(userId), []); diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx index 0349ea9..744c2d6 100644 --- a/src/plugins/reviewDB/index.tsx +++ b/src/plugins/reviewDB/index.tsx @@ -16,13 +16,13 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +import { Settings } from "@api/settings"; +import ErrorBoundary from "@components/ErrorBoundary"; +import { Devs } from "@utils/constants"; +import definePlugin, { OptionType } from "@utils/types"; +import { Button, UserStore } from "@webpack/common"; import { User } from "discord-types/general"; -import ErrorBoundary from "../../components/ErrorBoundary"; -import { Devs } from "../../utils/constants"; -import definePlugin, { OptionType } from "../../utils/types"; -import { Settings } from "../../Vencord"; -import { Button, UserStore } from "../../webpack/common"; import ReviewsView from "./components/ReviewsView"; import { getLastReviewID } from "./Utils/ReviewDBAPI"; import { authorize, showToast } from "./Utils/Utils"; |