mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
improve home footer
This commit is contained in:
@@ -5,12 +5,6 @@ const { version } = packageJson;
|
|||||||
const commitRef = process.env.REACT_APP_COMMIT_REF;
|
const commitRef = process.env.REACT_APP_COMMIT_REF;
|
||||||
const isElectron = window.isElectron === true;
|
const isElectron = window.isElectron === true;
|
||||||
|
|
||||||
const getBetaVersion = (version: string) => {
|
|
||||||
const parts = version.split('.');
|
|
||||||
parts[parts.length - 1] = (parseInt(parts[parts.length - 1]) + 1).toString();
|
|
||||||
return parts.join('.') + '-beta';
|
|
||||||
};
|
|
||||||
|
|
||||||
const Version = () => {
|
const Version = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@@ -21,7 +15,7 @@ const Version = () => {
|
|||||||
target='_blank'
|
target='_blank'
|
||||||
rel='noopener noreferrer'
|
rel='noopener noreferrer'
|
||||||
>
|
>
|
||||||
v{commitRef ? getBetaVersion(version) : version}
|
v{commitRef ? '-dev' : version}
|
||||||
</a>
|
</a>
|
||||||
{isElectron && (
|
{isElectron && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
+5
-26
@@ -3,7 +3,6 @@ import { Link, useNavigate } from 'react-router-dom';
|
|||||||
import { Trans, useTranslation } from 'react-i18next';
|
import { Trans, useTranslation } from 'react-i18next';
|
||||||
import { useSubplebbits } from '@plebbit/plebbit-react-hooks';
|
import { useSubplebbits } from '@plebbit/plebbit-react-hooks';
|
||||||
import styles from './home.module.css';
|
import styles from './home.module.css';
|
||||||
import packageJson from '../../../package.json';
|
|
||||||
import { useDefaultSubplebbits, useDefaultSubplebbitAddresses } from '../../hooks/use-default-subplebbits';
|
import { useDefaultSubplebbits, useDefaultSubplebbitAddresses } from '../../hooks/use-default-subplebbits';
|
||||||
import useSubplebbitsStats from '../../hooks/use-subplebbits-stats';
|
import useSubplebbitsStats from '../../hooks/use-subplebbits-stats';
|
||||||
import PopularThreadsBox from './popular-threads-box';
|
import PopularThreadsBox from './popular-threads-box';
|
||||||
@@ -106,24 +105,6 @@ const Stats = ({ subplebbitAddresses }: { subplebbitAddresses: string[] }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { version } = packageJson;
|
|
||||||
const downloadAppLink = (() => {
|
|
||||||
const platform = navigator.platform;
|
|
||||||
if (platform === 'Linux' || platform === 'Linux x86_64' || platform === 'Linux i686' || platform === 'Linux aarch64') {
|
|
||||||
return `https://github.com/plebbit/plebchan/releases/download/v${version}/plebchan-${version}.AppImage`;
|
|
||||||
} else if (platform === 'Win32' || platform === 'Win64' || platform === 'Windows') {
|
|
||||||
return `https://github.com/plebbit/plebchan/releases/download/v${version}/plebchan.Portable.${version}.exe`;
|
|
||||||
} else if (platform === 'MacIntel' || platform === 'Macintosh') {
|
|
||||||
return `https://github.com/plebbit/plebchan/releases/download/v${version}/plebchan-${version}.dmg`;
|
|
||||||
} else if (platform === 'Android') {
|
|
||||||
return undefined;
|
|
||||||
} else if (platform === 'iPhone' || platform === 'iPad') {
|
|
||||||
return undefined;
|
|
||||||
} else {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
export const Footer = () => {
|
export const Footer = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
@@ -134,13 +115,11 @@ export const Footer = () => {
|
|||||||
{t('about')}
|
{t('about')}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{downloadAppLink && (
|
<li>
|
||||||
<li>
|
<a href='https://blog.plebbit.eth.limo' target='_blank' rel='noopener noreferrer'>
|
||||||
<a href={downloadAppLink} target='_blank' rel='noopener noreferrer'>
|
Blog
|
||||||
{t('download_app')}
|
</a>
|
||||||
</a>
|
</li>
|
||||||
</li>
|
|
||||||
)}
|
|
||||||
<li>
|
<li>
|
||||||
<Link to='/faq'>FAQ</Link>
|
<Link to='/faq'>FAQ</Link>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
Reference in New Issue
Block a user