Skip to content

Commit 537521f

Browse files
committed
ADD: Default HomePage.tsx;
Signed-off-by: HarmonySkull <[email protected]>
1 parent 9f9cee0 commit 537521f

File tree

7 files changed

+77
-18
lines changed

7 files changed

+77
-18
lines changed

src/assets/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { ReactLogo, ViteLogo } from './svg'

src/assets/svg/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { default as ReactLogo } from './react.svg'
2+
export { default as ViteLogo } from './vite.svg'
File renamed without changes.

src/assets/svg/vite.svg

Lines changed: 1 addition & 0 deletions
Loading

src/components/pages/HomePage.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import { useState } from 'react'
22

3-
import reactLogo from './assets/react.svg'
3+
import { ReactLogo, ViteLogo } from '../../assets'
44

55
const HomePage = () => {
66
const [count, setCount] = useState(0)
77

88
return (
9-
<div className='App'>
10-
<div>
9+
<section className='App'>
10+
<header>
1111
<a href='https://vitejs.dev' target='_blank' rel='noreferrer'>
12-
<img src='/vite.svg' className='logo' alt='Vite logo' />
12+
<img src={ViteLogo} className='logo' alt='Vite logo' />
1313
</a>
1414
<a href='https://reactjs.org' target='_blank' rel='noreferrer'>
15-
<img src={reactLogo} className='logo react' alt='React logo' />
15+
<img src={ReactLogo} className='logo react' alt='React logo' />
1616
</a>
17-
</div>
17+
</header>
1818
<h1>Vite + React</h1>
1919
<div className='card'>
2020
<button onClick={() => setCount((count) => count + 1)}>
@@ -27,7 +27,7 @@ const HomePage = () => {
2727
<p className='read-the-docs'>
2828
Click on the Vite and React logos to learn more
2929
</p>
30-
</div>
30+
</section>
3131
)
3232
}
3333

src/main.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { StrictMode } from 'react'
22

33
import ReactDOM from 'react-dom/client'
44

5+
import CommonRouter from './router/CommonRouter'
6+
57
import './styles/globals.sass'
68

79
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
8-
<StrictMode>
9-
10-
</StrictMode>
10+
<StrictMode>
11+
<CommonRouter />
12+
</StrictMode>
1113
)

src/styles/globals.sass

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,72 @@
11
@import "./base/_tailwind.sass"
22

3+
// Generic styles
4+
5+
\:root
6+
font-family: Inter, Avenir, Helvetica, Arial, sans-serif
7+
font-size: 16px
8+
line-height: 24px
9+
font-weight: 400
10+
color-scheme: light dark
11+
color: rgba(255, 255, 255, 0.87)
12+
background-color: #242424
13+
font-synthesis: none
14+
text-rendering: optimizeLegibility
15+
-webkit-font-smoothing: antialiased
16+
-moz-osx-font-smoothing: grayscale
17+
-webkit-text-size-adjust: 100%
18+
19+
a
20+
font-weight: 500
21+
color: #646cff
22+
text-decoration: inherit
23+
24+
a:hover
25+
color: #535bf2
26+
27+
body
28+
margin: 0
29+
display: flex
30+
place-items: center
31+
min-width: 320px
32+
min-height: 100vh
33+
34+
h1
35+
font-size: 3.2em
36+
line-height: 1.1
37+
38+
button
39+
border-radius: 8px
40+
border: 1px solid transparent
41+
padding: 0.6em 1.2em
42+
font-size: 1em
43+
font-weight: 500
44+
font-family: inherit
45+
background-color: #1a1a1a
46+
cursor: pointer
47+
transition: border-color 0.25s
48+
49+
button:hover
50+
border-color: #646cff
51+
52+
button:focus,
53+
button:focus-visible
54+
outline: 4px auto -webkit-focus-ring-color
55+
56+
@media (prefers-color-scheme: light)
57+
\:root
58+
color: #213547
59+
background-color: #ffffff
60+
61+
a:hover
62+
color: #747bff
63+
364
#root
465
max-width: 1280px
566
margin: 0 auto
667
padding: 2rem
768
text-align: center
869

9-
1070
.logo
1171
height: 6em
1272
padding: 1.5em
@@ -18,26 +78,19 @@
1878
.logo.react:hover
1979
filter: drop-shadow(0 0 2em #61dafbaa)
2080

21-
2281
@keyframes logo-spin
2382
from
2483
transform: rotate(0deg)
2584

2685
to
2786
transform: rotate(360deg)
2887

29-
30-
3188
@media (prefers-reduced-motion: no-preference)
3289
a:nth-of-type(2) .logo
3390
animation: logo-spin infinite 20s linear
3491

35-
36-
3792
.card
3893
padding: 2em
3994

40-
4195
.read-the-docs
4296
color: #888
43-

0 commit comments

Comments
 (0)