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