diff --git a/packages/sia-skynet/src/components/HomeUpload/HomeUpload.js b/packages/sia-skynet/src/components/HomeUpload/HomeUpload.js index 82d91b1c..54db6493 100644 --- a/packages/sia-skynet/src/components/HomeUpload/HomeUpload.js +++ b/packages/sia-skynet/src/components/HomeUpload/HomeUpload.js @@ -58,6 +58,16 @@ export default class HomeUpload extends Component { }); }; + handleSkylink = (event) => { + event.preventDefault(); + + const skylink = event.target.skylink.value.replace('sia://', ''); + + if(skylink.length === 46) { + window.open(`/${event.target.skylink.value}`, '_blank'); + } + } + render() { return ( @@ -104,8 +114,8 @@ export default class HomeUpload extends Component {

Have a Skylink?

Enter the ID to retrieve the file

-
- + + diff --git a/packages/sia-skynet/src/components/Mailing/Mailing.js b/packages/sia-skynet/src/components/Mailing/Mailing.js index 3b5257ca..9fc1dda8 100644 --- a/packages/sia-skynet/src/components/Mailing/Mailing.js +++ b/packages/sia-skynet/src/components/Mailing/Mailing.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react' +import React from 'react' import MailchimpSubscribe from 'react-mailchimp-subscribe' import classNames from 'classnames'