Skip to content

Commit

Permalink
Merge branch 'main' into websites
Browse files Browse the repository at this point in the history
  • Loading branch information
wsqstar committed Dec 2, 2023
2 parents 3663984 + 847f5bd commit 1b408b0
Show file tree
Hide file tree
Showing 55 changed files with 1,026 additions and 522 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
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
42 changes: 42 additions & 0 deletions .eslintrc.cjs
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']
}
}
11 changes: 5 additions & 6 deletions .github/ISSUE_TEMPLATE/oscp.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'AntV OSCP 计划'
description: AntV 开源共建计划(AntV Open Source Contribution Plan,简称 AntV OSCP)
description: AntV 开源共建计划(AntV Open Source Contribution Plan,简称 AntV OSCP)
body:
- type: checkboxes
id: AntV_OSCP_program
Expand All @@ -8,7 +8,7 @@ body:
description: |
AntV 开源共建计划(AntV Open Source Contribution Plan,简称 AntV OSCP) 期望可以基于 AntV 的开源 Roadmap 开放具体开发任务到社区,以社区共建任务的形式推动“AntV” 的开源发展,也期望有更多社区伙伴各各种形式参与到 AntV 的开源共建中,共同参与数据可视化开源生态的持续建设。
若有感兴趣想要认领的任务,可直接回复认领,如果你是首次认领可先完成[新手任务](https://www.yuque.com/antv/cyggvg/cwc9kacfvd9aivsp)
options:
- label: 我同意将这个 Issue 参与 OSCP 计划
validations:
Expand All @@ -28,16 +28,15 @@ body:
id: oscp_task_description
attributes:
label: 任务介绍
description: |
description: |
简单描述任务背景信息,为了解决哪些问题
validations:
required: false
- type: textarea
id: oscp_task_info_description_2
attributes:
label: 参考说明
description: |
提供一些可参考的demo,相关教程辅助用户解决问题
description: |
提供一些可参考的demo,相关教程辅助用户解决问题
validations:
required: false

6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/site_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ body:
description: |
输入站点名称
placeholder: |
https://l7editor.antv.antgroup.com/
https://l7editor.antv.antgroup.com/
validations:
required: true
- type: input
Expand All @@ -18,7 +18,7 @@ body:
description: |
输入站点 URL
placeholder: |
https://l7editor.antv.antgroup.com/
https://l7editor.antv.antgroup.com/
validations:
required: true
- type: textarea
Expand Down Expand Up @@ -52,7 +52,7 @@ body:
- type: textarea
id: logo
attributes:
label: 图标
label: 图标
description: 站点 logo 或 icon 图标, URL 地址或者复制图片
placeholder: |
可以将你的图片拖拽到此处↓
4 changes: 4 additions & 0 deletions .husky/commit-msg
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
4 changes: 4 additions & 0 deletions .husky/pre-commit
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
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
node_modules
public
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"useTabs": false,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "none",
"semi": false
}
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,27 @@ Inspired by [larkmap](https://larkmap.com/)

[点击提交站点信息](https://github.com/DipperMap/dippermap/issues/new?assignees=&labels=&projects=&template=site_report.yml)

#### 方式二 提交 PR
#### 方式二 提交 PR

直接修改站点配置文件,通过 PR 的方式,合并代码,代码合并后站点生效

[点击修改配置文件](https://github.com/DipperMap/dippermap/edit/main/src/data/config.ts)

## 本地开发

### clone 代码

```bash
git clone https://github.com/DipperMap/dippermap.git
````
```

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

### `npm commit`

Submit your code this way.

## 👬 Contributors

![https://github.com/DipperMap/dippermap/graphs/contributors](https://contrib.rocks/image?repo=DipperMap/dippermap)
3 changes: 3 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
}
31 changes: 29 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,21 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"prettier": "prettier --write .",
"lint": "lint-staged",
"commit": "cz"
},
"lint-staged": {
"src/*.{js,ts,jsx,tsx,vue}": [
"node_modules/.bin/prettier --write .",
"node_modules/.bin/eslint --fix .",
"git add ."
],
"src/*.{css,scss,less,json,html,md}": [
"node_modules/.bin/prettier --write .",
"git add ."
]
},
"eslintConfig": {
"extends": [
Expand All @@ -43,6 +57,19 @@
]
},
"devDependencies": {
"antd": "^5.11.5"
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"antd": "^5.11.5",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.54.0",
"husky": "^8.0.3",
"lint-staged": "^15.1.0",
"prettier": "^3.1.0"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="DipperMap GIS Map GIS tools"
content="GIS 地图工具导航网站,数据下载、处理、转换、可视化、坐标转换、纠偏各自工具应有尽有。"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo.png" />
<!--
Expand Down
7 changes: 1 addition & 6 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "DipperMap",
"name": "星辰地图工具网站导航",
"name": "星辰地图网站导航",
"icons": [
{
"src": "favicon.ico",
Expand All @@ -11,11 +11,6 @@
"src": "logo.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
Expand Down
29 changes: 29 additions & 0 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,35 @@
align-items: center;
}

@media (max-width: 767px) {
.App-sider {
color: #fff;
background: #1d2531 !important;
overflow: auto;
/* height: 100vh; */
height: 64px;
/* width: 100% !important; */
position: fixed !important;
left: 0px;
top: 0;
bottom: 0;
z-index: 2;
}

.siderWidth {
width: 100% !important;
max-width: 100% !important;
min-width: 100% !important;
}

.retractSiderHeight {
height: 300px !important;
width: 100% !important;
max-width: 100% !important;
min-width: 100% !important;
}
}

/* @keyframes App-logo-spin {
from {
transform: rotate(0deg);
Expand Down
14 changes: 7 additions & 7 deletions src/App.test.tsx
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()
})
67 changes: 51 additions & 16 deletions src/App.tsx
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
Loading

0 comments on commit 1b408b0

Please sign in to comment.