From: Alec Armbruster <35377827+alectrocute@users.noreply.github.com> Date: Tue, 20 Jun 2023 01:48:38 +0000 (-0400) Subject: update imports X-Git-Url: http://these/git/?a=commitdiff_plain;h=69a123b6d80766c48a64c15f7d7e1545605bad47;p=lemmy-ui.git update imports --- diff --git a/src/shared/components/app/navbar.tsx b/src/shared/components/app/navbar.tsx index d0943af..9f68656 100644 --- a/src/shared/components/app/navbar.tsx +++ b/src/shared/components/app/navbar.tsx @@ -17,10 +17,10 @@ import { toast, updateUnreadCountsInterval, } from "../../utils"; -import { isBrowser } from "../../utils/browser/is-browser"; -import { poll } from "../../utils/helpers/poll"; -import { amAdmin } from "../../utils/roles/am-admin"; -import { canCreateCommunity } from "../../utils/roles/can-create-community"; +import isBrowser from "../../utils/browser/is-browser"; +import poll from "../../utils/helpers/poll"; +import amAdmin from "../../utils/roles/am-admin"; +import canCreateCommunity from "../../utils/roles/can-create-community"; import { Icon } from "../common/icon"; import { PictrsImage } from "../common/pictrs-image"; diff --git a/src/shared/components/common/markdown-textarea.tsx b/src/shared/components/common/markdown-textarea.tsx index c03c68e..3670021 100644 --- a/src/shared/components/common/markdown-textarea.tsx +++ b/src/shared/components/common/markdown-textarea.tsx @@ -20,7 +20,7 @@ import { setupTribute, toast, } from "../../utils"; -import { isBrowser } from "../../utils/browser/is-browser"; +import isBrowser from "../../utils/browser/is-browser"; import { EmojiPicker } from "./emoji-picker"; import { Icon, Spinner } from "./icon"; import { LanguageSelect } from "./language-select"; diff --git a/src/shared/components/community/communities.tsx b/src/shared/components/community/communities.tsx index eef064c..6a2ae6a 100644 --- a/src/shared/components/community/communities.tsx +++ b/src/shared/components/community/communities.tsx @@ -20,8 +20,8 @@ import { setIsoData, showLocal, } from "../../utils"; -import { getQueryParams } from "../../utils/helpers/get-query-params"; -import { getQueryString } from "../../utils/helpers/get-query-string"; +import getQueryParams from "../../utils/helpers/get-query-params"; +import getQueryString from "../../utils/helpers/get-query-string"; import type { QueryParams } from "../../utils/types/query-params"; import { HtmlTags } from "../common/html-tags"; import { Spinner } from "../common/icon"; diff --git a/src/shared/components/community/community.tsx b/src/shared/components/community/community.tsx index 54ecfcd..42a7783 100644 --- a/src/shared/components/community/community.tsx +++ b/src/shared/components/community/community.tsx @@ -86,8 +86,8 @@ import { updateCommunityBlock, updatePersonBlock, } from "../../utils"; -import { getQueryParams } from "../../utils/helpers/get-query-params"; -import { getQueryString } from "../../utils/helpers/get-query-string"; +import getQueryParams from "../../utils/helpers/get-query-params"; +import getQueryString from "../../utils/helpers/get-query-string"; import type { QueryParams } from "../../utils/types/query-params"; import { CommentNodes } from "../comment/comment-nodes"; import { BannerIconHeader } from "../common/banner-icon-header"; diff --git a/src/shared/components/community/sidebar.tsx b/src/shared/components/community/sidebar.tsx index 508e5a0..72c94c0 100644 --- a/src/shared/components/community/sidebar.tsx +++ b/src/shared/components/community/sidebar.tsx @@ -16,15 +16,10 @@ import { } from "lemmy-js-client"; import { i18n } from "../../i18next"; import { UserService } from "../../services"; -import { - getUnixTime, - hostname, - mdToHtml, - myAuthRequired, -} from "../../utils"; -import { amAdmin } from "../../utils/roles/am-admin"; -import { amMod } from "../../utils/roles/am-mod"; -import { amTopMod } from "../../utils/roles/am-top-mod"; +import { getUnixTime, hostname, mdToHtml, myAuthRequired } from "../../utils"; +import amAdmin from "../../utils/roles/am-admin"; +import amMod from "../../utils/roles/am-mod"; +import amTopMod from "../../utils/roles/am-top-mod"; import { Badges } from "../common/badges"; import { BannerIconHeader } from "../common/banner-icon-header"; import { Icon, PurgeWarning, Spinner } from "../common/icon"; diff --git a/src/shared/components/home/home.tsx b/src/shared/components/home/home.tsx index 39753c4..4a1e9d7 100644 --- a/src/shared/components/home/home.tsx +++ b/src/shared/components/home/home.tsx @@ -82,9 +82,9 @@ import { trendingFetchLimit, updatePersonBlock, } from "../../utils"; -import { getQueryParams } from "../../utils/helpers/get-query-params"; -import { getQueryString } from "../../utils/helpers/get-query-string"; -import { canCreateCommunity } from "../../utils/roles/can-create-community"; +import getQueryParams from "../../utils/helpers/get-query-params"; +import getQueryString from "../../utils/helpers/get-query-string"; +import canCreateCommunity from "../../utils/roles/can-create-community"; import type { QueryParams } from "../../utils/types/query-params"; import { CommentNodes } from "../comment/comment-nodes"; import { DataTypeSelect } from "../common/data-type-select"; diff --git a/src/shared/components/home/login.tsx b/src/shared/components/home/login.tsx index 6a27089..e25222e 100644 --- a/src/shared/components/home/login.tsx +++ b/src/shared/components/home/login.tsx @@ -4,7 +4,7 @@ import { i18n } from "../../i18next"; import { UserService } from "../../services"; import { HttpService, RequestState } from "../../services/HttpService"; import { myAuth, setIsoData, toast, validEmail } from "../../utils"; -import { isBrowser } from "../../utils/browser/is-browser"; +import isBrowser from "../../utils/browser/is-browser"; import { HtmlTags } from "../common/html-tags"; import { Spinner } from "../common/icon"; diff --git a/src/shared/components/home/signup.tsx b/src/shared/components/home/signup.tsx index c730695..287bdb7 100644 --- a/src/shared/components/home/signup.tsx +++ b/src/shared/components/home/signup.tsx @@ -20,7 +20,7 @@ import { toast, validEmail, } from "../../utils"; -import { isBrowser } from "../../utils/browser/is-browser"; +import isBrowser from "../../utils/browser/is-browser"; import { HtmlTags } from "../common/html-tags"; import { Icon, Spinner } from "../common/icon"; import { MarkdownTextArea } from "../common/markdown-textarea"; diff --git a/src/shared/components/modlog.tsx b/src/shared/components/modlog.tsx index 8538a4f..3ea910c 100644 --- a/src/shared/components/modlog.tsx +++ b/src/shared/components/modlog.tsx @@ -44,11 +44,11 @@ import { personToChoice, setIsoData, } from "../utils"; -import { debounce } from "../utils/helpers/debounce"; -import { getQueryParams } from "../utils/helpers/get-query-params"; -import { getQueryString } from "../utils/helpers/get-query-string"; -import { amAdmin } from "../utils/roles/am-admin"; -import { amMod } from "../utils/roles/am-mod"; +import debounce from "../utils/helpers/debounce"; +import getQueryParams from "../utils/helpers/get-query-params"; +import getQueryString from "../utils/helpers/get-query-string"; +import amAdmin from "../utils/roles/am-admin"; +import amMod from "../utils/roles/am-mod"; import type { QueryParams } from "../utils/types/query-params"; import { HtmlTags } from "./common/html-tags"; import { Icon, Spinner } from "./common/icon"; diff --git a/src/shared/components/person/profile.tsx b/src/shared/components/person/profile.tsx index c8060ce..d99ab12 100644 --- a/src/shared/components/person/profile.tsx +++ b/src/shared/components/person/profile.tsx @@ -76,11 +76,11 @@ import { toast, updatePersonBlock, } from "../../utils"; -import { getQueryParams } from "../../utils/helpers/get-query-params"; -import { getQueryString } from "../../utils/helpers/get-query-string"; -import { canMod } from "../../utils/roles/can-mod"; -import { isAdmin } from "../../utils/roles/is-admin"; -import { isBanned } from "../../utils/roles/is-banned"; +import getQueryParams from "../../utils/helpers/get-query-params"; +import getQueryString from "../../utils/helpers/get-query-string"; +import canMod from "../../utils/roles/can-mod"; +import isAdmin from "../../utils/roles/is-admin"; +import isBanned from "../../utils/roles/is-banned"; import type { QueryParams } from "../../utils/types/query-params"; import { BannerIconHeader } from "../common/banner-icon-header"; import { HtmlTags } from "../common/html-tags"; diff --git a/src/shared/components/person/reports.tsx b/src/shared/components/person/reports.tsx index 0be7537..ce9d215 100644 --- a/src/shared/components/person/reports.tsx +++ b/src/shared/components/person/reports.tsx @@ -31,7 +31,7 @@ import { myAuthRequired, setIsoData, } from "../../utils"; -import { amAdmin } from "../../utils/roles/am-admin"; +import amAdmin from "../../utils/roles/am-admin"; import { CommentReport } from "../comment/comment-report"; import { HtmlTags } from "../common/html-tags"; import { Spinner } from "../common/icon"; diff --git a/src/shared/components/person/settings.tsx b/src/shared/components/person/settings.tsx index 971ec89..7cb9308 100644 --- a/src/shared/components/person/settings.tsx +++ b/src/shared/components/person/settings.tsx @@ -35,7 +35,7 @@ import { updateCommunityBlock, updatePersonBlock, } from "../../utils"; -import { debounce } from "../../utils/helpers/debounce"; +import debounce from "../../utils/helpers/debounce"; import { HtmlTags } from "../common/html-tags"; import { Icon, Spinner } from "../common/icon"; import { ImageUploadForm } from "../common/image-upload-form"; diff --git a/src/shared/components/post/create-post.tsx b/src/shared/components/post/create-post.tsx index 7df628b..4f36771 100644 --- a/src/shared/components/post/create-post.tsx +++ b/src/shared/components/post/create-post.tsx @@ -24,7 +24,7 @@ import { myAuth, setIsoData, } from "../../utils"; -import { getQueryParams } from "../../utils/helpers/get-query-params"; +import getQueryParams from "../../utils/helpers/get-query-params"; import type { QueryParams } from "../../utils/types/query-params"; import { HtmlTags } from "../common/html-tags"; import { Spinner } from "../common/icon"; diff --git a/src/shared/components/post/post-form.tsx b/src/shared/components/post/post-form.tsx index c21a6e2..02a5906 100644 --- a/src/shared/components/post/post-form.tsx +++ b/src/shared/components/post/post-form.tsx @@ -32,7 +32,7 @@ import { validURL, webArchiveUrl, } from "../../utils"; -import { debounce } from "../../utils/helpers/debounce"; +import debounce from "../../utils/helpers/debounce"; import { Icon, Spinner } from "../common/icon"; import { LanguageSelect } from "../common/language-select"; import { MarkdownTextArea } from "../common/markdown-textarea"; diff --git a/src/shared/components/post/post-listing.tsx b/src/shared/components/post/post-listing.tsx index 3c90c97..914c16d 100644 --- a/src/shared/components/post/post-listing.tsx +++ b/src/shared/components/post/post-listing.tsx @@ -42,16 +42,16 @@ import { setupTippy, showScores, } from "../../utils"; -import { canShare } from "../../utils/browser/can-share"; -import { share } from "../../utils/browser/share"; -import { amAdmin } from "../../utils/roles/am-admin"; -import { amCommunityCreator } from "../../utils/roles/am-community-creator"; -import { amMod } from "../../utils/roles/am-mod"; -import { canAdmin } from "../../utils/roles/can-admin"; -import { canMod } from "../../utils/roles/can-mod"; -import { isAdmin } from "../../utils/roles/is-admin"; -import { isBanned } from "../../utils/roles/is-banned"; -import { isMod } from "../../utils/roles/is-mod"; +import canShare from "../../utils/browser/can-share"; +import share from "../../utils/browser/share"; +import amAdmin from "../../utils/roles/am-admin"; +import amCommunityCreator from "../../utils/roles/am-community-creator"; +import amMod from "../../utils/roles/am-mod"; +import canAdmin from "../../utils/roles/can-admin"; +import canMod from "../../utils/roles/can-mod"; +import isAdmin from "../../utils/roles/is-admin"; +import isBanned from "../../utils/roles/is-banned"; +import isMod from "../../utils/roles/is-mod"; import { Icon, PurgeWarning, Spinner } from "../common/icon"; import { MomentTime } from "../common/moment-time"; import { PictrsImage } from "../common/pictrs-image"; diff --git a/src/shared/components/post/post.tsx b/src/shared/components/post/post.tsx index 3dee31a..8b10c05 100644 --- a/src/shared/components/post/post.tsx +++ b/src/shared/components/post/post.tsx @@ -83,8 +83,8 @@ import { updateCommunityBlock, updatePersonBlock, } from "../../utils"; -import { isBrowser } from "../../utils/browser/is-browser"; -import { debounce } from "../../utils/helpers/debounce"; +import isBrowser from "../../utils/browser/is-browser"; +import debounce from "../../utils/helpers/debounce"; import { CommentForm } from "../comment/comment-form"; import { CommentNodes } from "../comment/comment-nodes"; import { HtmlTags } from "../common/html-tags"; diff --git a/src/shared/components/search.tsx b/src/shared/components/search.tsx index e56056a..844737c 100644 --- a/src/shared/components/search.tsx +++ b/src/shared/components/search.tsx @@ -46,9 +46,9 @@ import { setIsoData, showLocal, } from "../utils"; -import { debounce } from "../utils/helpers/debounce"; -import { getQueryParams } from "../utils/helpers/get-query-params"; -import { getQueryString } from "../utils/helpers/get-query-string"; +import debounce from "../utils/helpers/debounce"; +import getQueryParams from "../utils/helpers/get-query-params"; +import getQueryString from "../utils/helpers/get-query-string"; import type { QueryParams } from "../utils/types/query-params"; import { CommentNodes } from "./comment/comment-nodes"; import { HtmlTags } from "./common/html-tags"; diff --git a/src/shared/env.ts b/src/shared/env.ts index 969f876..2f3a5cf 100644 --- a/src/shared/env.ts +++ b/src/shared/env.ts @@ -1,4 +1,4 @@ -import { isBrowser } from "./utils/browser/is-browser"; +import isBrowser from "./utils/browser/is-browser"; const testHost = "0.0.0.0:8536"; diff --git a/src/shared/i18next.ts b/src/shared/i18next.ts index 0a705ae..d0a4e58 100644 --- a/src/shared/i18next.ts +++ b/src/shared/i18next.ts @@ -31,7 +31,7 @@ import { sv } from "./translations/sv"; import { vi } from "./translations/vi"; import { zh } from "./translations/zh"; import { zh_Hant } from "./translations/zh_Hant"; -import { isBrowser } from "./utils/browser/is-browser"; +import isBrowser from "./utils/browser/is-browser"; export const languages = [ { resource: ar, code: "ar", name: "العربية" }, diff --git a/src/shared/services/UserService.ts b/src/shared/services/UserService.ts index 8f553ab..18d0804 100644 --- a/src/shared/services/UserService.ts +++ b/src/shared/services/UserService.ts @@ -5,7 +5,7 @@ import { LoginResponse, MyUserInfo } from "lemmy-js-client"; import { isHttps } from "../env"; import { i18n } from "../i18next"; import { isAuthPath, toast } from "../utils"; -import { isBrowser } from "../utils/browser/is-browser"; +import isBrowser from "../utils/browser/is-browser"; interface Claims { sub: number; diff --git a/src/shared/utils.ts b/src/shared/utils.ts index be461dc..35e30a3 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -49,10 +49,10 @@ import { VoteType, } from "./interfaces"; import { HttpService, UserService } from "./services"; -import { isBrowser } from "./utils/browser/is-browser"; -import { debounce } from "./utils/helpers/debounce"; -import { groupBy } from "./utils/helpers/group-by"; import { RequestState } from "./services/HttpService"; +import isBrowser from "./utils/browser/is-browser"; +import debounce from "./utils/helpers/debounce"; +import { groupBy } from "./utils/helpers/group-by"; let Tribute: any; if (isBrowser()) {