mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
style: development branch deploys should display the next version number + "beta"
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
.version a {
|
||||
color: var(--post-link-text-color);
|
||||
text-decoration: var(--post-content-link-text-decoration);
|
||||
text-transform: lowercase;
|
||||
}
|
||||
|
||||
.version a:hover {
|
||||
|
||||
@@ -10,6 +10,7 @@ import useCatalogFiltersStore from '../../../stores/use-catalog-filters-store';
|
||||
import useExpandedMediaStore from '../../../stores/use-expanded-media-store';
|
||||
import useSpecialThemeStore from '../../../stores/use-special-theme-store';
|
||||
import { isChristmas } from '../../../lib/utils/time-utils';
|
||||
import Version from '../../version';
|
||||
|
||||
const commitRef = process.env.REACT_APP_COMMIT_REF;
|
||||
const isElectron = window.isElectron === true;
|
||||
@@ -137,15 +138,7 @@ const InterfaceSettings = () => {
|
||||
return (
|
||||
<div className={styles.interfaceSettings}>
|
||||
<div className={styles.version}>
|
||||
{_.capitalize(t('version'))}:{' '}
|
||||
<a href={`https://github.com/plebbit/plebchan/releases/tag/v${packageJson.version}`} target='_blank' rel='noopener noreferrer'>
|
||||
{packageJson.version}
|
||||
</a>
|
||||
{commitRef && (
|
||||
<a href={`https://github.com/plebbit/plebchan/commit/${commitRef}`} target='_blank' rel='noopener noreferrer'>
|
||||
#{commitRef.slice(0, 7)}
|
||||
</a>
|
||||
)}
|
||||
{_.capitalize(t('version'))}: <Version />
|
||||
</div>
|
||||
<div className={styles.setting}>
|
||||
{_.capitalize(t('update'))}: <CheckForUpdates />
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from './version';
|
||||
@@ -0,0 +1,39 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import packageJson from '../../../package.json';
|
||||
|
||||
const { version } = packageJson;
|
||||
const commitRef = process.env.REACT_APP_COMMIT_REF;
|
||||
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 { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<>
|
||||
<a
|
||||
href={commitRef ? `https://github.com/plebbit/seedit/commit/${commitRef}` : `https://github.com/plebbit/seedit/releases/tag/v${version}`}
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
>
|
||||
v{commitRef ? getBetaVersion(version) : version}
|
||||
</a>
|
||||
{isElectron && (
|
||||
<>
|
||||
{' '}
|
||||
-{' '}
|
||||
<a href='http://localhost:50019/webui/' target='_blank' rel='noreferrer'>
|
||||
{t('node_stats')}
|
||||
</a>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Version;
|
||||
@@ -254,6 +254,7 @@
|
||||
padding-top: 2em;
|
||||
padding-bottom: 1em;
|
||||
font-size: 11px;
|
||||
text-transform: lowercase;
|
||||
}
|
||||
|
||||
.version a {
|
||||
|
||||
+2
-16
@@ -8,6 +8,7 @@ import useDefaultSubplebbits, { useDefaultSubplebbitAddresses } from '../../hook
|
||||
import useSubplebbitsStats from '../../hooks/use-subplebbits-stats';
|
||||
import PopularThreadsBox from './popular-threads-box';
|
||||
import BoardsList from './boards-list';
|
||||
import Version from '../../components/version';
|
||||
|
||||
// https://github.com/plebbit/temporary-default-subplebbits/blob/master/README.md
|
||||
// plebchan shouldn't consider 'vulgar' or 'anti' as nsfw tags, unlike more sfw-oriented clients
|
||||
@@ -122,9 +123,6 @@ const downloadAppLink = (() => {
|
||||
}
|
||||
})();
|
||||
|
||||
const isElectron = window.isElectron === true;
|
||||
const commitRef = process.env.REACT_APP_COMMIT_REF;
|
||||
|
||||
export const Footer = () => {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
@@ -172,19 +170,7 @@ export const Footer = () => {
|
||||
</li>
|
||||
</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:50019/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>
|
||||
)}
|
||||
<Version />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user