Skip to content

Commit ec8c25c

Browse files
committed
๐Ÿ”ง: react-router-dom ์„ค์น˜ ํ›„ ์ปดํฌ๋„ŒํŠธ ์—ฐ๊ฒฐ ๋ฐ ์ „์ฒด์ ์ธ ํ…Œ์ŠคํŠธ ๊ฒ€ํ†  ์™„๋ฃŒ
1 parent f17eb9b commit ec8c25c

File tree

7 files changed

+127
-28
lines changed

7 files changed

+127
-28
lines changed

โ€Žfront/package.jsonโ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@
1010
"@types/node": "^16.18.119",
1111
"@types/react": "^18.3.12",
1212
"@types/react-dom": "^18.3.1",
13+
"class-variance-authority": "^0.7.0",
1314
"react": "^18.3.1",
1415
"react-dom": "^18.3.1",
16+
"react-router-dom": "^7.0.1",
1517
"react-scripts": "5.0.1",
1618
"typescript": "^4.9.5",
1719
"web-vitals": "^2.1.4"
1820
},
1921
"devDependencies": {
2022
"@typescript-eslint/eslint-plugin": "5.18.0",
2123
"@typescript-eslint/parser": "5.18.0",
24+
"autoprefixer": "^10.4.20",
2225
"eslint": "8.22.0",
2326
"eslint-config-airbnb": "19.0.4",
2427
"eslint-config-prettier": "9.1.0",
@@ -28,7 +31,9 @@
2831
"eslint-plugin-prefer-arrow": "1.2.3",
2932
"eslint-plugin-prettier": "5.2.1",
3033
"eslint-plugin-react": "7.37.2",
31-
"prettier": "3.3.3"
34+
"postcss": "^8.4.49",
35+
"prettier": "3.3.3",
36+
"tailwindcss": "^3.4.15"
3237
},
3338
"scripts": {
3439
"start": "react-scripts start",

โ€Žfront/pnpm-lock.yamlโ€Ž

Lines changed: 82 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

โ€Žfront/postcss.config.jsโ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
};
7+
// ๋งŒ์•ฝ craco์™€ ๊ฐ™์€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ ์ƒ๋žตํ•ด๋„ ๋œ๋‹ค.

โ€Žfront/src/App.tsxโ€Ž

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
1-
import React from 'react';
2-
import logo from './logo.svg';
3-
import './App.css';
1+
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
2+
import MyTest from './Page/MyTest';
43

54
const App = () => {
65
return (
7-
<div className='App'>
8-
<header className='App-header'>
9-
<img src={logo} className='App-logo' alt='logo' />
10-
<p>
11-
Edit <code>src/App.tsx</code> and save to reload.
12-
</p>
13-
<a className='App-link' href='https://reactjs.org' target='_blank' rel='noopener noreferrer'>
14-
Learn React
15-
</a>
16-
</header>
17-
</div>
6+
<Router>
7+
<Routes>
8+
<Route path='/' element={<MyTest />} />
9+
</Routes>
10+
</Router>
1811
);
1912
};
2013

โ€Žfront/src/Page/MyTest.tsxโ€Ž

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
3+
const MyTest = () => {
4+
return (
5+
<div className='py-10 text-center text-white bg-blue-500'>
6+
<h1 className='text-4xl font-bold'>Hello, Tailwind CSS with pnpm!</h1>
7+
<span className='bg-slate-500'>test</span>
8+
</div>
9+
);
10+
};
11+
12+
export default MyTest;

โ€Žfront/src/index.cssโ€Ž

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
body {
2-
margin: 0;
3-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4-
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5-
sans-serif;
6-
-webkit-font-smoothing: antialiased;
7-
-moz-osx-font-smoothing: grayscale;
8-
}
9-
10-
code {
11-
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
12-
monospace;
13-
}
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

โ€Žfront/tailwind.config.jsโ€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/** @type {import('tailwindcss').Config} */
2+
module.exports = {
3+
content: [
4+
'./src/**/*.{html,js,jsx,ts,tsx}', // ์‚ฌ์šฉํ•  ํŒŒ์ผ๋“ค
5+
],
6+
theme: {
7+
extend: {},
8+
},
9+
plugins: [],
10+
};

0 commit comments

Comments
ย (0)