Hide checkbox when editing/creating files

This commit is contained in:
Dane Everitt 2020-08-23 16:03:54 -07:00
parent 55cd7d4d39
commit 4cd44d2025
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { ServerContext } from '@/state/server';
import { NavLink } from 'react-router-dom';
import { NavLink, useRouteMatch } from 'react-router-dom';
import { cleanDirectoryPath } from '@/helpers';
import tw from 'twin.macro';
import { FileActionCheckbox } from '@/components/server/files/SelectFileCheckbox';
@ -13,6 +13,7 @@ interface Props {
export default ({ withinFileEditor, isNewFile }: Props) => {
const [ file, setFile ] = useState<string | null>(null);
const { params } = useRouteMatch<Record<string, string>>();
const id = ServerContext.useStoreState(state => state.server.data!.id);
const directory = ServerContext.useStoreState(state => state.files.directory);
@ -44,7 +45,7 @@ export default ({ withinFileEditor, isNewFile }: Props) => {
return (
<div css={tw`flex items-center text-sm mb-4 text-neutral-500`}>
{!!(files && files.length) &&
{(files && files.length && !params?.action) &&
<FileActionCheckbox
type={'checkbox'}
css={tw`mx-4`}