@@ -1,14 +1,16 @@
|
||||
import { createElement, useCallback } from "react"
|
||||
import { createElement, lazy, useCallback } from "react"
|
||||
import { parse } from "tldts"
|
||||
|
||||
import { useModalStack } from "~/components/ui/modal"
|
||||
import { PlainModal } from "~/components/ui/modal/stacked/custom-modal"
|
||||
import { useModalStack } from "~/components/ui/modal/stacked/hooks"
|
||||
import { useAuthQuery } from "~/hooks/common"
|
||||
import { apiClient } from "~/lib/api-fetch"
|
||||
import { defineQuery } from "~/lib/defineQuery"
|
||||
import { capitalizeFirstLetter } from "~/lib/utils"
|
||||
|
||||
import { UserProfileModalContent } from "./user-profile-modal"
|
||||
const LazyUserProfileModalContent = lazy(() =>
|
||||
import("./user-profile-modal").then((mod) => ({ default: mod.UserProfileModalContent })),
|
||||
)
|
||||
|
||||
export const useUserSubscriptionsQuery = (userId: string | undefined) => {
|
||||
const subscriptions = useAuthQuery(
|
||||
@@ -54,7 +56,7 @@ export const usePresentUserProfileModal = (variant: Variant = "dialog") => {
|
||||
present({
|
||||
title: "User Profile",
|
||||
content: () =>
|
||||
createElement(UserProfileModalContent, {
|
||||
createElement(LazyUserProfileModalContent, {
|
||||
userId,
|
||||
variant: finalVariant,
|
||||
}),
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Button } from "~/components/ui/button"
|
||||
import { Checkbox } from "~/components/ui/checkbox"
|
||||
import { Input } from "~/components/ui/input"
|
||||
import { Label } from "~/components/ui/label"
|
||||
import { SegmentGroup, SegmentItem } from "~/components/ui/segement"
|
||||
import { SegmentGroup, SegmentItem } from "~/components/ui/segment"
|
||||
import { Switch } from "~/components/ui/switch"
|
||||
import { cn } from "~/lib/utils"
|
||||
|
||||
|
||||
+1
-2
@@ -14,7 +14,7 @@
|
||||
},
|
||||
"main": "./dist/main/index.js",
|
||||
"scripts": {
|
||||
"analyze:web": "rm -rf out/web && ANALYZER=1 vite build",
|
||||
"analyze:web": "npx vite-bundle-visualizer",
|
||||
"build": "electron-vite build && electron-forge make",
|
||||
"build:macos": "electron-vite build && electron-forge make --arch=universal --platform=darwin",
|
||||
"build:web": "rm -rf out/web && vite build",
|
||||
@@ -96,7 +96,6 @@
|
||||
"tsx": "4.19.1",
|
||||
"typescript": "5.4.5",
|
||||
"vite": "^5.4.8",
|
||||
"vite-bundle-analyzer": "0.12.1",
|
||||
"vite-plugin-mkcert": "1.17.6",
|
||||
"vite-tsconfig-paths": "5.0.1",
|
||||
"vitest": "2.0"
|
||||
|
||||
+25
-4
@@ -5,7 +5,6 @@ import legacy from "@vitejs/plugin-legacy"
|
||||
import { cyan, dim, green } from "kolorist"
|
||||
import type { PluginOption, ViteDevServer } from "vite"
|
||||
import { defineConfig, loadEnv } from "vite"
|
||||
import { analyzer } from "vite-bundle-analyzer"
|
||||
import mkcert from "vite-plugin-mkcert"
|
||||
|
||||
import { viteRenderBaseConfig } from "./configs/vite.render.config"
|
||||
@@ -97,12 +96,34 @@ export default ({ mode }) => {
|
||||
"rehype-infer-description-meta",
|
||||
"hast-util-to-jsx-runtime",
|
||||
"hast-util-to-text",
|
||||
"react-shadow",
|
||||
],
|
||||
["vfile", "unified"],
|
||||
["lodash-es"],
|
||||
["framer-motion"],
|
||||
["clsx", "tailwind-merge", "class-variance-authority"],
|
||||
["@radix-ui/react-dialog", "re-resizable"],
|
||||
|
||||
[
|
||||
"@radix-ui/react-dialog",
|
||||
"@radix-ui/react-avatar",
|
||||
"@radix-ui/react-checkbox",
|
||||
"@radix-ui/react-context",
|
||||
"@radix-ui/react-dropdown-menu",
|
||||
"@radix-ui/react-hover-card",
|
||||
"@radix-ui/react-label",
|
||||
"@radix-ui/react-popover",
|
||||
"@radix-ui/react-radio-group",
|
||||
"@radix-ui/react-scroll-area",
|
||||
"@radix-ui/react-select",
|
||||
"@radix-ui/react-slider",
|
||||
"@radix-ui/react-slot",
|
||||
"@radix-ui/react-switch",
|
||||
"@radix-ui/react-tabs",
|
||||
"@radix-ui/react-toast",
|
||||
"@radix-ui/react-tooltip",
|
||||
|
||||
"@headlessui/react",
|
||||
],
|
||||
["i18next", "i18next-browser-languagedetector", "react-i18next"],
|
||||
// Data query
|
||||
[
|
||||
@@ -115,9 +136,9 @@ export default ({ mode }) => {
|
||||
["shiki", "@shikijs/transformers"],
|
||||
["@sentry/react", "posthog-js"],
|
||||
["zod", "react-hook-form", "@hookform/resolvers"],
|
||||
]),
|
||||
|
||||
process.env.ANALYZER && analyzer(),
|
||||
["swiper"],
|
||||
]),
|
||||
],
|
||||
|
||||
define: {
|
||||
|
||||
Reference in New Issue
Block a user