Skip to content

Commit

Permalink
feat: add ICP 备案 & provisional 公安备案 info to footer
Browse files Browse the repository at this point in the history
公安备案 link is hidden at first, to allow quick merging of this PR once
the ICP 备案 number is officially approved. A follow-up PR will take
care of finalizing and exposing the other bits.
  • Loading branch information
xen0n committed Oct 26, 2023
1 parent ec1d2c8 commit c1c64d3
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/theme/Footer/Copyright/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,50 @@
import React from 'react'
import Copyright from '@theme-original/Footer/Copyright'

import styles from './styles.module.css'

function ICPBeianLink(
{
province,
recordNumber,
subRecordNumber,
}: {
province: string,
recordNumber: number,
subRecordNumber: number,
},
): JSX.Element {
return (
<a href="https://beian.miit.gov.cn" target="_blank">{province}ICP备{recordNumber}号-{subRecordNumber}</a>
)
}

function MPSBeianLink(
{
province,
recordNumber,
}: {
province: string,
recordNumber: number,
},
): JSX.Element {
const queryLinkURL = `http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=${recordNumber}`
return (
<>
<img src="/img/mps-beian-logo.webp" height="28" className={styles.mpsLogo} />
<a href={queryLinkURL} target="_blank">{province}公网安备{recordNumber}</a>
</>
)
}

export default function CopyrightWrapper(props: any): JSX.Element {
return (
<>
<Copyright {...props} />
<ul className={styles.footer__beian}>
<li><ICPBeianLink province="苏" recordNumber={17027553} subRecordNumber={2} /></li>
{/* <li><MPSBeianLink province="沪" recordNumber={11223344001122} /></li> */}
</ul>
</>
)
}
10 changes: 10 additions & 0 deletions src/theme/Footer/Copyright/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* 备案信息 */
.footer__beian li {
list-style: none;
display: inline;
}

.mpsLogo {
margin: 0 0.5rem;
vertical-align: text-bottom;
}

0 comments on commit c1c64d3

Please sign in to comment.