From 2649651e768dc0d8a409f0cb6cd64978f43cb347 Mon Sep 17 00:00:00 2001 From: Arthur Green Date: Tue, 31 Oct 2023 03:50:04 +0400 Subject: [PATCH] refactor: folder changes --- src/components/App.tsx | 2 +- src/components/Breadcrumbs/Breadcrumbs.tsx | 2 +- src/components/Breadcrumbs/index.ts | 2 +- src/components/Input/Input.tsx | 2 ++ src/components/Input/index.ts | 2 +- src/pages/posts/[postId]/edit.tsx | 3 ++- src/pages/posts/new.tsx | 2 +- 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index b2b26f62..3fdc1d33 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -4,7 +4,7 @@ import { GrowthBook, GrowthBookProvider } from '@growthbook/growthbook-react'; import Header from '@components/Header'; import Alert from '@components/Alert'; -import Breadcrumbs from '@components/Breadcrumbs'; +import { Breadcrumbs } from '@components/breadcrumbs'; // Create a GrowthBook instance const growthbook = new GrowthBook({ diff --git a/src/components/Breadcrumbs/Breadcrumbs.tsx b/src/components/Breadcrumbs/Breadcrumbs.tsx index 5a037fb4..56fcf26e 100644 --- a/src/components/Breadcrumbs/Breadcrumbs.tsx +++ b/src/components/Breadcrumbs/Breadcrumbs.tsx @@ -2,7 +2,7 @@ import { useMatches } from 'react-router-dom'; import classes from './breadcrumbs.module.css'; -function Breadcrumbs() { +export function Breadcrumbs() { const matches = useMatches(); const crumbs = matches // first get rid of any matches that don't have handle and crumb diff --git a/src/components/Breadcrumbs/index.ts b/src/components/Breadcrumbs/index.ts index 3ff68ca5..28140a25 100644 --- a/src/components/Breadcrumbs/index.ts +++ b/src/components/Breadcrumbs/index.ts @@ -1 +1 @@ -export { default } from './Breadcrumbs'; +export { Breadcrumbs } from './Breadcrumbs'; diff --git a/src/components/Input/Input.tsx b/src/components/Input/Input.tsx index 31dfad69..eab25890 100644 --- a/src/components/Input/Input.tsx +++ b/src/components/Input/Input.tsx @@ -45,3 +45,5 @@ export function Input({ /> ); } + +export default Input; diff --git a/src/components/Input/index.ts b/src/components/Input/index.ts index a2e60496..6322cf32 100644 --- a/src/components/Input/index.ts +++ b/src/components/Input/index.ts @@ -1 +1 @@ -export { default } from './Input'; +export { Input } from './Input'; diff --git a/src/pages/posts/[postId]/edit.tsx b/src/pages/posts/[postId]/edit.tsx index 84683c5a..d05fb979 100644 --- a/src/pages/posts/[postId]/edit.tsx +++ b/src/pages/posts/[postId]/edit.tsx @@ -5,7 +5,8 @@ import { useLiveQuery } from 'dexie-react-hooks'; import { db } from '@services/db'; -import Input from '@components/Input'; +import { Input } from '@components/input'; + import type { IBlogPost } from '@components/PostPreview'; interface IBlogPostProps { diff --git a/src/pages/posts/new.tsx b/src/pages/posts/new.tsx index 52613bf3..c037bf9c 100644 --- a/src/pages/posts/new.tsx +++ b/src/pages/posts/new.tsx @@ -5,7 +5,7 @@ import { v4 as uuidv4 } from 'uuid'; import { db } from '@services/db'; -import Input from '@components/Input'; +import { Input } from '@components/input'; function getRandomInt(max: number) { return Math.floor(Math.random() * max);