2022-02-18 08:17:28 +00:00
|
|
|
import * as React from "react";
|
2022-02-23 10:55:52 +00:00
|
|
|
import { useMedia } from "react-use";
|
2022-02-15 09:04:19 +00:00
|
|
|
|
2022-02-23 10:55:52 +00:00
|
|
|
import theme from "../lib/theme";
|
2022-03-04 11:03:52 +00:00
|
|
|
import { PlansProvider } from "../contexts/plans/PlansProvider";
|
2022-02-23 10:55:52 +00:00
|
|
|
import { ArrowRightIcon } from "../components/Icons";
|
|
|
|
import { Panel } from "../components/Panel";
|
|
|
|
import { Tab, TabPanel, Tabs } from "../components/Tabs";
|
|
|
|
import LatestActivity from "../components/LatestActivity/LatestActivity";
|
2022-02-21 08:30:39 +00:00
|
|
|
import DashboardLayout from "../layouts/DashboardLayout";
|
2022-02-23 10:55:52 +00:00
|
|
|
import Slider from "../components/Slider/Slider";
|
|
|
|
import CurrentUsage from "../components/CurrentUsage";
|
2022-03-01 15:50:32 +00:00
|
|
|
import Uploader from "../components/Uploader/Uploader";
|
2022-03-02 11:51:16 +00:00
|
|
|
import CurrentPlan from "../components/CurrentPlan";
|
2022-02-21 08:30:39 +00:00
|
|
|
|
2022-02-15 09:04:19 +00:00
|
|
|
const IndexPage = () => {
|
2022-02-23 10:55:52 +00:00
|
|
|
const showRecentActivity = useMedia(`(min-width: ${theme.screens.md})`);
|
|
|
|
|
|
|
|
return (
|
2022-03-04 11:03:52 +00:00
|
|
|
<PlansProvider>
|
2022-02-23 10:55:52 +00:00
|
|
|
<div className="w-full">
|
|
|
|
<Slider
|
|
|
|
slides={[
|
2022-03-01 15:50:32 +00:00
|
|
|
<Panel title="Upload" className="h-[330px]">
|
2022-02-23 10:55:52 +00:00
|
|
|
<Tabs variant="fill">
|
|
|
|
<Tab id="files" title="Files" />
|
|
|
|
<Tab id="directory" title="Directory" />
|
2022-03-01 15:50:32 +00:00
|
|
|
<TabPanel tabId="files" className="h-full overflow-y-auto">
|
|
|
|
<Uploader mode="file" />
|
2022-02-23 10:55:52 +00:00
|
|
|
</TabPanel>
|
2022-03-01 15:50:32 +00:00
|
|
|
<TabPanel tabId="directory" className="h-full overflow-y-auto">
|
|
|
|
<Uploader mode="directory" />
|
2022-02-23 10:55:52 +00:00
|
|
|
</TabPanel>
|
|
|
|
</Tabs>
|
|
|
|
</Panel>,
|
|
|
|
<Panel
|
|
|
|
title={
|
|
|
|
<>
|
|
|
|
<ArrowRightIcon /> Usage
|
|
|
|
</>
|
|
|
|
}
|
2022-03-01 15:50:32 +00:00
|
|
|
className="h-[330px]"
|
2022-02-23 10:55:52 +00:00
|
|
|
>
|
|
|
|
<CurrentUsage />
|
|
|
|
</Panel>,
|
|
|
|
<Panel
|
|
|
|
title={
|
|
|
|
<>
|
|
|
|
<ArrowRightIcon /> Current plan
|
|
|
|
</>
|
|
|
|
}
|
2022-03-01 15:50:32 +00:00
|
|
|
className="h-[330px]"
|
2022-02-23 10:55:52 +00:00
|
|
|
>
|
2022-03-02 11:51:16 +00:00
|
|
|
<CurrentPlan />
|
2022-02-23 10:55:52 +00:00
|
|
|
</Panel>,
|
|
|
|
]}
|
2022-02-23 11:14:06 +00:00
|
|
|
/>
|
2022-02-23 10:55:52 +00:00
|
|
|
</div>
|
|
|
|
{showRecentActivity && (
|
|
|
|
<div className="mt-10">
|
|
|
|
<LatestActivity />
|
|
|
|
</div>
|
|
|
|
)}
|
2022-03-04 11:03:52 +00:00
|
|
|
</PlansProvider>
|
2022-02-23 10:55:52 +00:00
|
|
|
);
|
2022-02-18 08:17:28 +00:00
|
|
|
};
|
2022-02-15 09:04:19 +00:00
|
|
|
|
2022-02-21 08:30:39 +00:00
|
|
|
IndexPage.Layout = DashboardLayout;
|
|
|
|
|
2022-02-18 08:17:28 +00:00
|
|
|
export default IndexPage;
|