From 77710c345ae05b3b6465a36974f716bb5c477388 Mon Sep 17 00:00:00 2001 From: Michael Peters Date: Mon, 9 Jan 2023 17:40:21 -0800 Subject: [PATCH] components directory --- src/components/app/index.tsx | 15 +++++++++++++++ src/{img => components/app}/mushroom-cat.png | Bin src/{ => components}/portrait/index.tsx | 0 src/index.tsx | 19 +------------------ src/module.ts | 4 ---- 5 files changed, 16 insertions(+), 22 deletions(-) create mode 100644 src/components/app/index.tsx rename src/{img => components/app}/mushroom-cat.png (100%) rename src/{ => components}/portrait/index.tsx (100%) delete mode 100644 src/module.ts diff --git a/src/components/app/index.tsx b/src/components/app/index.tsx new file mode 100644 index 0000000..a271fb8 --- /dev/null +++ b/src/components/app/index.tsx @@ -0,0 +1,15 @@ +import MushroomCatImage from './mushroom-cat.png'; + +import Portrait from '../portrait'; +import { FC } from 'react'; + +const App: FC = () => { + return ( +
+
Hello, Webpack
+ +
+ ); +}; + +export default App; diff --git a/src/img/mushroom-cat.png b/src/components/app/mushroom-cat.png similarity index 100% rename from src/img/mushroom-cat.png rename to src/components/app/mushroom-cat.png diff --git a/src/portrait/index.tsx b/src/components/portrait/index.tsx similarity index 100% rename from src/portrait/index.tsx rename to src/components/portrait/index.tsx diff --git a/src/index.tsx b/src/index.tsx index 07f37ff..e2346dd 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,25 +1,8 @@ -import { FC } from 'react'; import { createRoot } from 'react-dom/client'; - -import { doWork } from './module'; +import App from './components/app'; import './index.scss'; -import MushroomCatImage from './img/mushroom-cat.png'; - -import Portrait from './portrait'; - -const App: FC = () => { - const num = doWork(); - console.log('work gave', num); - return ( -
-
Hello, Webpack
- -
- ); -}; - const main = document.querySelector('main'); if (main === null) { throw new Error('unable to find main!'); diff --git a/src/module.ts b/src/module.ts deleted file mode 100644 index 9c9c943..0000000 --- a/src/module.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function doWork(): number { - console.log('doing some major work right now B)'); - return 4; -}