From 04c1a04590894131389a376b2838424a020cb57f Mon Sep 17 00:00:00 2001 From: Jesse Winton Date: Thu, 29 Feb 2024 15:23:14 -0800 Subject: [PATCH] consistent directory structure --- package.json | 2 +- src/app/(auth)/sign-in/page.tsx | 4 ++-- src/app/(default)/new/_components/post-form.tsx | 2 +- src/app/(default)/post/[id]/edit/page.tsx | 2 +- .../[userId]/_components/edit-profile.tsx | 4 ++-- .../[userId]/_components/update-avatar.tsx | 4 ++-- src/app/(default)/profile/[userId]/page.tsx | 2 +- src/app/layout.tsx | 10 +++++----- src/{app/_components => components}/actions.tsx | 4 ++-- .../_components => components}/alert-dialog.tsx | 2 +- .../author-with-date.tsx | 0 src/{app/_components => components}/avatar.tsx | 0 src/{app/_components => components}/banner.tsx | 0 src/{app/_components => components}/button.tsx | 2 +- src/{app/_components => components}/comment.tsx | 2 +- src/{app/_components => components}/dialog.tsx | 2 +- .../edit-post-form.tsx | 8 ++++---- src/{app/_components => components}/footer.tsx | 4 ++-- src/{app/_components => components}/header.tsx | 2 +- .../_components => components}/html-view.tsx | 0 src/{app/_components => components}/liked-by.tsx | 0 .../markdown-editor.tsx | 8 ++++---- src/{app/_components => components}/menu.tsx | 0 .../_components => components}/pagination.tsx | 4 ++-- .../_components => components}/post-action.tsx | 16 ++++++++-------- .../_components => components}/post-feed.tsx | 0 .../_components => components}/post-summary.tsx | 4 ++-- .../_components => components}/post-view.tsx | 2 +- .../_components => components}/profile-menu.tsx | 0 .../reaction-button.tsx | 4 ++-- .../_components => components}/search-dialog.tsx | 6 +++--- .../sign-in-buttons.tsx | 2 +- src/{app/_svg => components/svg}/bold-icon.tsx | 0 .../svg}/chevron-left-icon.tsx | 0 .../svg}/chevron-right-icon.tsx | 0 src/{app/_svg => components/svg}/dot-pattern.tsx | 0 src/{app/_svg => components/svg}/dots-icon.tsx | 0 src/{app/_svg => components/svg}/edit-icon.tsx | 0 .../_svg => components/svg}/eye-closed-icon.tsx | 0 src/{app/_svg => components/svg}/eye-icon.tsx | 0 src/{app/_svg => components/svg}/github-logo.tsx | 0 .../svg}/heart-filled-icon.tsx | 0 src/{app/_svg => components/svg}/heart-icon.tsx | 0 src/{app/_svg => components/svg}/italic-icon.tsx | 0 src/{app/_svg => components/svg}/link-icon.tsx | 0 src/{app/_svg => components/svg}/list-icon.tsx | 0 src/{app/_svg => components/svg}/logo.tsx | 0 .../_svg => components/svg}/markdown-icon.tsx | 0 .../_svg => components/svg}/message-icon.tsx | 0 src/{app/_svg => components/svg}/search-icon.tsx | 0 src/{app/_svg => components/svg}/spinner.tsx | 0 src/{app/_svg => components/svg}/trash-icon.tsx | 0 src/{app/_svg => components/svg}/x-icon.tsx | 0 .../_components => components}/text-field.tsx | 0 src/{app/_hooks => hooks}/use-dialog-store.ts | 0 src/{app/_hooks => hooks}/use-search-store.ts | 0 src/{app/_providers => providers}/auth.tsx | 0 src/{app/_providers => providers}/theme.tsx | 0 src/{app/_providers => providers}/toaster.tsx | 0 59 files changed, 51 insertions(+), 51 deletions(-) rename src/{app/_components => components}/actions.tsx (86%) rename src/{app/_components => components}/alert-dialog.tsx (98%) rename src/{app/_components => components}/author-with-date.tsx (100%) rename src/{app/_components => components}/avatar.tsx (100%) rename src/{app/_components => components}/banner.tsx (100%) rename src/{app/_components => components}/button.tsx (97%) rename src/{app/_components => components}/comment.tsx (99%) rename src/{app/_components => components}/dialog.tsx (98%) rename src/{app/(default)/post/[id]/_components => components}/edit-post-form.tsx (93%) rename src/{app/_components => components}/footer.tsx (88%) rename src/{app/_components => components}/header.tsx (92%) rename src/{app/_components => components}/html-view.tsx (100%) rename src/{app/_components => components}/liked-by.tsx (100%) rename src/{app/_components => components}/markdown-editor.tsx (98%) rename src/{app/_components => components}/menu.tsx (100%) rename src/{app/_components => components}/pagination.tsx (90%) rename src/{app/(default)/post/[id]/_components => components}/post-action.tsx (95%) rename src/{app/_components => components}/post-feed.tsx (100%) rename src/{app/_components => components}/post-summary.tsx (95%) rename src/{app/_components => components}/post-view.tsx (97%) rename src/{app/_components => components}/profile-menu.tsx (100%) rename src/{app/_components => components}/reaction-button.tsx (97%) rename src/{app/_components => components}/search-dialog.tsx (94%) rename src/{app/(auth)/sign-in/_components => components}/sign-in-buttons.tsx (91%) rename src/{app/_svg => components/svg}/bold-icon.tsx (100%) rename src/{app/_svg => components/svg}/chevron-left-icon.tsx (100%) rename src/{app/_svg => components/svg}/chevron-right-icon.tsx (100%) rename src/{app/_svg => components/svg}/dot-pattern.tsx (100%) rename src/{app/_svg => components/svg}/dots-icon.tsx (100%) rename src/{app/_svg => components/svg}/edit-icon.tsx (100%) rename src/{app/_svg => components/svg}/eye-closed-icon.tsx (100%) rename src/{app/_svg => components/svg}/eye-icon.tsx (100%) rename src/{app/_svg => components/svg}/github-logo.tsx (100%) rename src/{app/_svg => components/svg}/heart-filled-icon.tsx (100%) rename src/{app/_svg => components/svg}/heart-icon.tsx (100%) rename src/{app/_svg => components/svg}/italic-icon.tsx (100%) rename src/{app/_svg => components/svg}/link-icon.tsx (100%) rename src/{app/_svg => components/svg}/list-icon.tsx (100%) rename src/{app/_svg => components/svg}/logo.tsx (100%) rename src/{app/_svg => components/svg}/markdown-icon.tsx (100%) rename src/{app/_svg => components/svg}/message-icon.tsx (100%) rename src/{app/_svg => components/svg}/search-icon.tsx (100%) rename src/{app/_svg => components/svg}/spinner.tsx (100%) rename src/{app/_svg => components/svg}/trash-icon.tsx (100%) rename src/{app/_svg => components/svg}/x-icon.tsx (100%) rename src/{app/_components => components}/text-field.tsx (100%) rename src/{app/_hooks => hooks}/use-dialog-store.ts (100%) rename src/{app/_hooks => hooks}/use-search-store.ts (100%) rename src/{app/_providers => providers}/auth.tsx (100%) rename src/{app/_providers => providers}/theme.tsx (100%) rename src/{app/_providers => providers}/toaster.tsx (100%) diff --git a/package.json b/package.json index c9fac7e..bc95d65 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "db:push": "prisma db push", "db:studio": "prisma studio", "dev": "next dev", - "generate:svg": "npx @svgr/cli --no-index --out-dir src/app/_svg -- src/svg", + "generate:svg": "npx @svgr/cli --no-index --out-dir src/app/components/svg -- src/svg", "postinstall": "prisma generate", "lint": "next lint", "start": "next start" diff --git a/src/app/(auth)/sign-in/page.tsx b/src/app/(auth)/sign-in/page.tsx index 5f0a66c..77edc7a 100644 --- a/src/app/(auth)/sign-in/page.tsx +++ b/src/app/(auth)/sign-in/page.tsx @@ -1,9 +1,9 @@ import { type Metadata } from 'next' import { getProviders } from 'next-auth/react' import { redirect } from 'next/navigation' -import Logo from '~/app/_svg/logo' +import Logo from '~/components/svg/logo' import { getServerAuthSession } from '~/server/auth' -import { SignInButtons } from './_components/sign-in-buttons' +import { SignInButtons } from '~/components/sign-in-buttons' export const metadata: Metadata = { title: 'Sign In - Beam', diff --git a/src/app/(default)/new/_components/post-form.tsx b/src/app/(default)/new/_components/post-form.tsx index 897c251..6655c9f 100644 --- a/src/app/(default)/new/_components/post-form.tsx +++ b/src/app/(default)/new/_components/post-form.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { Controller, useForm } from 'react-hook-form' import { TextField } from '~/app/_components/text-field' import { Button } from '~/app/_components/button' -import MarkdownIcon from '~/app/_svg/markdown-icon' +import MarkdownIcon from '~/components/svg/markdown-icon' import { MarkdownEditor } from '~/app/_components/markdown-editor' import { useRouter } from 'next/navigation' import { api } from '~/trpc/react' diff --git a/src/app/(default)/post/[id]/edit/page.tsx b/src/app/(default)/post/[id]/edit/page.tsx index d555ddd..e05a796 100644 --- a/src/app/(default)/post/[id]/edit/page.tsx +++ b/src/app/(default)/post/[id]/edit/page.tsx @@ -1,7 +1,7 @@ import { getServerAuthSession } from '~/server/auth' import { api } from '~/trpc/server' -import { EditPostForm } from '../_components/edit-post-form' +import { EditPostForm } from '~/components/edit-post-form' type ProfilePageParams = { params: { diff --git a/src/app/(default)/profile/[userId]/_components/edit-profile.tsx b/src/app/(default)/profile/[userId]/_components/edit-profile.tsx index 2a793ab..0b267c2 100644 --- a/src/app/(default)/profile/[userId]/_components/edit-profile.tsx +++ b/src/app/(default)/profile/[userId]/_components/edit-profile.tsx @@ -12,8 +12,8 @@ import { AlertDialogCancel, } from '~/app/_components/alert-dialog' import { TextField } from '~/app/_components/text-field' -import { useDialogStore } from '~/app/_hooks/use-dialog-store' -import EditIcon from '~/app/_svg/edit-icon' +import { useDialogStore } from '~/hooks/use-dialog-store' +import EditIcon from '~/components/svg/edit-icon' import { api } from '~/trpc/react' import { type RouterOutputs } from '~/trpc/shared' import { env } from '~/env' diff --git a/src/app/(default)/profile/[userId]/_components/update-avatar.tsx b/src/app/(default)/profile/[userId]/_components/update-avatar.tsx index 06a4e3a..1912e87 100644 --- a/src/app/(default)/profile/[userId]/_components/update-avatar.tsx +++ b/src/app/(default)/profile/[userId]/_components/update-avatar.tsx @@ -14,8 +14,8 @@ import { } from '~/app/_components/alert-dialog' import { Avatar } from '~/app/_components/avatar' import { Button } from '~/app/_components/button' -import { useDialogStore } from '~/app/_hooks/use-dialog-store' -import EditIcon from '~/app/_svg/edit-icon' +import { useDialogStore } from '~/hooks/use-dialog-store' +import EditIcon from '~/components/svg/edit-icon' import { uploadImage } from '~/server/cloudinary' import { api } from '~/trpc/react' diff --git a/src/app/(default)/profile/[userId]/page.tsx b/src/app/(default)/profile/[userId]/page.tsx index 1648012..2298046 100644 --- a/src/app/(default)/profile/[userId]/page.tsx +++ b/src/app/(default)/profile/[userId]/page.tsx @@ -1,4 +1,4 @@ -import DotPattern from '~/app/_svg/dot-pattern' +import DotPattern from '~/components/svg/dot-pattern' import { getServerAuthSession } from '~/server/auth' import { api } from '~/trpc/server' diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 8198132..14d6ec7 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -5,13 +5,13 @@ import { cookies } from 'next/headers' import { TRPCReactProvider } from '~/trpc/react' import { classNames } from '~/utils/core' -import { ThemeProvider } from '~/app/_providers/theme' -import { Toaster } from '~/app/_providers/toaster' +import { ThemeProvider } from '~/providers/theme' +import { Toaster } from '~/providers/toaster' -import { SearchDialog } from './_components/search-dialog' -import { AlertDialog } from './_components/alert-dialog' +import { SearchDialog } from '~/components/search-dialog' +import { AlertDialog } from '~/components/alert-dialog' import { getServerAuthSession } from '~/server/auth' -import { SessionProvider } from './_providers/auth' +import { SessionProvider } from '~/providers/auth' const inter = localFont({ variable: '--font-sans', diff --git a/src/app/_components/actions.tsx b/src/components/actions.tsx similarity index 86% rename from src/app/_components/actions.tsx rename to src/components/actions.tsx index eae3022..bad5301 100644 --- a/src/app/_components/actions.tsx +++ b/src/components/actions.tsx @@ -3,8 +3,8 @@ import { type Session } from 'next-auth' import { Button } from './button' import { ProfileMenu } from './profile-menu' -import { useSearchStore } from '~/app/_hooks/use-search-store' -import SearchIcon from '../_svg/search-icon' +import { useSearchStore } from '~/hooks/use-search-store' +import SearchIcon from '~/components/svg/search-icon' export const Actions = ({ session }: { session: Session | null }) => { const { toggleOpen } = useSearchStore() diff --git a/src/app/_components/alert-dialog.tsx b/src/components/alert-dialog.tsx similarity index 98% rename from src/app/_components/alert-dialog.tsx rename to src/components/alert-dialog.tsx index 66e39ea..471109c 100644 --- a/src/app/_components/alert-dialog.tsx +++ b/src/components/alert-dialog.tsx @@ -2,7 +2,7 @@ import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog' import * as React from 'react' -import XIcon from '../_svg/x-icon' +import XIcon from '~/components/svg/x-icon' import { useDialogStore } from '../_hooks/use-dialog-store' import { type ReactNode } from 'react' import { classNames } from '~/utils/core' diff --git a/src/app/_components/author-with-date.tsx b/src/components/author-with-date.tsx similarity index 100% rename from src/app/_components/author-with-date.tsx rename to src/components/author-with-date.tsx diff --git a/src/app/_components/avatar.tsx b/src/components/avatar.tsx similarity index 100% rename from src/app/_components/avatar.tsx rename to src/components/avatar.tsx diff --git a/src/app/_components/banner.tsx b/src/components/banner.tsx similarity index 100% rename from src/app/_components/banner.tsx rename to src/components/banner.tsx diff --git a/src/app/_components/button.tsx b/src/components/button.tsx similarity index 97% rename from src/app/_components/button.tsx rename to src/components/button.tsx index 9270ece..bfea750 100644 --- a/src/app/_components/button.tsx +++ b/src/components/button.tsx @@ -9,7 +9,7 @@ import { cva, type VariantProps } from 'class-variance-authority' import Link, { type LinkProps } from 'next/link' import { classNames } from '~/utils/core' -import Spinner from '../_svg/spinner' +import Spinner from '~/components/svg/spinner' const button = cva( 'inline-flex items-center justify-center font-semibold transition-colors rounded-full focus-ring px-4 text-sm h-8', diff --git a/src/app/_components/comment.tsx b/src/components/comment.tsx similarity index 99% rename from src/app/_components/comment.tsx rename to src/components/comment.tsx index 0e4782c..e5626a7 100644 --- a/src/app/_components/comment.tsx +++ b/src/components/comment.tsx @@ -13,7 +13,7 @@ import { MenuItem, MenuItemsContent, } from './menu' -import DotsIcon from '../_svg/dots-icon' +import DotsIcon from '~/components/svg/dots-icon' import { Button } from './button' import { HtmlView } from './html-view' import { api } from '~/trpc/react' diff --git a/src/app/_components/dialog.tsx b/src/components/dialog.tsx similarity index 98% rename from src/app/_components/dialog.tsx rename to src/components/dialog.tsx index a286597..1a919b2 100644 --- a/src/app/_components/dialog.tsx +++ b/src/components/dialog.tsx @@ -2,7 +2,7 @@ import * as DialogPrimitive from '@radix-ui/react-dialog' import * as React from 'react' -import XIcon from '../_svg/x-icon' +import XIcon from '~/components/svg/x-icon' import { useDialogStore } from '../_hooks/use-dialog-store' import { type ReactNode } from 'react' import { classNames } from '~/utils/core' diff --git a/src/app/(default)/post/[id]/_components/edit-post-form.tsx b/src/components/edit-post-form.tsx similarity index 93% rename from src/app/(default)/post/[id]/_components/edit-post-form.tsx rename to src/components/edit-post-form.tsx index 5d61fb5..84876da 100644 --- a/src/app/(default)/post/[id]/_components/edit-post-form.tsx +++ b/src/components/edit-post-form.tsx @@ -2,10 +2,10 @@ import * as React from 'react' import { Controller, useForm } from 'react-hook-form' -import { TextField } from '~/app/_components/text-field' -import { Button } from '~/app/_components/button' -import MarkdownIcon from '~/app/_svg/markdown-icon' -import { MarkdownEditor } from '~/app/_components/markdown-editor' +import { TextField } from '~/components/text-field' +import { Button } from '~/components/button' +import MarkdownIcon from '~/components/svg/markdown-icon' +import { MarkdownEditor } from '~/components/markdown-editor' import { api } from '~/trpc/react' import { useRouter } from 'next/navigation' diff --git a/src/app/_components/footer.tsx b/src/components/footer.tsx similarity index 88% rename from src/app/_components/footer.tsx rename to src/components/footer.tsx index 6159cae..0885a0c 100644 --- a/src/app/_components/footer.tsx +++ b/src/components/footer.tsx @@ -1,5 +1,5 @@ -import GithubLogo from '../_svg/github-logo' -import HeartFilledIcon from '../_svg/heart-filled-icon' +import GithubLogo from '~/components/svg/github-logo' +import HeartFilledIcon from '~/components/svg/heart-filled-icon' export const Footer = () => { return ( diff --git a/src/app/_components/header.tsx b/src/components/header.tsx similarity index 92% rename from src/app/_components/header.tsx rename to src/components/header.tsx index f386bd9..18c939a 100644 --- a/src/app/_components/header.tsx +++ b/src/components/header.tsx @@ -1,5 +1,5 @@ import Link from 'next/link' -import Logo from '../_svg/logo' +import Logo from '~/components/svg/logo' import { getServerAuthSession } from '~/server/auth' import { Actions } from './actions' diff --git a/src/app/_components/html-view.tsx b/src/components/html-view.tsx similarity index 100% rename from src/app/_components/html-view.tsx rename to src/components/html-view.tsx diff --git a/src/app/_components/liked-by.tsx b/src/components/liked-by.tsx similarity index 100% rename from src/app/_components/liked-by.tsx rename to src/components/liked-by.tsx diff --git a/src/app/_components/markdown-editor.tsx b/src/components/markdown-editor.tsx similarity index 98% rename from src/app/_components/markdown-editor.tsx rename to src/components/markdown-editor.tsx index a84d0c1..11d9aa4 100644 --- a/src/app/_components/markdown-editor.tsx +++ b/src/components/markdown-editor.tsx @@ -14,11 +14,11 @@ import TextareaMarkdown, { type TextareaMarkdownRef, } from 'textarea-markdown-editor' -import BoldIcon from '../_svg/bold-icon' +import BoldIcon from '~/components/svg/bold-icon' import { classNames } from '~/utils/core' -import ItalicIcon from '../_svg/italic-icon' -import LinkIcon from '../_svg/link-icon' -import ListIcon from '../_svg/list-icon' +import ItalicIcon from '~/components/svg/italic-icon' +import LinkIcon from '~/components/svg/link-icon' +import ListIcon from '~/components/svg/list-icon' import { HtmlView } from './html-view' import { type SuggestionType, getSuggestionData } from '~/utils/suggestion' import { env } from '~/env' diff --git a/src/app/_components/menu.tsx b/src/components/menu.tsx similarity index 100% rename from src/app/_components/menu.tsx rename to src/components/menu.tsx diff --git a/src/app/_components/pagination.tsx b/src/components/pagination.tsx similarity index 90% rename from src/app/_components/pagination.tsx rename to src/components/pagination.tsx index 7da6506..2f2fd14 100644 --- a/src/app/_components/pagination.tsx +++ b/src/components/pagination.tsx @@ -2,8 +2,8 @@ import { usePathname } from 'next/navigation' import { Button } from './button' -import ChevronLeftIcon from '../_svg/chevron-left-icon' -import ChevronRightIcon from '../_svg/chevron-right-icon' +import ChevronLeftIcon from '~/components/svg/chevron-left-icon' +import ChevronRightIcon from '~/components/svg/chevron-right-icon' type PaginationProps = { itemCount: number diff --git a/src/app/(default)/post/[id]/_components/post-action.tsx b/src/components/post-action.tsx similarity index 95% rename from src/app/(default)/post/[id]/_components/post-action.tsx rename to src/components/post-action.tsx index 4c952ca..9cbdff8 100644 --- a/src/app/(default)/post/[id]/_components/post-action.tsx +++ b/src/components/post-action.tsx @@ -2,7 +2,7 @@ import { useRouter } from 'next/navigation' import { toast } from 'react-hot-toast' -import { Button } from '~/app/_components/button' +import { Button } from '~/components/button' import { AlertDialogAction, AlertDialogActions, @@ -11,7 +11,7 @@ import { AlertDialogDescription, AlertDialogTitle, AlertDialogCancel, -} from '~/app/_components/alert-dialog' +} from '~/components/alert-dialog' import { Menu, MenuButton, @@ -20,12 +20,12 @@ import { MenuItem, MenuItemsContent, MenuItemLink, -} from '~/app/_components/menu' -import { useDialogStore } from '~/app/_hooks/use-dialog-store' -import DotsIcon from '~/app/_svg/dots-icon' -import EditIcon from '~/app/_svg/edit-icon' -import EyeIcon from '~/app/_svg/eye-icon' -import TrashIcon from '~/app/_svg/trash-icon' +} from '~/components/menu' +import { useDialogStore } from '~/hooks/use-dialog-store' +import DotsIcon from '~/components/svg/dots-icon' +import EditIcon from '~/components/svg/edit-icon' +import EyeIcon from '~/components/svg/eye-icon' +import TrashIcon from '~/components/svg/trash-icon' import { api } from '~/trpc/react' type PostActionProps = { diff --git a/src/app/_components/post-feed.tsx b/src/components/post-feed.tsx similarity index 100% rename from src/app/_components/post-feed.tsx rename to src/components/post-feed.tsx diff --git a/src/app/_components/post-summary.tsx b/src/components/post-summary.tsx similarity index 95% rename from src/app/_components/post-summary.tsx rename to src/components/post-summary.tsx index 535411b..36046eb 100644 --- a/src/app/_components/post-summary.tsx +++ b/src/components/post-summary.tsx @@ -6,8 +6,8 @@ import { classNames } from '~/utils/core' import { formatDistanceToNow } from 'date-fns/formatDistanceToNow' import { AuthorWithDate } from '~/app/_components/author-with-date' import { HtmlView } from '~/app/_components/html-view' -import ChevronRightIcon from '~/app/_svg/chevron-right-icon' -import MessageIcon from '~/app/_svg/message-icon' +import ChevronRightIcon from '~/components/svg/chevron-right-icon' +import MessageIcon from '~/components/svg/message-icon' import { ReactionButton } from './reaction-button' import { Suspense } from 'react' diff --git a/src/app/_components/post-view.tsx b/src/components/post-view.tsx similarity index 97% rename from src/app/_components/post-view.tsx rename to src/components/post-view.tsx index bb23d06..8d38173 100644 --- a/src/app/_components/post-view.tsx +++ b/src/components/post-view.tsx @@ -9,7 +9,7 @@ import { AuthorWithDate } from './author-with-date' import { HtmlView } from './html-view' import { ReactionButton } from './reaction-button' import { Button } from './button' -import MessageIcon from '../_svg/message-icon' +import MessageIcon from '~/components/svg/message-icon' import { Suspense } from 'react' type PostViewProps = { diff --git a/src/app/_components/profile-menu.tsx b/src/components/profile-menu.tsx similarity index 100% rename from src/app/_components/profile-menu.tsx rename to src/components/profile-menu.tsx diff --git a/src/app/_components/reaction-button.tsx b/src/components/reaction-button.tsx similarity index 97% rename from src/app/_components/reaction-button.tsx rename to src/components/reaction-button.tsx index c143b76..503a34d 100644 --- a/src/app/_components/reaction-button.tsx +++ b/src/components/reaction-button.tsx @@ -2,8 +2,8 @@ import { classNames } from '~/utils/core' import { Button } from './button' -import HeartFilledIcon from '../_svg/heart-filled-icon' -import HeartIcon from '../_svg/heart-icon' +import HeartFilledIcon from '~/components/svg/heart-filled-icon' +import HeartIcon from '~/components/svg/heart-icon' import { api } from '~/trpc/react' import { useState } from 'react' diff --git a/src/app/_components/search-dialog.tsx b/src/components/search-dialog.tsx similarity index 94% rename from src/app/_components/search-dialog.tsx rename to src/components/search-dialog.tsx index d421a25..7977972 100644 --- a/src/app/_components/search-dialog.tsx +++ b/src/components/search-dialog.tsx @@ -6,9 +6,9 @@ import { useHotkeys } from 'react-hotkeys-hook' import { useRouter } from 'next/navigation' import { useDebounce } from 'use-debounce' import { api } from '~/trpc/react' -import SearchIcon from '../_svg/search-icon' -import SpinnerIcon from '../_svg/spinner' -import { useSearchStore } from '~/app/_hooks/use-search-store' +import SearchIcon from '~/components/svg/search-icon' +import SpinnerIcon from '~/components/svg/spinner' +import { useSearchStore } from '~/hooks/use-search-store' export const SearchDialog = () => { const { open, toggleOpen } = useSearchStore() diff --git a/src/app/(auth)/sign-in/_components/sign-in-buttons.tsx b/src/components/sign-in-buttons.tsx similarity index 91% rename from src/app/(auth)/sign-in/_components/sign-in-buttons.tsx rename to src/components/sign-in-buttons.tsx index a1a7e55..4d14f76 100644 --- a/src/app/(auth)/sign-in/_components/sign-in-buttons.tsx +++ b/src/components/sign-in-buttons.tsx @@ -1,6 +1,6 @@ 'use client' import { type getProviders, signIn } from 'next-auth/react' -import { Button } from '~/app/_components/button' +import { Button } from '~/components/button' export const SignInButtons = ({ providers, diff --git a/src/app/_svg/bold-icon.tsx b/src/components/svg/bold-icon.tsx similarity index 100% rename from src/app/_svg/bold-icon.tsx rename to src/components/svg/bold-icon.tsx diff --git a/src/app/_svg/chevron-left-icon.tsx b/src/components/svg/chevron-left-icon.tsx similarity index 100% rename from src/app/_svg/chevron-left-icon.tsx rename to src/components/svg/chevron-left-icon.tsx diff --git a/src/app/_svg/chevron-right-icon.tsx b/src/components/svg/chevron-right-icon.tsx similarity index 100% rename from src/app/_svg/chevron-right-icon.tsx rename to src/components/svg/chevron-right-icon.tsx diff --git a/src/app/_svg/dot-pattern.tsx b/src/components/svg/dot-pattern.tsx similarity index 100% rename from src/app/_svg/dot-pattern.tsx rename to src/components/svg/dot-pattern.tsx diff --git a/src/app/_svg/dots-icon.tsx b/src/components/svg/dots-icon.tsx similarity index 100% rename from src/app/_svg/dots-icon.tsx rename to src/components/svg/dots-icon.tsx diff --git a/src/app/_svg/edit-icon.tsx b/src/components/svg/edit-icon.tsx similarity index 100% rename from src/app/_svg/edit-icon.tsx rename to src/components/svg/edit-icon.tsx diff --git a/src/app/_svg/eye-closed-icon.tsx b/src/components/svg/eye-closed-icon.tsx similarity index 100% rename from src/app/_svg/eye-closed-icon.tsx rename to src/components/svg/eye-closed-icon.tsx diff --git a/src/app/_svg/eye-icon.tsx b/src/components/svg/eye-icon.tsx similarity index 100% rename from src/app/_svg/eye-icon.tsx rename to src/components/svg/eye-icon.tsx diff --git a/src/app/_svg/github-logo.tsx b/src/components/svg/github-logo.tsx similarity index 100% rename from src/app/_svg/github-logo.tsx rename to src/components/svg/github-logo.tsx diff --git a/src/app/_svg/heart-filled-icon.tsx b/src/components/svg/heart-filled-icon.tsx similarity index 100% rename from src/app/_svg/heart-filled-icon.tsx rename to src/components/svg/heart-filled-icon.tsx diff --git a/src/app/_svg/heart-icon.tsx b/src/components/svg/heart-icon.tsx similarity index 100% rename from src/app/_svg/heart-icon.tsx rename to src/components/svg/heart-icon.tsx diff --git a/src/app/_svg/italic-icon.tsx b/src/components/svg/italic-icon.tsx similarity index 100% rename from src/app/_svg/italic-icon.tsx rename to src/components/svg/italic-icon.tsx diff --git a/src/app/_svg/link-icon.tsx b/src/components/svg/link-icon.tsx similarity index 100% rename from src/app/_svg/link-icon.tsx rename to src/components/svg/link-icon.tsx diff --git a/src/app/_svg/list-icon.tsx b/src/components/svg/list-icon.tsx similarity index 100% rename from src/app/_svg/list-icon.tsx rename to src/components/svg/list-icon.tsx diff --git a/src/app/_svg/logo.tsx b/src/components/svg/logo.tsx similarity index 100% rename from src/app/_svg/logo.tsx rename to src/components/svg/logo.tsx diff --git a/src/app/_svg/markdown-icon.tsx b/src/components/svg/markdown-icon.tsx similarity index 100% rename from src/app/_svg/markdown-icon.tsx rename to src/components/svg/markdown-icon.tsx diff --git a/src/app/_svg/message-icon.tsx b/src/components/svg/message-icon.tsx similarity index 100% rename from src/app/_svg/message-icon.tsx rename to src/components/svg/message-icon.tsx diff --git a/src/app/_svg/search-icon.tsx b/src/components/svg/search-icon.tsx similarity index 100% rename from src/app/_svg/search-icon.tsx rename to src/components/svg/search-icon.tsx diff --git a/src/app/_svg/spinner.tsx b/src/components/svg/spinner.tsx similarity index 100% rename from src/app/_svg/spinner.tsx rename to src/components/svg/spinner.tsx diff --git a/src/app/_svg/trash-icon.tsx b/src/components/svg/trash-icon.tsx similarity index 100% rename from src/app/_svg/trash-icon.tsx rename to src/components/svg/trash-icon.tsx diff --git a/src/app/_svg/x-icon.tsx b/src/components/svg/x-icon.tsx similarity index 100% rename from src/app/_svg/x-icon.tsx rename to src/components/svg/x-icon.tsx diff --git a/src/app/_components/text-field.tsx b/src/components/text-field.tsx similarity index 100% rename from src/app/_components/text-field.tsx rename to src/components/text-field.tsx diff --git a/src/app/_hooks/use-dialog-store.ts b/src/hooks/use-dialog-store.ts similarity index 100% rename from src/app/_hooks/use-dialog-store.ts rename to src/hooks/use-dialog-store.ts diff --git a/src/app/_hooks/use-search-store.ts b/src/hooks/use-search-store.ts similarity index 100% rename from src/app/_hooks/use-search-store.ts rename to src/hooks/use-search-store.ts diff --git a/src/app/_providers/auth.tsx b/src/providers/auth.tsx similarity index 100% rename from src/app/_providers/auth.tsx rename to src/providers/auth.tsx diff --git a/src/app/_providers/theme.tsx b/src/providers/theme.tsx similarity index 100% rename from src/app/_providers/theme.tsx rename to src/providers/theme.tsx diff --git a/src/app/_providers/toaster.tsx b/src/providers/toaster.tsx similarity index 100% rename from src/app/_providers/toaster.tsx rename to src/providers/toaster.tsx