fix(dashboard-v2): get rid of downloads section

This commit is contained in:
Michał Leszczyk 2022-04-12 13:18:15 +02:00
parent d15d2146f5
commit 53b0687b21
No known key found for this signature in database
GPG Key ID: FA123CA8BAA2FBF4
4 changed files with 6 additions and 29 deletions

View File

@ -10,7 +10,7 @@ const parseFileName = (fileName) => {
const formatItem = ({ size, name: rawFileName, uploadedOn, downloadedOn, ...rest }) => { const formatItem = ({ size, name: rawFileName, uploadedOn, downloadedOn, ...rest }) => {
const [name, type] = parseFileName(rawFileName); const [name, type] = parseFileName(rawFileName);
const date = dayjs(uploadedOn || downloadedOn).format("MM/DD/YYYY; HH:MM"); const date = dayjs(uploadedOn || downloadedOn).format("MM/DD/YYYY HH:MM");
return { return {
...rest, ...rest,

View File

@ -1,23 +1,13 @@
import * as React from "react"; import * as React from "react";
import { Panel } from "../Panel"; import { Panel } from "../Panel";
import { Tab, TabPanel, Tabs } from "../Tabs";
import ActivityTable from "./ActivityTable"; import ActivityTable from "./ActivityTable";
export default function LatestActivity() { export default function LatestActivity() {
return ( return (
<Panel title="Latest activity"> <Panel title="Latest uploads">
<Tabs> <ActivityTable type="uploads" />
<Tab id="uploads" title="Uploads" />
<Tab id="downloads" title="Downloads" />
<TabPanel tabId="uploads" className="pt-4">
<ActivityTable type="uploads" />
</TabPanel>
<TabPanel tabId="downloads" className="pt-4">
<ActivityTable type="downloads" />
</TabPanel>
</Tabs>
</Panel> </Panel>
); );
} }

View File

@ -10,7 +10,7 @@ const parseFileName = (fileName) => {
const formatItem = ({ size, name: rawFileName, uploadedOn, downloadedOn, ...rest }) => { const formatItem = ({ size, name: rawFileName, uploadedOn, downloadedOn, ...rest }) => {
const [name, type] = parseFileName(rawFileName); const [name, type] = parseFileName(rawFileName);
const date = dayjs(uploadedOn || downloadedOn).format("MM/DD/YYYY; HH:MM"); const date = dayjs(uploadedOn || downloadedOn).format("MM/DD/YYYY HH:MM");
return { return {
...rest, ...rest,

View File

@ -1,32 +1,19 @@
import * as React from "react"; import * as React from "react";
import { useSearchParam } from "react-use";
import DashboardLayout from "../layouts/DashboardLayout"; import DashboardLayout from "../layouts/DashboardLayout";
import { Panel } from "../components/Panel"; import { Panel } from "../components/Panel";
import { Tab, TabPanel, Tabs } from "../components/Tabs";
import { Metadata } from "../components/Metadata"; import { Metadata } from "../components/Metadata";
import FileList from "../components/FileList/FileList"; import FileList from "../components/FileList/FileList";
const FilesPage = () => { const FilesPage = () => {
const defaultTab = useSearchParam("tab");
return ( return (
<> <>
<Metadata> <Metadata>
<title>My Files</title> <title>Files</title>
</Metadata> </Metadata>
<Panel title="Files"> <Panel title="Files">
<Tabs defaultTab={defaultTab || "uploads"}> <FileList type="uploads" />
<Tab id="uploads" title="Uploads" />
<Tab id="downloads" title="Downloads" />
<TabPanel tabId="uploads" className="pt-4">
<FileList type="uploads" />
</TabPanel>
<TabPanel tabId="downloads" className="pt-4">
<FileList type="downloads" />
</TabPanel>
</Tabs>
</Panel> </Panel>
</> </>
); );