Skip to content

Commit a4fe203

Browse files
committed
chore(site): add home page
1 parent 0d0262d commit a4fe203

21 files changed

Lines changed: 291 additions & 40 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Please check if your PR fulfills the following requirements:
44

5-
- [ ] The commit message follows our [Commit Message Guidelines](https://github.com/xiejay97/react-devui/blob/main/CONTRIBUTING.md#commit-message-guidelines)
5+
- [ ] The commit message follows our [Commit Message Guidelines](https://github.com/DevCloudFE/react-devui/blob/main/CONTRIBUTING.md#commit-message-guidelines)
66
- [ ] Tests for the changes have been added (for bug fixes / features)
77
- [ ] Docs have been added / updated (for bug fixes / features)
88

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ For non-new component contributions, please refer to [Contribution Guide](CONTRI
5252

5353
## VSCode configuration
5454

55-
Refer to [README.md](https://github.com/xiejay97/react-devui/tree/main/.vscode) under the `.vscode` directory
55+
Refer to [README.md](https://github.com/DevCloudFE/react-devui/tree/main/.vscode) under the `.vscode` directory

README.zh-Hant.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ yarn site:serve
5252

5353
## VSCode 配置
5454

55-
参考 `.vscode` 目录下的 [README.md](https://github.com/xiejay97/react-devui/tree/main/.vscode)
55+
参考 `.vscode` 目录下的 [README.md](https://github.com/DevCloudFE/react-devui/tree/main/.vscode)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.0.0",
55
"license": "MIT",
66
"description": "React Component Library",
7-
"homepage": "https://github.com/xiejay97/react-devui",
7+
"homepage": "https://github.com/DevCloudFE/react-devui",
88
"engines": {
99
"node": "14.x || 16.x",
1010
"yarn": ">=1.22.4 <2",

packages/hooks/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
],
1515
"repository": {
1616
"type": "git",
17-
"url": "https://github.com/xiejay97/react-devui.git"
17+
"url": "https://github.com/DevCloudFE/react-devui.git"
1818
},
19-
"homepage": "https://github.com/xiejay97/react-devui/tree/main/packages/hooks#readme",
19+
"homepage": "https://github.com/DevCloudFE/react-devui/tree/main/packages/hooks#readme",
2020
"bugs": {
21-
"url": "https://github.com/xiejay97/react-devui/issues"
21+
"url": "https://github.com/DevCloudFE/react-devui/issues"
2222
},
2323
"license": "MIT",
2424
"sideEffects": false,

packages/icons/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
],
1515
"repository": {
1616
"type": "git",
17-
"url": "https://github.com/xiejay97/react-devui.git"
17+
"url": "https://github.com/DevCloudFE/react-devui.git"
1818
},
19-
"homepage": "https://github.com/xiejay97/react-devui/tree/main/packages/icons#readme",
19+
"homepage": "https://github.com/DevCloudFE/react-devui/tree/main/packages/icons#readme",
2020
"bugs": {
21-
"url": "https://github.com/xiejay97/react-devui/issues"
21+
"url": "https://github.com/DevCloudFE/react-devui/issues"
2222
},
2323
"license": "MIT",
2424
"sideEffects": false,

packages/site/src/app/App.tsx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { DRoot } from '@react-devui/ui';
1212

1313
import { environment } from '../environments/environment';
1414
import { AppLayout } from './components';
15+
import { Home } from './routes/home';
1516

1617
type DTheme = 'light' | 'dark';
1718

@@ -95,19 +96,26 @@ export function App() {
9596
<AppLayout />
9697
</AppContext.Provider>
9798

98-
<main ref={mainRef} className="app-main">
99-
<Routes>
100-
{routes.map(({ path, component }) => (
101-
<Route
102-
key={path}
103-
path={path}
104-
element={<Suspense fallback={<div className="app-top-line-loader" />}>{React.createElement(component)}</Suspense>}
105-
/>
106-
))}
107-
108-
<Route path="*" element={<Navigate to="/components/Button" replace={true} />}></Route>
109-
</Routes>
110-
</main>
99+
<Routes>
100+
{routes.map(({ path, component }) => (
101+
<Route
102+
key={path}
103+
path={path}
104+
element={
105+
<Suspense fallback={<div className="app-top-line-loader" />}>
106+
<main ref={mainRef} className="app-main">
107+
{React.createElement(component)}
108+
</main>
109+
</Suspense>
110+
}
111+
/>
112+
))}
113+
114+
<Route path="/" element={<Home />} />
115+
<Route path="/docs" element={<Navigate to="/docs/Overview" replace={true} />} />
116+
<Route path="/components" element={<Navigate to="/components/Button" replace={true} />} />
117+
<Route path="*" element={<Navigate to="/" replace={true} />} />
118+
</Routes>
111119
</DRoot>
112120
);
113121
}

packages/site/src/app/components/layout/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export function AppLayout() {
1616
return (
1717
<>
1818
<AppHeader aMenuOpen={menuOpen} onMenuOpenChange={setMenuOpen} />
19-
<AppSidebar aMenuOpen={menuOpen} onMenuOpenChange={setMenuOpen} />
19+
{location.pathname !== '/' && <AppSidebar aMenuOpen={menuOpen} onMenuOpenChange={setMenuOpen} />}
2020
</>
2121
);
2222
}

packages/site/src/app/components/layout/header/Header.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@
7272
display: inline-flex;
7373
align-items: center;
7474
margin-right: auto;
75+
font: inherit;
76+
color: inherit;
77+
text-decoration: none;
7578
}
7679

7780
.app-header__title {

packages/site/src/app/components/layout/header/Header.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ export function AppHeader(props: { aMenuOpen: boolean; onMenuOpenChange: (open:
3535
return (
3636
<header className="app-header is-shadow">
3737
{mediaMatch.includes('md') ? (
38-
<div className="app-header__logo-container">
38+
<Link className="app-header__logo-container" to="/">
3939
<img className="app-header__logo" src="/assets/logo.svg" alt="Logo" width="36" height="36" />
4040
<span className="app-header__title">DevUI</span>
41-
</div>
41+
</Link>
4242
) : (
4343
<button
4444
className="app-header__button app-header__button--menu"
@@ -63,7 +63,7 @@ export function AppHeader(props: { aMenuOpen: boolean; onMenuOpenChange: (open:
6363
{
6464
id: 'docs',
6565
title: (
66-
<Link className={activeId === 'docs' ? 'disabled' : undefined} to="/docs/Overview">
66+
<Link className={activeId === 'docs' ? 'disabled' : undefined} to="/docs">
6767
{t('Docs')}
6868
</Link>
6969
),
@@ -72,7 +72,7 @@ export function AppHeader(props: { aMenuOpen: boolean; onMenuOpenChange: (open:
7272
{
7373
id: 'components',
7474
title: (
75-
<Link className={activeId === 'components' ? 'disabled' : undefined} to="/components/Button">
75+
<Link className={activeId === 'components' ? 'disabled' : undefined} to="/components">
7676
{t('Components')}
7777
</Link>
7878
),
@@ -119,7 +119,7 @@ export function AppHeader(props: { aMenuOpen: boolean; onMenuOpenChange: (open:
119119
</button>
120120
<a
121121
className="app-header__button"
122-
href="//github.com/xiejay97/react-devui"
122+
href="//github.com/DevCloudFE/react-devui"
123123
target="_blank"
124124
rel="noreferrer"
125125
aria-label={t('GitHub repository')}

0 commit comments

Comments
 (0)