Skip to content

Commit c501cc5

Browse files
committed
Add a skeleton for the new app
1 parent 9a6b7e1 commit c501cc5

File tree

6 files changed

+36
-11
lines changed

6 files changed

+36
-11
lines changed

resources/tentative/todomvc-react-18/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ pnpm-debug.log*
88
lerna-debug.log*
99

1010
node_modules
11-
dist
12-
dist-ssr
1311
*.local
1412

1513
# Editor directories and files

resources/tentative/todomvc-react-18/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>Vite + React + TS</title>
6+
<title>React 18 + Material UI + Vite</title>
77
</head>
88
<body>
99
<div id="root"></div>
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
export function App() {}
1+
export function App() {
2+
return (
3+
<h1>todos</h1>
4+
);
5+
}

resources/tentative/todomvc-react-18/src/index.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ a:hover {
2525
body {
2626
margin: 0;
2727
display: flex;
28-
place-items: center;
28+
flex-direction: column;
29+
align-items: center;
2930
min-width: 320px;
3031
min-height: 100vh;
3132
}
@@ -49,9 +50,10 @@ button {
4950
button:hover {
5051
border-color: #646cff;
5152
}
52-
button:focus,
53+
54+
a:focus-visible,
5355
button:focus-visible {
54-
outline: 4px auto -webkit-focus-ring-color;
56+
outline: 4px auto blue;
5557
}
5658

5759
@media (prefers-color-scheme: light) {
Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
import React from "react";
22
import ReactDOM from "react-dom/client";
3-
import CssBaseline from "@mui/material/CssBaseline";
4-
import App from "./App.tsx";
3+
import { CssBaseline, ThemeProvider } from "@mui/material";
4+
import { App } from "./components/App.tsx";
55
import "@fontsource/roboto/300.css";
66
import "@fontsource/roboto/400.css";
77
import "@fontsource/roboto/500.css";
88
import "@fontsource/roboto/700.css";
99
import "./index.css";
1010

11+
import { createTheme } from "@mui/material";
12+
13+
const theme = createTheme({
14+
components: {
15+
MuiButtonBase: {
16+
defaultProps: {
17+
// No more ripple, on the whole application 💣!
18+
disableRipple: true,
19+
},
20+
},
21+
},
22+
});
23+
1124
ReactDOM.createRoot(document.getElementById("root")!).render(
1225
<React.StrictMode>
13-
<CssBaseline />
14-
<App />
26+
<ThemeProvider theme={theme}>
27+
<CssBaseline />
28+
<App />
29+
</ThemeProvider>
1530
</React.StrictMode>
1631
);

resources/tentative/todomvc-react-18/vite.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@ import react from "@vitejs/plugin-react";
33

44
// https://vitejs.dev/config/
55
export default defineConfig({
6+
base: "./", // Since this will be loaded from the project root
67
plugins: [react()],
8+
build: {
9+
modulePreload: { polyfill: false },
10+
minify: false,
11+
sourcemap: true,
12+
},
713
});

0 commit comments

Comments
 (0)