1- import { component , createCell , Fragment } from 'web-cell' ;
2- import { observer } from 'mobx-web-cell' ;
3- import { HTMLRouter } from 'cell-router/source' ;
1+ import { createCell , Fragment } from 'web-cell' ;
2+ import { CellRouter } from 'cell-router/source' ;
43import { NavBar } from 'boot-cell/source/Navigator/NavBar' ;
54import { NavLink } from 'boot-cell/source/Navigator/Nav' ;
65import { isXDomain } from 'web-utility' ;
@@ -14,89 +13,76 @@ import { MainPage } from './Main';
1413import { UpstreamPage } from './Upstream' ;
1514import { CasePage } from './Case' ;
1615
17- @observer
18- @component ( {
19- tagName : 'page-router' ,
20- renderTarget : 'children'
21- } )
22- export class PageRouter extends HTMLRouter {
23- protected history = history ;
24- protected routes = [
25- { paths : [ '' ] , component : MainPage } ,
26- { paths : [ 'upstream' ] , component : UpstreamPage } ,
27- { paths : [ 'case' ] , component : CasePage }
28- ] ;
29-
30- renderCopyright ( ) {
31- return (
32- < >
16+ function Copyright ( ) {
17+ return (
18+ < >
19+ < img
20+ className = "d-block mb-2"
21+ style = { { maxWidth : '1.5rem' } }
22+ title = "WebCell"
23+ src = { WebCell_0 }
24+ />
25+ < small className = "d-block mb-3 text-muted" >
26+ © 2018 - { new Date ( ) . getFullYear ( ) }
27+ < a target = "_blank" href = "https://github.com/EasyWebApp" >
28+ EasyWebApp team
29+ </ a >
30+ </ small >
31+ < a
32+ rel = "license"
33+ target = "_blank"
34+ href = "http://creativecommons.org/licenses/by-nc-sa/4.0/"
35+ >
3336 < img
34- className = "d-block mb-2"
35- style = { { maxWidth : '1.5rem' } }
36- title = "WebCell"
37- src = { WebCell_0 }
37+ className = "border-0"
38+ alt = "知识共享许可协议"
39+ src = "https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png"
3840 />
39- < small className = "d-block mb-3 text-muted" >
40- © 2018 - { new Date ( ) . getFullYear ( ) }
41- < a target = "_blank" href = "https://github.com/EasyWebApp" >
42- EasyWebApp team
43- </ a >
44- </ small >
41+ </ a >
42+ < small className = "d-none d-md-block" >
43+ < span
44+ // xmlns:dct="http://purl.org/dc/terms/"
45+ property = "dct:title"
46+ rel = "dct:type"
47+ href = "http://purl.org/dc/dcmitype/StillImage"
48+ >
49+ WebCell 标识
50+ </ span >
51+ 由
52+ < a
53+ // xmlns:cc="http://creativecommons.org/ns#"
54+ property = "cc:attributionName"
55+ rel = "cc:attributionURL"
56+ href = "https://web-cell.dev/"
57+ >
58+ 水歌 和 佳琦
59+ </ a >
60+ 采用
4561 < a
4662 rel = "license"
4763 target = "_blank"
48- href = "http ://creativecommons.org/licenses/by-nc-sa/4.0/"
64+ href = "https ://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh "
4965 >
50- < img
51- className = "border-0"
52- alt = "知识共享许可协议"
53- src = "https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png"
54- />
66+ 知识共享 署名-非商业性使用-相同方式共享 4.0 国际 许可协议
5567 </ a >
56- < small className = "d-none d-md-block" >
57- < span
58- // xmlns:dct="http://purl.org/dc/terms/"
59- property = "dct:title"
60- rel = "dct:type"
61- href = "http://purl.org/dc/dcmitype/StillImage"
62- >
63- WebCell 标识
64- </ span >
65- 由
66- < a
67- // xmlns:cc="http://creativecommons.org/ns#"
68- property = "cc:attributionName"
69- rel = "cc:attributionURL"
70- href = "https://web-cell.dev/"
71- >
72- 水歌 和 佳琦
73- </ a >
74- 采用
75- < a
76- rel = "license"
77- target = "_blank"
78- href = "https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh"
79- >
80- 知识共享 署名-非商业性使用-相同方式共享 4.0 国际
81- 许可协议
82- </ a >
83- 进行许可。
84- < br />
85- 基于
86- < a
87- // xmlns:dct="http://purl.org/dc/terms/"
88- rel = "dct:source"
89- href = "https://web-cell.dev/WebCell/"
90- >
91- https://web-cell.dev/WebCell/
92- </ a >
93- 上的作品创作。
94- </ small >
95- </ >
96- ) ;
97- }
68+ 进行许可。
69+ < br />
70+ 基于
71+ < a
72+ // xmlns:dct="http://purl.org/dc/terms/"
73+ rel = "dct:source"
74+ href = "https://web-cell.dev/WebCell/"
75+ >
76+ https://web-cell.dev/WebCell/
77+ </ a >
78+ 上的作品创作。
79+ </ small >
80+ </ >
81+ ) ;
82+ }
9883
99- renderFooterList = ( { title, menu } : typeof footer [ 0 ] ) => (
84+ function FooterList ( { title, menu } : typeof footer [ 0 ] ) {
85+ return (
10086 < div className = "col-4 col-md" >
10187 < h5 > { title } </ h5 >
10288 < ul className = "list-unstyled text-small" >
@@ -114,46 +100,54 @@ export class PageRouter extends HTMLRouter {
114100 </ ul >
115101 </ div >
116102 ) ;
103+ }
117104
118- render ( ) {
119- return (
120- < >
121- < NavBar
122- narrow
123- menuAlign = "around"
124- brand = {
125- < img
126- alt = "WebCell"
127- src = { WebCell_0 }
128- style = { { width : '2rem' } }
129- />
130- }
131- >
132- { header . map ( ( { title, ...rest } ) => (
133- < NavLink { ...rest } > { title } </ NavLink >
134- ) ) }
135- </ NavBar >
136-
137- < main > { super . render ( ) } </ main >
105+ export function PageFrame ( ) {
106+ return (
107+ < >
108+ < NavBar
109+ narrow
110+ menuAlign = "around"
111+ brand = {
112+ < img
113+ alt = "WebCell"
114+ src = { WebCell_0 }
115+ style = { { width : '2rem' } }
116+ />
117+ }
118+ >
119+ { header . map ( ( { title, ...rest } ) => (
120+ < NavLink { ...rest } > { title } </ NavLink >
121+ ) ) }
122+ </ NavBar >
138123
139- < hr className = { style [ 'featurette-divider' ] } />
124+ < CellRouter
125+ history = { history }
126+ routes = { [
127+ { paths : [ '' ] , component : MainPage } ,
128+ { paths : [ 'upstream' ] , component : UpstreamPage } ,
129+ { paths : [ 'case' ] , component : CasePage }
130+ ] }
131+ />
132+ < hr className = { style [ 'featurette-divider' ] } />
140133
141- < footer className = "container py-5" >
142- < div className = "row" >
143- < div className = "col-6 col-md" >
144- { this . renderCopyright ( ) }
145- </ div >
146- < a
147- className = "col-6 col-md"
148- target = "_blank"
149- href = "https://jq.qq.com/?_wv=1027&k=5he1Sw1"
150- >
151- < img src = { EasyWebApp_QQ } title = "QQ 群" />
152- </ a >
153- { footer . map ( this . renderFooterList ) }
134+ < footer className = "container py-5" >
135+ < div className = "row" >
136+ < div className = "col-6 col-md" >
137+ < Copyright />
154138 </ div >
155- </ footer >
156- </ >
157- ) ;
158- }
139+ < a
140+ className = "col-6 col-md"
141+ target = "_blank"
142+ href = "https://jq.qq.com/?_wv=1027&k=5he1Sw1"
143+ >
144+ < img src = { EasyWebApp_QQ } title = "QQ 群" />
145+ </ a >
146+ { footer . map ( item => (
147+ < FooterList { ...item } />
148+ ) ) }
149+ </ div >
150+ </ footer >
151+ </ >
152+ ) ;
159153}
0 commit comments