-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f58889c
commit e30f89a
Showing
6 changed files
with
65 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,44 @@ | ||
import React from 'react'; | ||
import React, { useEffect, useState } from 'react'; | ||
|
||
import { Container, Segment } from 'semantic-ui-react'; | ||
|
||
const Footer = () => ( | ||
<Segment vertical> | ||
<Container textAlign="center"> | ||
<div className="custom-footer"><a href="https://github.com/songquanpeng/gin-template" target='_blank'>项目模板 {process.env.REACT_APP_VERSION} </a> | ||
由 <a href="https://github.com/songquanpeng" target='_blank'>JustSong</a> 构建,源代码遵循 <a href="https://opensource.org/licenses/mit-license.php">MIT 协议</a></div> | ||
</Container> | ||
</Segment> | ||
); | ||
const Footer = () => { | ||
const [footerHTML, setFooterHTML] = useState(''); | ||
useEffect(() => { | ||
let savedFooterHTML = localStorage.getItem('footer_html'); | ||
if (!savedFooterHTML) savedFooterHTML = ''; | ||
setFooterHTML(savedFooterHTML); | ||
}); | ||
|
||
return ( | ||
<Segment vertical> | ||
<Container textAlign="center"> | ||
{footerHTML === '' ? ( | ||
<div className="custom-footer"> | ||
<a | ||
href="https://github.com/songquanpeng/gin-template" | ||
target="_blank" | ||
> | ||
项目模板 {process.env.REACT_APP_VERSION}{' '} | ||
</a> | ||
由{' '} | ||
<a href="https://github.com/songquanpeng" target="_blank"> | ||
JustSong | ||
</a>{' '} | ||
构建,源代码遵循{' '} | ||
<a href="https://opensource.org/licenses/mit-license.php"> | ||
MIT 协议 | ||
</a> | ||
</div> | ||
) : ( | ||
<div | ||
className="custom-footer" | ||
dangerouslySetInnerHTML={{ __html: footerHTML }} | ||
></div> | ||
)} | ||
</Container> | ||
</Segment> | ||
); | ||
}; | ||
|
||
export default Footer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters