mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-20 05:56:10 +05:00
add torrents sort icon
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
Brightness4 as Brightness4Icon,
|
||||
Brightness5 as Brightness5Icon,
|
||||
BrightnessAuto as BrightnessAutoIcon,
|
||||
Sort as SortIcon,
|
||||
SortByAlpha as SortByAlphaIcon,
|
||||
} from '@material-ui/icons'
|
||||
import { echoHost } from 'utils/Hosts'
|
||||
import Div100vh from 'react-div-100vh'
|
||||
@@ -47,6 +49,9 @@ export default function App() {
|
||||
onError: () => setIsOffline(true),
|
||||
onSuccess: () => setIsOffline(false),
|
||||
})
|
||||
const [sortABC, setSortABC] = useState(false)
|
||||
const handleClickSortABC = () => setSortABC(true)
|
||||
const handleClickSortDate = () => setSortABC(false)
|
||||
|
||||
useEffect(() => {
|
||||
axios.get(echoHost()).then(({ data }) => setTorrServerVersion(data))
|
||||
@@ -76,8 +81,12 @@ export default function App() {
|
||||
</Typography>
|
||||
|
||||
<div
|
||||
style={{ justifySelf: 'end', display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: '10px' }}
|
||||
style={{ justifySelf: 'end', display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: '10px' }}
|
||||
>
|
||||
<HeaderToggle onClick={() => (sortABC === true ? handleClickSortDate() : handleClickSortABC())}>
|
||||
{sortABC === true ? <SortByAlphaIcon /> : <SortIcon />}
|
||||
</HeaderToggle>
|
||||
|
||||
<HeaderToggle
|
||||
onClick={() => {
|
||||
if (currentThemeMode === THEME_MODES.LIGHT) updateThemeMode(THEME_MODES.DARK)
|
||||
@@ -115,7 +124,7 @@ export default function App() {
|
||||
setIsDonationDialogOpen={setIsDonationDialogOpen}
|
||||
/>
|
||||
|
||||
<TorrentList isOffline={isOffline} torrents={torrents} isLoading={isLoading} />
|
||||
<TorrentList isOffline={isOffline} torrents={torrents} isLoading={isLoading} sortABC={sortABC} />
|
||||
|
||||
<PWAFooter
|
||||
isOffline={isOffline}
|
||||
|
||||
Reference in New Issue
Block a user