chore(file-uploader-drop-container): move class names to markup

This commit is contained in:
Eric Liu 2019-12-25 07:20:23 -08:00
commit 6a28583a85

View file

@ -21,9 +21,6 @@
let over = false; let over = false;
let inputRef = undefined; let inputRef = undefined;
$: _class = cx('--file__drop-container', over && '--file__drop-container--drag-over', className);
$: _labelClass = cx('--file-browse-btn', disabled && '--file-browse-btn--disabled');
</script> </script>
<div <div
@ -51,7 +48,7 @@
}} }}
{style}> {style}>
<label <label
class={_labelClass} class={cx('--file-browse-btn', disabled && '--file-browse-btn--disabled')}
for={id} for={id}
on:keydown on:keydown
on:keydown={({ key }) => { on:keydown={({ key }) => {
@ -60,7 +57,9 @@
} }
}} }}
{tabindex}> {tabindex}>
<div class={_class} {role}> <div
class={cx('--file__drop-container', over && '--file__drop-container--drag-over', className)}
{role}>
{labelText} {labelText}
<input <input
bind:this={inputRef} bind:this={inputRef}