diff --git a/web/src/components/About.jsx b/web/src/components/About.jsx deleted file mode 100644 index 29f1def..0000000 --- a/web/src/components/About.jsx +++ /dev/null @@ -1,88 +0,0 @@ -import axios from 'axios' -import { useEffect, useState } from 'react' -import Button from '@material-ui/core/Button' -import Dialog from '@material-ui/core/Dialog' -import DialogActions from '@material-ui/core/DialogActions' -import DialogContent from '@material-ui/core/DialogContent' -import DialogTitle from '@material-ui/core/DialogTitle' -import InfoIcon from '@material-ui/icons/Info' -import ListItem from '@material-ui/core/ListItem' -import ListItemIcon from '@material-ui/core/ListItemIcon' -import ListItemText from '@material-ui/core/ListItemText' -import { useTranslation } from 'react-i18next' -import { echoHost } from 'utils/Hosts' -import { ThemeProvider, useTheme } from '@material-ui/core/styles' - -import { lightTheme } from '../style/materialUISetup' - -export default function AboutDialog() { - const { t } = useTranslation() - const [open, setOpen] = useState(false) - const [torrServerVersion, setTorrServerVersion] = useState('') - useEffect(() => { - axios.get(echoHost()).then(({ data }) => setTorrServerVersion(data)) - }, []) - - const primary = useTheme().palette.primary.main - - return ( -
- setOpen(true)}> - - - - - - - - setOpen(false)} aria-labelledby='form-dialog-title' fullWidth maxWidth='sm'> - {t('About')} - - -
-

TorrServer {torrServerVersion}

- - https://github.com/YouROK/TorrServer - -
- -
-

{t('ThanksToEveryone')}

-
-
-

{t('SpecialThanks')}

