fix(ui): only show copy button on https
This commit is contained in:
@@ -1,8 +1,9 @@
|
|||||||
@props(['text'])
|
@props(['text'])
|
||||||
|
|
||||||
<div class="relative" x-data="{ copied: false }">
|
<div class="relative" x-data="{ copied: false, isSecure: window.isSecureContext }">
|
||||||
<input type="text" value="{{ $text }}" readonly class="input">
|
<input type="text" value="{{ $text }}" readonly class="input">
|
||||||
<button
|
<button
|
||||||
|
x-show="isSecure"
|
||||||
@click.prevent="copied = true; navigator.clipboard.writeText({{ Js::from($text) }}); setTimeout(() => copied = false, 1000)"
|
@click.prevent="copied = true; navigator.clipboard.writeText({{ Js::from($text) }}); setTimeout(() => copied = false, 1000)"
|
||||||
class="absolute right-2 top-1/2 -translate-y-1/2 p-1.5 text-gray-400 hover:text-gray-300 transition-colors"
|
class="absolute right-2 top-1/2 -translate-y-1/2 p-1.5 text-gray-400 hover:text-gray-300 transition-colors"
|
||||||
title="Copy to clipboard">
|
title="Copy to clipboard">
|
||||||
|
Reference in New Issue
Block a user