diff --git a/public/locales/en/files.json b/public/locales/en/files.json index 2ffba5ba2..fd4567d46 100644 --- a/public/locales/en/files.json +++ b/public/locales/en/files.json @@ -153,5 +153,14 @@ "pleaseWait": "Please wait while the initial 20 copies of the updated IPNS record are stored with the help of DHT peers…" }, "noPinsInProgress": "All done, no remote pins in progress.", - "remotePinningInProgress": "Remote pinning in progress:" + "remotePinningInProgress": "Remote pinning in progress:", + "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 1026933a1..013342bac 100644 --- a/src/files/FilesPage.js +++ b/src/files/FilesPage.js @@ -12,6 +12,7 @@ import withTour from '../components/tour/withTour.js' import InfoBoxes from './info-boxes/InfoBoxes.js' import FilePreview from './file-preview/FilePreview.js' import FilesList from './files-list/FilesList.js' +import FileNotFound from './file-not-found/FileNotFound.js' import { getJoyrideLocales } from '../helpers/i8n.js' // Icons @@ -228,7 +229,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.js b/src/files/file-not-found/FileNotFound.js new file mode 100644 index 000000000..59de89844 --- /dev/null +++ b/src/files/file-not-found/FileNotFound.js @@ -0,0 +1,32 @@ +import React from 'react' + +import Button from '../../components/button/button' + +import GlyphAttention from '../../icons/GlyphAttention.js' +import { withTranslation } from 'react-i18next' + +const FileNotFound = ({ path, t }) => { + return ( +
+
+ +
{t('previewNotFound.title')}
+
+
{path}
+
{t('previewNotFound.helpTitle')}
+ + + + +
+ ) +} + +export default withTranslation('files')(FileNotFound)