feat: add stat.ink link, extract constant
parent
90aeaefae7
commit
cffc2a98a5
|
|
@ -0,0 +1,4 @@
|
||||||
|
/**
|
||||||
|
* https://stat.ink
|
||||||
|
*/
|
||||||
|
export const STAT_INK = 'https://stat.ink'
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { ErrorContent } from 'components/ErrorContent';
|
import { ErrorContent } from 'components/ErrorContent';
|
||||||
import { Loading } from 'components/Loading';
|
import { Loading } from 'components/Loading';
|
||||||
|
import { STAT_INK } from 'constant';
|
||||||
import { usePromise } from 'hooks/usePromise';
|
import { usePromise } from 'hooks/usePromise';
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
@ -8,7 +9,7 @@ import { getConfig, getProfile } from 'services/config';
|
||||||
import { composeLoadable } from 'utils/composeLoadable';
|
import { composeLoadable } from 'utils/composeLoadable';
|
||||||
|
|
||||||
export const Home: React.FC = () => {
|
export const Home: React.FC = () => {
|
||||||
let { loading, error, retry, result } = composeLoadable({
|
let { loading, error, retry } = composeLoadable({
|
||||||
config: usePromise(getConfig),
|
config: usePromise(getConfig),
|
||||||
profile: usePromise(() => getProfile(0)),
|
profile: usePromise(() => getProfile(0)),
|
||||||
});
|
});
|
||||||
|
|
@ -28,8 +29,11 @@ export const Home: React.FC = () => {
|
||||||
|
|
||||||
return <>
|
return <>
|
||||||
<div className='card m-2 h-full'>
|
<div className='card m-2 h-full'>
|
||||||
{t('欢迎!')}
|
<h1 className='mb-4'>{t('欢迎!')}</h1>
|
||||||
<Link to='/settings' className='btn btn-primary'>{t('配置')}</Link>
|
<div className='flex flex-col gap-2'>
|
||||||
|
<Link to='/settings' className='btn btn-primary'>{t('配置')}</Link>
|
||||||
|
<a className='btn' href={STAT_INK} target='_blank' rel='noreferrer'>{t('前往 stat.ink')}</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import { Config, getConfig, getProfile, Profile, setConfig, setProfile } from 's
|
||||||
import { composeLoadable } from 'utils/composeLoadable';
|
import { composeLoadable } from 'utils/composeLoadable';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useLogin } from 'services/s3si';
|
import { useLogin } from 'services/s3si';
|
||||||
|
import { STAT_INK } from 'constant';
|
||||||
|
|
||||||
const Page: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
|
const Page: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
@ -89,7 +90,7 @@ const Form: React.FC<{
|
||||||
className='underline'
|
className='underline'
|
||||||
target='_blank'
|
target='_blank'
|
||||||
rel='noopener noreferrer'
|
rel='noopener noreferrer'
|
||||||
href='https://stat.ink/profile'
|
href={`${STAT_INK}/profile`}
|
||||||
title={t('打开 stat.ink') ?? undefined}
|
title={t('打开 stat.ink') ?? undefined}
|
||||||
>{t('stat.ink')}</a></span>
|
>{t('stat.ink')}</a></span>
|
||||||
</label>
|
</label>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue