File tree Expand file tree Collapse file tree 6 files changed +22
-5
lines changed
packages/crd-seed/component Expand file tree Collapse file tree 6 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 22title: 自定义主题
33abbrlink: 9f41fc98
44date: 2019-05-12 13:23:44
5+ tags: ['主题', '自定义标签1']
56-->
67
78## 使用自定义主题
Original file line number Diff line number Diff line change 11<!--
22abbrlink: lx1euo1b
3+ tags: ['组件']
34-->
45
56import { Button } from '../components/index.jsx'
Original file line number Diff line number Diff line change 1- * 该页面用来测试未使用 abbrlink 的中文路径。
1+ <!--
2+ tags: ['自定义标签1']
3+ -->
4+
5+ * 该页面用来测试未使用 abbrlink 的中文路径。
Original file line number Diff line number Diff line change 11import { useState } from 'react'
2- import classNames from 'classnames'
2+ import cx from 'classnames'
33import { Link } from 'react-router-dom'
44import Switch from 'react-switch'
5+ import { ifProd } from 'crd-client-utils'
56import { isMobile } from '../../utils'
67import Search from '../Search'
78import styles from './index.less'
@@ -20,7 +21,7 @@ const Header = ({
2021 setChecked ( value )
2122 }
2223 return (
23- < div className = { classNames ( styles . header , className ) } >
24+ < div className = { cx ( styles . header , className ) } >
2425 < div className = { styles . wrapper } >
2526 < Link to = "/" replace className = { styles . titleLink } >
2627 < div className = { styles . logo } >
@@ -35,6 +36,12 @@ const Header = ({
3536 { DOCSCONFIG && DOCSCONFIG . search ? < Search className = { styles . search } /> : null }
3637 </ div >
3738 < div className = { styles . rightArea } >
39+ < Link
40+ className = { styles [ 'tags' ] }
41+ to = { ifProd ? `/${ repo } /tags` : '/tags' }
42+ >
43+ 标签
44+ </ Link >
3845 < Switch
3946 className = { styles [ 'no-dark-mode' ] }
4047 onChange = { handleChange }
Original file line number Diff line number Diff line change 8181 }
8282}
8383
84+ .tags {
85+ font-size : 15px ;
86+ margin-right : 16px ;
87+ }
88+
8489@keyframes octocat- wave {
8590 0% , 100% {
8691 transform : rotate (0 );
Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ const Tags = ({ name }) => {
1414 ? mapTagsWithArticle . find ( ( { tagName } ) => tagName === name ) ?. mapArticle . map ( ( { path, title } ) => {
1515 return < Link
1616 className = { styles [ 'tags-text' ] }
17- // todo
18- to = { ifProd ? `/${ repo } /${ path } ` : `/${ path } ` }
17+ to = { ifProd ? `/${ repo } ${ path } ` : `${ path } ` }
1918 key = { title }
2019 >
2120 { title }
You can’t perform that action at this time.
0 commit comments