about dialog updated

This commit is contained in:
Daniel Shleifman
2021-06-29 11:10:14 +03:00
parent 41f55975fe
commit 5d7741c2af
6 changed files with 52 additions and 50 deletions

View File

@@ -0,0 +1,17 @@
import { GitHub as GitHubIcon } from '@material-ui/icons'
import { LinkWrapper, LinkIcon } from './style'
export default function LinkComponent({ name, link }) {
return (
<LinkWrapper isLink={!!link} href={link} target='_blank' rel='noreferrer'>
{link && (
<LinkIcon>
<GitHubIcon />
</LinkIcon>
)}
<div>{name}</div>
</LinkWrapper>
)
}

View File

@@ -1,17 +0,0 @@
import { GitHub as GitHubIcon } from '@material-ui/icons'
import { NameWrapper, NameIcon } from './style'
export default function NameComponent({ name, link }) {
return (
<NameWrapper isLink={!!link} href={link} target='_blank' rel='noreferrer'>
{link && (
<NameIcon>
<GitHubIcon />
</NameIcon>
)}
{name}
</NameWrapper>
)
}

View File

@@ -6,12 +6,11 @@ import ListItem from '@material-ui/core/ListItem'
import ListItemIcon from '@material-ui/core/ListItemIcon' import ListItemIcon from '@material-ui/core/ListItemIcon'
import ListItemText from '@material-ui/core/ListItemText' import ListItemText from '@material-ui/core/ListItemText'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { GitHub as GitHubIcon } from '@material-ui/icons'
import { useMediaQuery } from '@material-ui/core' import { useMediaQuery } from '@material-ui/core'
import NameComponent from './NameComponent' import LinkComponent from './LinkComponent'
import tsIcon from './ts-icon-192x192.png' import tsIcon from './ts-icon-192x192.png'
import { DialogWrapper, HeaderSection, ThanksSection, SpecialThanksSection, FooterSection } from './style' import { DialogWrapper, HeaderSection, ThanksSection, Section, FooterSection } from './style'
export default function AboutDialog() { export default function AboutDialog() {
const { t } = useTranslation() const { t } = useTranslation()
@@ -43,27 +42,30 @@ export default function AboutDialog() {
<div style={{ overflow: 'auto' }}> <div style={{ overflow: 'auto' }}>
<ThanksSection>{t('ThanksToEveryone')}</ThanksSection> <ThanksSection>{t('ThanksToEveryone')}</ThanksSection>
<SpecialThanksSection> <Section>
<span>{t('Links')}</span>
<div>
<LinkComponent name={t('ProjectSource')} link='https://github.com/YouROK/TorrServer' />
<LinkComponent name={t('Releases')} link='https://github.com/YouROK/TorrServer/releases' />
<LinkComponent name='API' link='https://github.com/YouROK/TorrServer/blob/master/README.md' />
</div>
</Section>
<Section>
<span>{t('SpecialThanks')}</span> <span>{t('SpecialThanks')}</span>
<div> <div>
<NameComponent name='Daniel Shleifman' link='https://github.com/dancheskus' /> <LinkComponent name='Daniel Shleifman' link='https://github.com/dancheskus' />
<NameComponent name='Matt Joiner' link='https://github.com/anacrolix' /> <LinkComponent name='Matt Joiner' link='https://github.com/anacrolix' />
<NameComponent name='nikk' link='https://github.com/tsynik' /> <LinkComponent name='nikk' link='https://github.com/tsynik' />
<NameComponent name='tw1cker Руслан Пахнев' link='https://github.com/Nemiroff' /> <LinkComponent name='tw1cker Руслан Пахнев' link='https://github.com/Nemiroff' />
<NameComponent name='SpAwN_LMG' link='https://github.com/spawnlmg' /> <LinkComponent name='SpAwN_LMG' link='https://github.com/spawnlmg' />
</div> </div>
</SpecialThanksSection> </Section>
</div> </div>
<FooterSection> <FooterSection>
<a href='https://github.com/YouROK/TorrServer' target='_blank' rel='noreferrer'>
<Button color='primary' variant='outlined'>
<GitHubIcon style={{ marginRight: '10px' }} />
{t('ProjectSource')}
</Button>
</a>
<Button onClick={() => setOpen(false)} color='primary' variant='contained' autoFocus> <Button onClick={() => setOpen(false)} color='primary' variant='contained' autoFocus>
{t('Close')} {t('Close')}
</Button> </Button>

View File

@@ -44,8 +44,8 @@ export const ThanksSection = styled.section`
} }
` `
export const SpecialThanksSection = styled.section` export const Section = styled.section`
padding: 40px 20px; padding: 20px;
color: #323637; color: #323637;
> span { > span {
@@ -54,6 +54,10 @@ export const SpecialThanksSection = styled.section`
margin-bottom: 15px; margin-bottom: 15px;
} }
a {
text-decoration: none;
}
> div { > div {
display: grid; display: grid;
gap: 10px; gap: 10px;
@@ -75,20 +79,12 @@ export const SpecialThanksSection = styled.section`
export const FooterSection = styled.div` export const FooterSection = styled.div`
padding: 20px; padding: 20px;
display: grid; display: flex;
grid-auto-flow: column; justify-content: flex-end;
grid-template-columns: repeat(2, max-content);
justify-content: end;
gap: 15px;
align-self: end;
background: #e8e5eb; background: #e8e5eb;
a {
text-decoration: none;
}
` `
export const NameWrapper = styled.a` export const LinkWrapper = styled.a`
${({ isLink }) => css` ${({ isLink }) => css`
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
@@ -122,7 +118,7 @@ export const NameWrapper = styled.a`
`} `}
` `
export const NameIcon = styled.div` export const LinkIcon = styled.div`
display: grid; display: grid;
margin-right: 10px; margin-right: 10px;
` `

View File

@@ -62,6 +62,7 @@
"Host": "Host", "Host": "Host",
"Info": "Info", "Info": "Info",
"LatestFilePlayed": "Latest file played:", "LatestFilePlayed": "Latest file played:",
"Links": "Links",
"Name": "Name", "Name": "Name",
"NoTorrentsAdded": "No torrents added", "NoTorrentsAdded": "No torrents added",
"Offline": "Offline", "Offline": "Offline",
@@ -74,8 +75,9 @@
"PiecesLength": "Pieces length", "PiecesLength": "Pieces length",
"Preload": "Preload", "Preload": "Preload",
"PreloadBuffer": "Preload Buffer", "PreloadBuffer": "Preload Buffer",
"ProjectSource": "Project source", "ProjectSource": "Project page",
"ReaderReadAHead": "Reader Read Ahead (5-100%)", "ReaderReadAHead": "Reader Read Ahead (5-100%)",
"Releases": "Releases",
"RemoveAll": "Remove All", "RemoveAll": "Remove All",
"RemoveCacheOnDrop": "Remove Cache from Disk on Drop Torrent", "RemoveCacheOnDrop": "Remove Cache from Disk on Drop Torrent",
"RemoveCacheOnDropDesc": "If disabled, remove cache on delete torrent.", "RemoveCacheOnDropDesc": "If disabled, remove cache on delete torrent.",

View File

@@ -62,6 +62,7 @@
"Host": "Хост", "Host": "Хост",
"Info": "Инфо", "Info": "Инфо",
"LatestFilePlayed": "Последний воспроизведенный файл:", "LatestFilePlayed": "Последний воспроизведенный файл:",
"Links": "Ссылки",
"Name": "Название", "Name": "Название",
"NoTorrentsAdded": "Нет торрентов", "NoTorrentsAdded": "Нет торрентов",
"Offline": "Сервер не доступен", "Offline": "Сервер не доступен",
@@ -74,8 +75,9 @@
"PiecesLength": "Размер блока", "PiecesLength": "Размер блока",
"Preload": "Предзагр.", "Preload": "Предзагр.",
"PreloadBuffer": "Наполнять кеш перед началом воспроизведения", "PreloadBuffer": "Наполнять кеш перед началом воспроизведения",
"ProjectSource": "Проект", "ProjectSource": "Сайт проекта",
"ReaderReadAHead": "Кеш предзагрузки (5-100%, рек. 95%)", "ReaderReadAHead": "Кеш предзагрузки (5-100%, рек. 95%)",
"Releases": "Релизы",
"RemoveAll": "Удалить все", "RemoveAll": "Удалить все",
"RemoveCacheOnDrop": "Очищать кеш на диске при отключении торрента", "RemoveCacheOnDrop": "Очищать кеш на диске при отключении торрента",
"RemoveCacheOnDropDesc": "Если отключено, кэш очищается при удалении торрента.", "RemoveCacheOnDropDesc": "Если отключено, кэш очищается при удалении торрента.",