code and layout refactoring

This commit is contained in:
2024-03-26 10:10:27 +01:00
parent 82ccb68a56
commit c6e48f4baa
11 changed files with 143 additions and 147 deletions

View File

@@ -4,10 +4,10 @@ import { loadingDownloadsState } from '../atoms/downloads'
import { listViewState } from '../atoms/settings'
import { loadingAtom } from '../atoms/ui'
import DownloadsCardView from './DownloadsCardView'
import DownloadsListView from './DownloadsTableView'
import DownloadsTableView from './DownloadsTableView'
const Downloads: React.FC = () => {
const listView = useRecoilValue(listViewState)
const tableView = useRecoilValue(listViewState)
const loadingDownloads = useRecoilValue(loadingDownloadsState)
const [isLoading, setIsLoading] = useRecoilState(loadingAtom)
@@ -20,15 +20,9 @@ const Downloads: React.FC = () => {
setIsLoading(false)
}, [loadingDownloads, isLoading])
if (listView) {
return (
<DownloadsListView />
)
}
if (tableView) return <DownloadsTableView />
return (
<DownloadsCardView />
)
return <DownloadsCardView />
}
export default Downloads