From f576e3c73da378ebe7f80d0feefaf571dab77d86 Mon Sep 17 00:00:00 2001 From: luannguyenbkit Date: Sun, 22 Dec 2024 23:28:01 +0700 Subject: [PATCH 1/2] refactor: ui --- packages/ui/src/components/molecules/skeleton/posts.tsx | 4 ++-- packages/ui/src/components/ui/use-toast.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ui/src/components/molecules/skeleton/posts.tsx b/packages/ui/src/components/molecules/skeleton/posts.tsx index 4471d238..7a18cb8b 100644 --- a/packages/ui/src/components/molecules/skeleton/posts.tsx +++ b/packages/ui/src/components/molecules/skeleton/posts.tsx @@ -1,7 +1,7 @@ import * as React from "react" -import { Skeleton } from "@/components/ui/skeleton" -import { cn } from "@/lib/utils" +import { cn } from "../../../lib/utils" +import { Skeleton } from "../../ui/skeleton" interface PostSkeletonProps extends React.HTMLAttributes { total?: number diff --git a/packages/ui/src/components/ui/use-toast.ts b/packages/ui/src/components/ui/use-toast.ts index 2e4c6ea2..9abb52e6 100644 --- a/packages/ui/src/components/ui/use-toast.ts +++ b/packages/ui/src/components/ui/use-toast.ts @@ -3,7 +3,7 @@ // Inspired by react-hot-toast library import * as React from "react" -import type { ToastActionElement, ToastProps } from "@/components/ui/toast" +import type { ToastActionElement, ToastProps } from "./toast" const TOAST_LIMIT = 1 const TOAST_REMOVE_DELAY = 1000000 From ba7a7ff0a0bc998c0a1a32c0644a5be00cdd497e Mon Sep 17 00:00:00 2001 From: luannguyenbkit Date: Mon, 23 Dec 2024 22:43:15 +0700 Subject: [PATCH 2/2] refactor import --- apps/docs/app/page.tsx | 3 +- apps/web/src/actions/auth/index.ts | 7 +- apps/web/src/actions/protect/postAction.ts | 9 +-- .../web/src/app/[lang]/(auth)/signin/page.tsx | 5 +- .../web/src/app/[lang]/(auth)/signup/page.tsx | 2 +- .../web/src/app/[lang]/(protected)/layout.tsx | 2 +- .../[lang]/(protected)/user/posts/page.tsx | 7 +- .../[lang]/(protected)/user/profile/page.tsx | 10 +-- .../user/posts/[postId]/edit/page.tsx | 3 +- .../user/posts/create/page.tsx | 6 +- .../src/app/[lang]/(public)/contact/page.tsx | 4 +- apps/web/src/app/[lang]/(public)/layout.tsx | 7 +- apps/web/src/app/[lang]/(public)/page.tsx | 5 +- .../src/app/[lang]/(public)/search/page.tsx | 7 +- .../web/src/app/[lang]/(public)/tags/page.tsx | 6 +- apps/web/src/app/[lang]/(public)/ui/page.tsx | 5 +- .../author/[authorId]/followers/page.tsx | 9 ++- .../author/[authorId]/page.tsx | 5 +- .../posts/[postId]/page.tsx | 15 ++-- .../tags/[tagId]/follower/page.tsx | 13 ++-- .../(public-fullwidth)/tags/[tagId]/page.tsx | 5 +- apps/web/src/app/[lang]/layout.tsx | 7 +- .../src/app/api/auth/[...nextauth]/route.ts | 2 +- .../src/app/api/protected/comment/route.ts | 2 +- .../web/src/app/api/protected/images/route.ts | 19 +++-- apps/web/src/app/api/protected/tags/route.ts | 2 +- .../protected/user/[userId]/follower/route.ts | 7 +- .../user/[userId]/followers/route.ts | 3 +- .../post/[postIdOrSlug]/comments/route.ts | 12 ++-- .../api/public/post/[postIdOrSlug]/route.ts | 4 +- apps/web/src/app/api/public/tags/route.ts | 9 +-- apps/web/src/emails/index.ts | 3 +- apps/web/src/hooks/useBookMark.ts | 70 ------------------ apps/web/src/hooks/useFollowUser.ts | 5 +- apps/web/src/hooks/useGetImages.ts | 1 + apps/web/src/hooks/useLike.ts | 71 ------------------- apps/web/src/libs/validationAction/index.ts | 3 +- apps/web/src/middleware.ts | 7 +- apps/web/src/molecules/auth/sign-up/index.tsx | 7 +- .../molecules/follower/followers/index.tsx | 4 +- .../follower/user-profile/follow-button.tsx | 3 +- .../molecules/follower/user-profile/index.tsx | 2 +- apps/web/src/molecules/home/filter/index.tsx | 3 +- .../src/molecules/infinite-scroll/index.tsx | 3 +- .../src/molecules/language-switcher/index.tsx | 5 +- apps/web/src/molecules/nav/index.tsx | 3 +- apps/web/src/molecules/nav/logo.tsx | 3 +- apps/web/src/molecules/post-form/index.tsx | 6 +- .../post-detail/comments/comment-detail.tsx | 6 +- .../post-detail/comments/comment-header.tsx | 5 +- .../post-detail/comments/comment-input.tsx | 6 +- .../posts/post-detail/comments/index.tsx | 3 +- .../post-detail/edit-post-button/index.tsx | 5 +- .../edit-post-button/toggle-post.tsx | 3 +- .../src/molecules/posts/post-detail/index.tsx | 9 +-- .../post-detail/like-button/LikeButton.tsx | 5 +- .../posts/post-detail/like-button/Likers.tsx | 5 +- .../posts/post-detail/like-button/index.tsx | 3 +- .../posts/post-detail/post-content/index.tsx | 3 +- .../bookmark-button/BookmarkButton.tsx | 5 +- .../posts/post-item/bookmark-button/index.tsx | 3 +- .../posts/post-item/comment-button/index.tsx | 5 +- .../src/molecules/posts/post-item/index.tsx | 7 +- .../posts/post-item/post-meta/index.tsx | 5 +- .../src/molecules/posts/post-list/index.tsx | 3 +- apps/web/src/molecules/profile/index.tsx | 4 +- .../web/src/molecules/tag/tag-badge/index.tsx | 5 +- .../src/molecules/tag/tag-detail/index.tsx | 2 +- apps/web/src/molecules/tag/tag-item/index.tsx | 6 +- apps/web/src/molecules/tag/tag-list/index.tsx | 8 +-- .../src/molecules/top-tags/NumberIndex.tsx | 3 +- apps/web/src/molecules/top-tags/index.tsx | 14 +++- .../src/molecules/upload/AssetsManagement.tsx | 4 +- .../molecules/upload/FileManagerContainer.tsx | 7 +- .../src/molecules/upload/ImageSearchBar.tsx | 3 +- .../molecules/upload/UploadImageButton.tsx | 3 +- apps/web/src/molecules/upload/index.tsx | 5 +- .../web/src/molecules/user-nav/LogoutMenu.tsx | 3 +- apps/web/src/molecules/user-nav/index.tsx | 3 +- apps/web/src/molecules/user/posts/filter.tsx | 3 +- apps/web/src/utils/navigation.ts | 3 +- apps/web/tsconfig.json | 6 +- .../20241223151825_rename_tag/migration.sql | 46 ++++++++++++ packages/database/prisma/schema.prisma | 6 +- packages/database/src/images/type.ts | 4 +- packages/database/src/index.ts | 3 +- packages/database/src/posts/queries.ts | 6 +- packages/database/src/posts/type.ts | 2 +- packages/database/src/tags/queries.ts | 61 +++------------- packages/database/src/tags/selects.ts | 23 +++--- 90 files changed, 318 insertions(+), 397 deletions(-) delete mode 100644 apps/web/src/hooks/useBookMark.ts delete mode 100644 apps/web/src/hooks/useLike.ts create mode 100644 packages/database/prisma/migrations/20241223151825_rename_tag/migration.sql diff --git a/apps/docs/app/page.tsx b/apps/docs/app/page.tsx index faafb106..b0c4aeaf 100644 --- a/apps/docs/app/page.tsx +++ b/apps/docs/app/page.tsx @@ -1,9 +1,8 @@ -import { Button, Header } from "ui" +import { Button } from "ui" export default function Page() { return ( <> -