diff --git a/public/locales/en/files.json b/public/locales/en/files.json index 4a2dee8bd..a50098709 100644 --- a/public/locales/en/files.json +++ b/public/locales/en/files.json @@ -185,5 +185,14 @@ }, "noPinsInProgress": "All done, no remote pins in progress.", "remotePinningInProgress": "Remote pinning in progress:", - "selectAllEntries": "Select all entries" + "selectAllEntries": "Select all entries", + "previewNotFound": { + "title": "IPFS can't find this item", + "helpTitle": "These are common troubleshooting steps might help:", + "helpListItemPathTypo": "Are there typos in the path you entered?", + "helpListItemFileMoved": "Was the file moved, renamed, or deleted?", + "helpListItemBookmarkMigrated": "Did you copy a URL or bookmark from another computer? If so, you'll need to", + "helpListItemBookmarkMigratedLink": "point this instance at that computer's node", + "backButton": "Go to Home" + } } diff --git a/src/files/FilesPage.js b/src/files/FilesPage.js index 5aa344f1b..9a673f66b 100644 --- a/src/files/FilesPage.js +++ b/src/files/FilesPage.js @@ -14,6 +14,7 @@ import FilePreview from './file-preview/FilePreview.js' import FilesList from './files-list/FilesList.js' import FilesGrid from './files-grid/files-grid.js' import { ViewList, ViewModule } from '../icons/stroke-icons.js' +import FileNotFound from './file-not-found/FileNotFound.tsx' import { getJoyrideLocales } from '../helpers/i8n.js' // Icons @@ -356,7 +357,7 @@ const FilesPage = ({ - onDownload([files])} /> + onDownload([files])} /> { +const Preview = ({ files, path, t, onDownload }) => { if (files && files.type === 'file') { return () } - return (
) + + return ( + + ) } export default connect( diff --git a/src/files/file-not-found/FileNotFound.tsx b/src/files/file-not-found/FileNotFound.tsx new file mode 100644 index 000000000..0e273bfce --- /dev/null +++ b/src/files/file-not-found/FileNotFound.tsx @@ -0,0 +1,38 @@ +import React from 'react' + +import Button from '../../components/button/button.js' + +import GlyphAttention from '../../icons/GlyphAttention.js' +import { useTranslation } from 'react-i18next' + +export interface FileNotFoundProps { + path: string +} + +const FileNotFound = ({ path }: FileNotFoundProps) => { + const { t } = useTranslation('files') + + return ( +
+
+ +
{t('previewNotFound.title')}
+
+
{path}
+
{t('previewNotFound.helpTitle')}
+ + + + +
+ ) +} + +export default FileNotFound