-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
1,026 additions
and
522 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:react/recommended', | ||
'plugin:react/jsx-runtime' | ||
], | ||
overrides: [ | ||
{ | ||
env: { | ||
node: true | ||
}, | ||
files: ['.eslintrc.{js,cjs}'], | ||
parserOptions: { | ||
sourceType: 'script' | ||
} | ||
}, | ||
{ | ||
files: ['**/*.tsx'], | ||
rules: { | ||
'react/prop-types': 'off' | ||
} | ||
} | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module' | ||
}, | ||
plugins: ['@typescript-eslint', 'react'], | ||
rules: { | ||
indent: ['error', 2], | ||
'linebreak-style': ['error', 'unix'], | ||
quotes: ['error', 'single'], | ||
semi: ['error', 'never'] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build | ||
node_modules | ||
public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"useTabs": false, | ||
"tabWidth": 2, | ||
"singleQuote": true, | ||
"trailingComma": "none", | ||
"semi": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import App from './App'; | ||
import React from 'react' | ||
import { render, screen } from '@testing-library/react' | ||
import App from './App' | ||
|
||
test('renders learn react link', () => { | ||
render(<App />); | ||
const linkElement = screen.getByText(/learn react/i); | ||
expect(linkElement).toBeInTheDocument(); | ||
}); | ||
render(<App />) | ||
const linkElement = screen.getByText(/learn react/i) | ||
expect(linkElement).toBeInTheDocument() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,69 @@ | ||
import { Layout, Button } from "antd"; | ||
import "./App.css"; | ||
import { AppCard } from "./components/app-content"; | ||
import { AppSider } from "./components/app-sider"; | ||
import { useState } from "react"; | ||
import classNames from "classnames"; | ||
import { AppHeader } from "./components/app-header"; | ||
const { Header, Footer, Sider, Content } = Layout; | ||
import { Layout } from 'antd' | ||
import './App.css' | ||
import { AppCard } from './components/app-content' | ||
import { AppSider } from './components/app-sider' | ||
import { useState, useEffect } from 'react' | ||
import classNames from 'classnames' | ||
import { AppHeader } from './components/app-header' | ||
import { AppSearch } from './components/app-search' | ||
|
||
const { Header, Footer, Sider, Content } = Layout | ||
function App() { | ||
const [collapsed, setCollapsed] = useState(false); | ||
const [collapsed, setCollapsed] = useState(false) | ||
const [screenWidth, setScreenWidth] = useState(window.innerWidth) | ||
useEffect(() => { | ||
if (window.innerWidth <= 767) { | ||
setCollapsed(true) | ||
} | ||
const handleResize = () => { | ||
setScreenWidth(window.innerWidth) | ||
} | ||
|
||
window.addEventListener('resize', handleResize) | ||
|
||
return () => { | ||
window.removeEventListener('resize', handleResize) | ||
} | ||
}, []) | ||
return ( | ||
<Layout className="App"> | ||
<Sider | ||
className={classNames([ | ||
"App-sider", | ||
collapsed ? "retractSiderWidth" : "siderWidth", | ||
'App-sider', | ||
collapsed | ||
? window.innerWidth <= 767 | ||
? 'retractSiderHeight' | ||
: 'retractSiderWidth' | ||
: 'siderWidth' | ||
])} | ||
> | ||
<AppSider /> | ||
<AppSider | ||
collapsed={collapsed} | ||
setCollapsed={setCollapsed} | ||
screenWidth={screenWidth} | ||
/> | ||
</Sider> | ||
<Layout style={{ marginLeft: collapsed ? 0 : 270 }}> | ||
<Layout | ||
style={{ | ||
marginLeft: collapsed ? 0 : screenWidth <= 767 ? 0 : 270, | ||
marginTop: screenWidth <= 767 ? 64 : 0 | ||
}} | ||
> | ||
<Header className="App-header"> | ||
<AppHeader collapsed={collapsed} setCollapsed={setCollapsed} /> | ||
<AppHeader | ||
collapsed={collapsed} | ||
setCollapsed={setCollapsed} | ||
screenWidth={screenWidth} | ||
/> | ||
</Header> | ||
<Content className="App-content"> | ||
<AppSearch /> | ||
<AppCard /> | ||
</Content> | ||
<Footer className="App-footer">DipperMap</Footer> | ||
</Layout> | ||
</Layout> | ||
); | ||
) | ||
} | ||
|
||
export default App; | ||
export default App |
Oops, something went wrong.