This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
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
Showing
5 changed files
with
95 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React from "react"; | ||
import { RouteComponentProps } from "react-router-dom"; | ||
|
||
import Container from "./components/bulma/container"; | ||
import Level from "./components/bulma/level"; | ||
import Button from "./components/bulma/button"; | ||
|
||
import { getServerVersion } from "../actions/misc"; | ||
import strings from "./assets/locales"; | ||
import { appHomePage, amberHomePage } from "../const"; | ||
|
||
interface State { | ||
serverVersion: string; | ||
} | ||
|
||
class AboutView extends React.Component<RouteComponentProps, State> { | ||
state = { | ||
serverVersion: "unknown", | ||
}; | ||
componentDidMount = async () => { | ||
let versionData = await getServerVersion(); | ||
this.setState({ serverVersion: versionData.version }); | ||
}; | ||
render = () => ( | ||
<Container> | ||
<Level level className="navbar"> | ||
<Level levelItem levelLeft> | ||
<Button | ||
value={strings.btns_goBack} | ||
onClick={this.props.history.goBack} | ||
/> | ||
</Level> | ||
</Level> | ||
<Container> | ||
<p> | ||
{`${strings.app_fullVersionString( | ||
this.state.serverVersion | ||
)}. ${strings.about_licenseInfo}`} | ||
</p> | ||
<p> | ||
{strings.about_linksParagraph} | ||
<ul> | ||
<li> | ||
<a href={appHomePage}> | ||
{strings.about_amberWebHomePage} | ||
</a> | ||
</li> | ||
<li> | ||
<a href={amberHomePage}> | ||
{strings.about_amberHomePage} | ||
</a> | ||
</li> | ||
</ul> | ||
</p> | ||
</Container> | ||
</Container> | ||
); | ||
} | ||
|
||
export default AboutView; |
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,28 +1,18 @@ | ||
import React, { useState } from "react"; | ||
import React from "react"; | ||
|
||
import Level from "./bulma/level"; | ||
import Link from "./link"; | ||
|
||
import { getServerVersion } from "../../actions/misc"; | ||
import { appHomePage, amberHomePage } from "../../const"; | ||
import strings from "../assets/locales"; | ||
|
||
export const Footer: React.FC = () => { | ||
const [version, setVersion] = useState("unknown"); | ||
getServerVersion().then((r) => setVersion(r.version)); | ||
return ( | ||
<footer> | ||
<Level level> | ||
<Level levelItem className="footer_links"> | ||
<a className="text link" href={appHomePage}> | ||
{`${strings.app_versionString}`} | ||
</a> | ||
<a className="text link" href={amberHomePage}> | ||
{`${strings.amber_versionString}${version}`} | ||
</a> | ||
</Level> | ||
export const Footer: React.FC = () => ( | ||
<footer> | ||
<Level level> | ||
<Level levelItem className="footer_links"> | ||
<Link to="/about">{strings.app_versionString}</Link> | ||
</Level> | ||
</footer> | ||
); | ||
}; | ||
</Level> | ||
</footer> | ||
); | ||
|
||
export default React.memo(Footer); |