hide sign up cta when authenticated

This commit is contained in:
Karol Wypchlo 2021-06-10 16:17:14 +02:00
parent 36d281af70
commit 317e601aed
1 changed files with 5 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import { useDropzone } from "react-dropzone";
import { SkynetClient } from "skynet-js";
import { useTimeoutFn } from "react-use";
import ms from "ms";
import useAuthenticatedStatus from "../../services/useAuthenticatedStatus";
import Link from "../Link";
const getFilePath = (file) => file.webkitRelativePath || file.path || file.name;
@ -147,6 +148,9 @@ const Uploader = () => {
const [mode, setMode] = React.useState("file");
const [files, setFiles] = React.useState([]);
const { data: authenticationStatus } = useAuthenticatedStatus();
const authenticated = authenticationStatus?.authenticated ?? false;
const handleDrop = async (acceptedFiles) => {
if (mode === "directory" && acceptedFiles.length) {
const rootDir = getRootDirectory(acceptedFiles[0]); // get the file path from the first file
@ -307,7 +311,7 @@ const Uploader = () => {
)}
</div>
{files.length === 0 && (
{files.length === 0 && !authenticated && (
<div className="z-0 relative flex flex-col items-center space-y-1 mt-10">
<Unlock />
<p className="text-sm font-light text-palette-600">