diff --git a/src/frontend/admin/src/AppNav.js b/src/frontend/admin/src/AppNav.js index baeeff8e4..b7356e33b 100644 --- a/src/frontend/admin/src/AppNav.js +++ b/src/frontend/admin/src/AppNav.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React from "react"; import { useNavigate } from "react-router-dom"; import AppBar from "@mui/material/AppBar"; import Box from "@mui/material/Box"; diff --git a/src/frontend/admin/src/components/MediaFiles.js b/src/frontend/admin/src/components/MediaFiles.js index 642de95ef..ecf2fd85f 100644 --- a/src/frontend/admin/src/components/MediaFiles.js +++ b/src/frontend/admin/src/components/MediaFiles.js @@ -1,27 +1,14 @@ import React, { useState, useEffect } from "react"; import { styled } from "@mui/material/styles"; import { FileUploader } from "react-drag-drop-files"; -import { Button, Container, Link, Paper, Stack } from "@mui/material"; -import { errorHandlerWithSnackbar, useErrorHandlerWithSnackbar } from "../errors"; +import { Container, Link, Paper } from "@mui/material"; +import { useErrorHandlerWithSnackbar } from "../errors"; import { createApiGet } from "../utils"; -import CloudUploadIcon from "@mui/icons-material/CloudUpload"; import AttachFileIcon from "@mui/icons-material/AttachFile"; import Box from "@mui/material/Box"; import { BASE_URL_BACKEND, MEDIAS_LOCATION } from "../config"; -import { useSnackbar } from "notistack"; import "../App.css"; - -const VisuallyHiddenInput = styled("input")({ - clip: "rect(0 0 0 0)", - clipPath: "inset(50%)", - height: 1, - overflow: "hidden", - position: "absolute", - bottom: 0, - left: 0, - whiteSpace: "nowrap", - width: 1, -}); +import PropTypes from "prop-types"; const FileLink = styled(Link)(({ theme, highlight }) => ({ ...theme.typography.body2, @@ -42,12 +29,16 @@ const FileItem = ({ fileName, highlight }) => { ); }; +FileItem.propTypes = { + fileName: PropTypes.string.isRequired, + highlight: PropTypes.bool, +}; const fileUrl = (fileName) => { return MEDIAS_LOCATION + "/" + fileName; }; -function AdvancedJson() { +function MediaFiles() { const errorHandler = useErrorHandlerWithSnackbar(); const apiGet = createApiGet(BASE_URL_BACKEND + "/media"); @@ -106,4 +97,4 @@ function AdvancedJson() { ); } -export default AdvancedJson; +export default MediaFiles;