feat(home): add version in footer

This commit is contained in:
plebeius.eth
2024-04-10 17:56:34 +02:00
parent 032a9fea33
commit 4614e5dbc4
2 changed files with 76 additions and 40 deletions
+16
View File
@@ -152,6 +152,22 @@
text-transform: capitalize; text-transform: capitalize;
} }
.version {
text-align: center;
padding-top: 2em;
padding-bottom: 1em;
font-size: 11px;
}
.version a {
text-decoration: none;
color: unset;
}
.version a:hover {
text-decoration: underline;
}
@media (max-width: 640px) { @media (max-width: 640px) {
.content { .content {
min-width: 0; min-width: 0;
+20
View File
@@ -151,9 +151,13 @@ const downloadAppLink = (() => {
} }
})(); })();
const isElectron = window.isElectron === true;
const commitRef = process.env.REACT_APP_COMMIT_REF;
const Footer = () => { const Footer = () => {
const { t } = useTranslation(); const { t } = useTranslation();
return ( return (
<>
<ul className={styles.footer}> <ul className={styles.footer}>
<li> <li>
<a href='https://plebbit.com' target='_blank' rel='noopener noreferrer'> <a href='https://plebbit.com' target='_blank' rel='noopener noreferrer'>
@@ -198,6 +202,22 @@ const Footer = () => {
</a> </a>
</li> </li>
</ul> </ul>
<div className={styles.version}>
<a href={`https://github.com/plebbit/plebchan/releases/tag/v${packageJson.version}`} target='_blank' rel='noopener noreferrer'>
v{packageJson.version}
</a>
{isElectron && (
<a className={styles.fullNodeStats} href='http://localhost:5001/webui/' target='_blank' rel='noreferrer'>
node stats
</a>
)}
{commitRef && (
<a href={`https://github.com/plebbit/plebchan/commit/${commitRef}`} target='_blank' rel='noopener noreferrer'>
{commitRef.slice(0, 7)}
</a>
)}
</div>
</>
); );
}; };