mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
chore(examples): vite example modified
This commit is contained in:
parent
5c2966d59d
commit
e2c0ff57ff
@ -2,9 +2,9 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/src/logo.png" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite App</title>
|
||||
<title>NextUI | Vite App</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
BIN
examples/vite-react-typescript/public/favicon.ico
Normal file
BIN
examples/vite-react-typescript/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
@ -1,42 +0,0 @@
|
||||
.App {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.App-logo {
|
||||
height: 40vmin;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
.App-logo {
|
||||
animation: App-logo-spin infinite 100s linear;
|
||||
}
|
||||
}
|
||||
|
||||
.App-header {
|
||||
background-color: #282c34;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: calc(10px + 2vmin);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.App-link {
|
||||
color: #61dafb;
|
||||
}
|
||||
|
||||
@keyframes App-logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
button {
|
||||
font-size: calc(10px + 2vmin);
|
||||
}
|
||||
@ -1,36 +1,61 @@
|
||||
import { useState } from 'react'
|
||||
import logo from './logo.png'
|
||||
import './App.css'
|
||||
import {Button,Text,Link } from "@nextui-org/react";
|
||||
import { useState } from 'react';
|
||||
import {
|
||||
Button,
|
||||
Text,
|
||||
Link,
|
||||
NextUIProvider,
|
||||
createTheme,
|
||||
Container,
|
||||
Spacer
|
||||
} from '@nextui-org/react';
|
||||
|
||||
const theme = createTheme({
|
||||
type: 'light'
|
||||
});
|
||||
|
||||
function App() {
|
||||
const [count, setCount] = useState(0)
|
||||
const [count, setCount] = useState(0);
|
||||
|
||||
return (
|
||||
<div className="App">
|
||||
<header className="App-header">
|
||||
<img src={logo} className="App-logo" alt="logo" />
|
||||
<Text color="secondary"><p>Hello Vite + NextUI!</p></Text>
|
||||
<p>
|
||||
<Button type="button" onClick={() => setCount((count) => count + 1)}>
|
||||
count is: {count}
|
||||
</Button>
|
||||
</p>
|
||||
<Text color="warning">
|
||||
<p>
|
||||
<NextUIProvider theme={theme}>
|
||||
<Container
|
||||
className="App"
|
||||
css={{
|
||||
dflex: 'center',
|
||||
flexDirection: 'column',
|
||||
minHeight: '100vh'
|
||||
}}
|
||||
>
|
||||
<img src="/logo.png" className="App-logo" alt="NextUI logo" />
|
||||
<Spacer y={0.5} />
|
||||
<Text h1>Hello Vite + NextUI!</Text>
|
||||
<Spacer y={0.5} />
|
||||
<Button type="button" onClick={() => setCount((count) => count + 1)}>
|
||||
Count is: {count}
|
||||
</Button>
|
||||
<Text css={{ my: '$8' }}>
|
||||
Edit <code>App.tsx</code> and save to test HMR updates.
|
||||
</p>
|
||||
</Text>
|
||||
<p>
|
||||
<Link block color="warning" href="https://reactjs.org">Learn React</Link>
|
||||
<Text>
|
||||
<Link block href="https://reactjs.org">
|
||||
Learn React
|
||||
</Link>
|
||||
{' | '}
|
||||
<Link block color="primary" href="https://vitejs.dev/guide/features.html">Vite Docs</Link>
|
||||
<Link
|
||||
block
|
||||
color="primary"
|
||||
href="https://vitejs.dev/guide/features.html"
|
||||
>
|
||||
Vite Docs
|
||||
</Link>
|
||||
{' | '}
|
||||
<Link block color="error" href="https://nextui.org/">NextUI Docs</Link>
|
||||
</p>
|
||||
</header>
|
||||
</div>
|
||||
)
|
||||
<Link block href="https://nextui.org/">
|
||||
NextUI Docs
|
||||
</Link>
|
||||
</Text>
|
||||
</Container>
|
||||
</NextUIProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default App
|
||||
export default App;
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
||||
sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||
monospace;
|
||||
}
|
||||
@ -1,11 +1,10 @@
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import './index.css'
|
||||
import App from './App'
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import App from './App';
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
document.getElementById('root')
|
||||
)
|
||||
);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()]
|
||||
})
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user