- anacrolix Matt Joiner  - - github.com/anacrolix - -
- nikk  - - github.com/tsynik - -
- dancheskus  - - github.com/dancheskus - -
- tw1cker Руслан Пахнев  - - github.com/Nemiroff - -
- SpAwN_LMG -
-
-
- - - - -
-
-
- ) -} diff --git a/web/src/components/About/NameComponent.jsx b/web/src/components/About/NameComponent.jsx new file mode 100644 index 0000000..d36021b --- /dev/null +++ b/web/src/components/About/NameComponent.jsx @@ -0,0 +1,17 @@ +import { GitHub as GitHubIcon } from '@material-ui/icons' + +import { NameWrapper, NameIcon } from './style' + +export default function NameComponent({ name, link }) { + return ( + + {link && ( + + + + )} + + {name} + + ) +} diff --git a/web/src/components/About/index.jsx b/web/src/components/About/index.jsx new file mode 100644 index 0000000..8487adb --- /dev/null +++ b/web/src/components/About/index.jsx @@ -0,0 +1,75 @@ +import { useState } from 'react' +import Button from '@material-ui/core/Button' +import Dialog from '@material-ui/core/Dialog' +import InfoIcon from '@material-ui/icons/Info' +import ListItem from '@material-ui/core/ListItem' +import ListItemIcon from '@material-ui/core/ListItemIcon' +import ListItemText from '@material-ui/core/ListItemText' +import { useTranslation } from 'react-i18next' +import { GitHub as GitHubIcon } from '@material-ui/icons' +import { useMediaQuery } from '@material-ui/core' + +import NameComponent from './NameComponent' +import tsIcon from './ts-icon-192x192.png' +import { DialogWrapper, HeaderSection, ThanksSection, SpecialThanksSection, FooterSection } from './style' + +export default function AboutDialog() { + const { t } = useTranslation() + const [open, setOpen] = useState(false) + const fullScreen = useMediaQuery('@media (max-width:930px)') + + return ( + <> + setOpen(true)}> + + + + + + + setOpen(false)} + aria-labelledby='form-dialog-title' + fullScreen={fullScreen} + maxWidth='xl' + > + + +
{t('About')}
+ ts-icon +
+ +
+ {t('ThanksToEveryone')} + + + {t('SpecialThanks')} + +
+ + + + + +
+
+
+ + + + + + + + +
+
+ + ) +} diff --git a/web/src/components/About/style.js b/web/src/components/About/style.js new file mode 100644 index 0000000..2c2df96 --- /dev/null +++ b/web/src/components/About/style.js @@ -0,0 +1,132 @@ +import styled, { css } from 'styled-components' + +export const DialogWrapper = styled.div` + background: #f1eff3; + height: 100%; + display: grid; + grid-template-rows: max-content 1fr max-content; +` + +export const HeaderSection = styled.section` + display: flex; + justify-content: space-between; + align-items: center; + font-size: 40px; + font-weight: 300; + padding: 20px; + color: #323637; + + img { + width: 80px; + } + + @media (max-width: 930px) { + font-size: 30px; + padding: 10px 20px; + + img { + width: 60px; + } + } +` + +export const ThanksSection = styled.section` + background: #545a5e; + color: #f1eff3; + padding: 40px 20px; + text-align: center; + font-size: 30px; + font-weight: 300; + + @media (max-width: 930px) { + font-size: 20px; + padding: 30px 20px; + } +` + +export const SpecialThanksSection = styled.section` + padding: 40px 20px; + color: #323637; + + > span { + font-size: 20px; + display: block; + margin-bottom: 15px; + } + + > div { + display: grid; + gap: 10px; + grid-template-columns: repeat(4, max-content); + + @media (max-width: 930px) { + grid-template-columns: repeat(3, 1fr); + } + + @media (max-width: 780px) { + grid-template-columns: repeat(2, 1fr); + } + + @media (max-width: 550px) { + grid-template-columns: 1fr; + } + } +` + +export const FooterSection = styled.div` + padding: 20px; + display: grid; + grid-auto-flow: column; + grid-template-columns: repeat(2, max-content); + justify-content: end; + gap: 15px; + align-self: end; + background: #e8e5eb; + + a { + text-decoration: none; + } +` + +export const NameWrapper = styled.a` + ${({ isLink }) => css` + display: inline-flex; + align-items: center; + justify-content: center; + border: 1px solid; + padding: 10px; + border-radius: 5px; + text-transform: uppercase; + text-decoration: none; + background: #545a5e; + color: #f1eff3; + transition: 0.2s; + + @media (max-width: 550px) { + justify-content: start; + } + + > * { + transition: 0.2s; + } + + ${isLink + ? css` + :hover { + filter: brightness(1.1); + + > * { + transform: translateY(-1px); + } + } + ` + : css` + cursor: default; + `} + `} +` + +export const NameIcon = styled.div` + display: grid; + margin-right: 10px; +` diff --git a/web/src/components/About/ts-icon-192x192.png b/web/src/components/About/ts-icon-192x192.png new file mode 100644 index 0000000..d34d722 Binary files /dev/null and b/web/src/components/About/ts-icon-192x192.png differ diff --git a/web/src/components/CloseServer.jsx b/web/src/components/CloseServer.jsx index d4dab5d..a347eeb 100644 --- a/web/src/components/CloseServer.jsx +++ b/web/src/components/CloseServer.jsx @@ -3,9 +3,6 @@ import { Button, Dialog, DialogActions, DialogTitle, ListItem, ListItemIcon, Lis import { PowerSettingsNew as PowerSettingsNewIcon } from '@material-ui/icons' import { shutdownHost } from 'utils/Hosts' import { useTranslation } from 'react-i18next' -import { ThemeProvider } from '@material-ui/core/styles' - -import { lightTheme } from '../style/materialUISetup' export default function CloseServer({ isOffline, isLoading }) { const { t } = useTranslation() @@ -23,28 +20,26 @@ export default function CloseServer({ isOffline, isLoading }) { - - - {t('CloseServer?')} - - + + {t('CloseServer?')} + + - - - - + + + ) } diff --git a/web/src/components/RemoveAll.jsx b/web/src/components/RemoveAll.jsx index 257b73a..8fccfc1 100644 --- a/web/src/components/RemoveAll.jsx +++ b/web/src/components/RemoveAll.jsx @@ -6,9 +6,6 @@ import DeleteIcon from '@material-ui/icons/Delete' import { useState } from 'react' import { torrentsHost } from 'utils/Hosts' import { useTranslation } from 'react-i18next' -import { ThemeProvider } from '@material-ui/core/styles' - -import { lightTheme } from '../style/materialUISetup' const fnRemoveAll = () => { fetch(torrentsHost(), { @@ -50,28 +47,26 @@ export default function RemoveAll({ isOffline, isLoading }) { - - - {t('DeleteTorrents?')} - - + + {t('DeleteTorrents?')} + + - - - - + + + ) } diff --git a/web/src/locales/en/translation.json b/web/src/locales/en/translation.json index ae60e3c..3569292 100644 --- a/web/src/locales/en/translation.json +++ b/web/src/locales/en/translation.json @@ -74,6 +74,7 @@ "PiecesLength": "Pieces length", "Preload": "Preload", "PreloadBuffer": "Preload Buffer", + "ProjectSource": "Project source", "ReaderReadAHead": "Reader Read Ahead (5-100%)", "RemoveAll": "Remove All", "RemoveCacheOnDrop": "Remove Cache from Disk on Drop Torrent", diff --git a/web/src/locales/ru/translation.json b/web/src/locales/ru/translation.json index f32a812..eb7e522 100644 --- a/web/src/locales/ru/translation.json +++ b/web/src/locales/ru/translation.json @@ -74,6 +74,7 @@ "PiecesLength": "Размер блока", "Preload": "Предзагр.", "PreloadBuffer": "Наполнять кеш перед началом воспроизведения", + "ProjectSource": "Проект", "ReaderReadAHead": "Кеш предзагрузки (5-100%, рек. 95%)", "RemoveAll": "Удалить все", "RemoveCacheOnDrop": "Очищать кеш на диске при отключении торрента",