* Public File Sharing This implements public file sharing (read-only) with and without passwords (#57). It also fixes a problem with filenames including special characters like `#` not working properly (#71). You can share a directory or a single file, by using the new share icon on the right of the directories/files, and click on it to manage an existing file share (setting a new password, or deleting the file share). There is some other minor cleanup and other copy updates in the README. Closes #57 Fixes #71 * Hide UI elements when sharing isn't allowed
28 lines
925 B
TypeScript
28 lines
925 B
TypeScript
import { Directory, DirectoryFile } from '/lib/types.ts';
|
|
import MainFiles from '/components/files/MainFiles.tsx';
|
|
|
|
interface FilesWrapperProps {
|
|
initialDirectories: Directory[];
|
|
initialFiles: DirectoryFile[];
|
|
initialPath: string;
|
|
baseUrl: string;
|
|
isFileSharingAllowed: boolean;
|
|
fileShareId?: string;
|
|
}
|
|
|
|
// This wrapper is necessary because islands need to be the first frontend component, but they don't support functions as props, so the more complex logic needs to live in the component itself
|
|
export default function FilesWrapper(
|
|
{ initialDirectories, initialFiles, initialPath, baseUrl, isFileSharingAllowed, fileShareId }: FilesWrapperProps,
|
|
) {
|
|
return (
|
|
<MainFiles
|
|
initialDirectories={initialDirectories}
|
|
initialFiles={initialFiles}
|
|
initialPath={initialPath}
|
|
baseUrl={baseUrl}
|
|
isFileSharingAllowed={isFileSharingAllowed}
|
|
fileShareId={fileShareId}
|
|
/>
|
|
);
|
|
}
|