2018-10-26 03:55:11 +02:00
|
|
|
const html = require('choo/html');
|
|
|
|
const { copyToClipboard } = require('../utils');
|
|
|
|
|
2018-10-29 17:52:24 +01:00
|
|
|
module.exports = function(name, url) {
|
2018-10-26 03:55:11 +02:00
|
|
|
return function(state, emit, close) {
|
|
|
|
return html`
|
2018-11-02 10:27:59 +01:00
|
|
|
<div class="flex flex-col items-center text-center p-4 max-w-sm">
|
|
|
|
<h1 class="font-bold my-4">${state.translate('notifyUploadDone')}</h1>
|
2018-11-06 00:46:49 +01:00
|
|
|
<p class="font-normal leading-normal text-grey-darker word-break-all">${state.translate(
|
2018-10-29 17:52:24 +01:00
|
|
|
'copyUrlFormLabelWithName',
|
|
|
|
{ filename: name }
|
|
|
|
)}</p>
|
2018-11-02 10:27:59 +01:00
|
|
|
<input type="text" id="share-url" class="w-full my-4 border rounded leading-loose h-12 px-2 py-1" value=${url} readonly="true"/>
|
|
|
|
<button class="rounded bg-blue hover\:bg-blue-dark focus\:bg-blue-darker cursor-pointer text-center text-white py-2 px-6 h-12 w-full flex flex-no-shrink items-center justify-center font-semibold" onclick=${copy}>
|
2018-10-26 03:55:11 +02:00
|
|
|
${state.translate('copyUrlFormButton')}
|
|
|
|
</button>
|
2018-11-02 10:27:59 +01:00
|
|
|
<a class="text-blue my-4 font-medium cursor-pointer" onclick=${close}>${state.translate(
|
2018-10-29 17:52:24 +01:00
|
|
|
'okButton'
|
|
|
|
)}</a>
|
2018-10-26 03:55:11 +02:00
|
|
|
</div>`;
|
|
|
|
|
|
|
|
function copy(event) {
|
|
|
|
event.stopPropagation();
|
|
|
|
copyToClipboard(url);
|
|
|
|
event.target.textContent = state.translate('copiedUrl');
|
|
|
|
setTimeout(close, 1000);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|