Skip to content

Commit

Permalink
website: update document.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 15, 2021
1 parent eb4a058 commit a78b75c
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 1 deletion.
27 changes: 27 additions & 0 deletions website/components/Footer/index.module.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.footer {
padding: 20px 23px 60px 23px;
a {
color: #ced1d4;
text-decoration: none;
transition: color 0.3s;
margin: 0 3px;
&:hover {
color: black;
}
& + a {
margin-left: 10px;
}
&::after {
content: ' ';
height: 13px;
width: 1px;
margin-left: 10px;
display: inline-block;
vertical-align: middle;
background-color: #e5e9ec;
}
&:last-child::after {
display: none;
}
}
}
41 changes: 41 additions & 0 deletions website/components/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react';
import styles from './index.module.less';

type FooterProps = {
editorUrl?: string;
};

const Footer = (props: FooterProps) => {
const { editorUrl } = props || {};
return (
<div className={styles.footer}>
{editorUrl && (
<a
title="Editor Current Page"
target="_blank"
rel="noreferrer"
href={`https://github.com/uiwjs/react-baidu-map/edit/master${editorUrl}`}
>
编辑当前页面
</a>
)}
<a target="_blank" rel="noopener noreferrer" href="https://github.com/uiwjs/react-baidu-map/issues/new">
提交 Bug
</a>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/uiwjs/react-baidu-map">
GitHub
</a>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/kktjs/kkt">
kkt
</a>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/uiwjs/uiw">
uiwjs
</a>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/uiwjs/react-amap">
高德地图 React 版本
</a>
</div>
);
};

export default Footer;
2 changes: 2 additions & 0 deletions website/components/Markdown/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { Component, Fragment } from 'react';
import MarkdownPreview from '@uiw/react-markdown-preview';
import rehypeAttr from 'rehype-attr';
import Code, { CodeProps } from './Code';
import Footer from '../Footer';
import styles from './index.module.less';

interface MarkdownProps {}
Expand Down Expand Up @@ -93,6 +94,7 @@ export default class Markdown extends Component<MarkdownProps, MarkdownState> {
},
}}
/>
<Footer editorUrl={this.editorUrl} />
<div style={{ padding: '10px 0 30px 25px' }}>
{this.editorUrl && (
<Fragment>
Expand Down
2 changes: 1 addition & 1 deletion website/pages/control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Markdown from '../../components/Markdown';
import { APILoader, Map, useMap, Control, useControl } from '../../../';

export default class Page extends Markdown {
getMdStr = () => import('../../../src/Control/README.md');
editorUrl = '/src/Control/README.md';
dependencies = {
APILoader,
Expand All @@ -15,5 +16,4 @@ export default class Page extends Markdown {
useState,
createRef,
};
getMdStr = () => import('../../../src/Control/README.md');
}

0 comments on commit a78b75c

Please sign in to comment.