mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-05 14:19:56 -05:00
Feature/127 archive UI rework (#131)
* Archives have their own page. Delete/etc buttons are moved into ArchivePage. * Alternatives for an Archive are displayed in the ArchivePage. * ArchiveDownloader returns the location. * Removing color from Details button. * Making Archive screenshot and title a link. * Preserving next_download when updating a Channel. * Removing button icons from Archive page.
This commit is contained in:
parent
2314c3462f
commit
0765890b8b
12 changed files with 238 additions and 99 deletions
|
|
@ -3,6 +3,7 @@ import {
|
|||
fetchDomains,
|
||||
filesSearch,
|
||||
getAPIStatus,
|
||||
getArchive,
|
||||
getDownloaders,
|
||||
getFiles,
|
||||
getHotspotStatus,
|
||||
|
|
@ -152,6 +153,28 @@ export const useArchives = ({defaultLimit = 20}) => {
|
|||
};
|
||||
}
|
||||
|
||||
export const useArchive = (archiveId) => {
|
||||
const [archive, setArchive] = useState(null);
|
||||
const [alternatives, setAlternatives] = useState(null);
|
||||
|
||||
const fetchArchive = async () => {
|
||||
try {
|
||||
const [a, alt] = await getArchive(archiveId);
|
||||
setArchive(a);
|
||||
setAlternatives(alt);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
setArchive(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
fetchArchive();
|
||||
}, [archiveId]);
|
||||
|
||||
return [archive, alternatives];
|
||||
}
|
||||
|
||||
export const useVersion = () => {
|
||||
const [version, setVersion] = useState('');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue