stubbed copy dialog

This commit is contained in:
Danny Coates 2018-10-25 18:55:11 -07:00
parent d881755814
commit 7ad63ae004
No known key found for this signature in database
GPG key ID: 4C442633C62E00CB
6 changed files with 1946 additions and 8 deletions

29
app/ui/copyDialog.js Normal file
View file

@ -0,0 +1,29 @@
const html = require('choo/html');
const assets = require('../../common/assets');
const { copyToClipboard } = require('../utils');
module.exports = function(url) {
return function(state, emit, close) {
return html`
<div class="flex flex-col p-4">
<input
type="image"
class="self-end text-white"
alt="Close"
src="${assets.get('close-16.svg')}"
onclick=${close}/>
<h1 class="font-normal mt-2">${state.translate('notifyUploadDone')}</h1>
<input type="text" class="w-full my-4 border rounded leading-loose" value=${url} readonly="true"/>
<button class="border rounded bg-blue text-white leading-loose w-full" onclick=${copy}>
${state.translate('copyUrlFormButton')}
</button>
</div>`;
function copy(event) {
event.stopPropagation();
copyToClipboard(url);
event.target.textContent = state.translate('copiedUrl');
setTimeout(close, 1000);
}
};
};