2017-12-28 20:51:03 +01:00
|
|
|
import React from 'react';
|
2018-01-17 18:24:17 +01:00
|
|
|
import PropTypes from 'prop-types';
|
2018-01-18 00:00:03 +01:00
|
|
|
import ProgressBar from 'components/ProgressBar';
|
2018-01-24 20:24:49 +01:00
|
|
|
import * as publishStates from 'constants/publish_claim_states';
|
2018-01-12 00:37:32 +01:00
|
|
|
|
|
|
|
function PublishStatus ({ status, message }) {
|
|
|
|
return (
|
2018-02-27 01:34:02 +01:00
|
|
|
<div className='row row--tall flex-container--column flex-container--center-center'>
|
2018-01-17 00:55:29 +01:00
|
|
|
{(status === publishStates.LOAD_START) &&
|
2018-02-27 01:34:02 +01:00
|
|
|
<div className='row align-content-center'>
|
2018-01-12 00:37:32 +01:00
|
|
|
<p>File is loading to server</p>
|
2018-02-27 01:34:02 +01:00
|
|
|
<p className='blue'>{message}</p>
|
2018-01-12 00:37:32 +01:00
|
|
|
</div>
|
|
|
|
}
|
2018-01-17 00:55:29 +01:00
|
|
|
{(status === publishStates.LOADING) &&
|
2018-01-12 00:37:32 +01:00
|
|
|
<div>
|
2018-02-27 01:34:02 +01:00
|
|
|
<div className='row align-content-center'>
|
2018-01-12 00:37:32 +01:00
|
|
|
<p>File is loading to server</p>
|
2018-02-27 01:34:02 +01:00
|
|
|
<p className='blue'>{message}</p>
|
2017-12-28 20:51:03 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-01-12 00:37:32 +01:00
|
|
|
}
|
2018-01-17 00:55:29 +01:00
|
|
|
{(status === publishStates.PUBLISHING) &&
|
2018-02-27 01:34:02 +01:00
|
|
|
<div className='row align-content-center'>
|
2018-01-12 00:37:32 +01:00
|
|
|
<p>Upload complete. Your file is now being published on the blockchain...</p>
|
2018-02-27 01:34:02 +01:00
|
|
|
<ProgressBar size={12} />
|
|
|
|
<p>Curious what magic is happening here? <a className='link--primary' target='blank' href='https://lbry.io/faq/what-is-lbry'>Learn more.</a></p>
|
2018-01-12 00:37:32 +01:00
|
|
|
</div>
|
|
|
|
}
|
2018-01-17 00:55:29 +01:00
|
|
|
{(status === publishStates.SUCCESS) &&
|
2018-02-27 01:34:02 +01:00
|
|
|
<div className='row align-content-center'>
|
2018-01-12 19:21:40 +01:00
|
|
|
<p>Your publish is complete! You are being redirected to it now.</p>
|
2018-02-27 01:34:02 +01:00
|
|
|
<p>If you are not automatically redirected, <a className='link--primary' target='_blank' href={message}>click here.</a></p>
|
2018-01-12 00:37:32 +01:00
|
|
|
</div>
|
|
|
|
}
|
2018-01-17 00:55:29 +01:00
|
|
|
{(status === publishStates.FAILED) &&
|
2018-02-27 01:34:02 +01:00
|
|
|
<div className='row align-content-center'>
|
2018-01-12 00:37:32 +01:00
|
|
|
<p>Something went wrong...</p>
|
|
|
|
<p><strong>{message}</strong></p>
|
2018-02-27 01:34:02 +01:00
|
|
|
<p>For help, post the above error text in the #speech channel on the <a className='link--primary' href='https://discord.gg/YjYbwhS' target='_blank'>lbry discord</a></p>
|
2018-01-12 00:37:32 +01:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
);
|
2017-12-28 20:51:03 +01:00
|
|
|
};
|
|
|
|
|
2018-01-17 18:24:17 +01:00
|
|
|
PublishStatus.propTypes = {
|
|
|
|
status : PropTypes.string.isRequired,
|
2018-01-20 01:40:47 +01:00
|
|
|
message: PropTypes.string,
|
2018-01-17 18:24:17 +01:00
|
|
|
};
|
|
|
|
|
2018-01-12 00:37:32 +01:00
|
|
|
export default PublishStatus;
|