Skip to content

Commit

Permalink
Merge pull request #7 from pinkary-project/fix/share-question
Browse files Browse the repository at this point in the history
Copy question URL to clipboard for browsers not supporting share
  • Loading branch information
nunomaduro authored Mar 20, 2024
2 parents e4d65c2 + 56fda81 commit 5b25119
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions resources/views/livewire/questions/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class="flex items-center transition-colors hover:text-slate-400 focus:outline-no
<span class="mx-1">•</span>
<button
x-data="shareProfile"
x-show="isVisible"
@click="share({
url: '{{
route('questions.show', [
Expand All @@ -128,6 +129,21 @@ class="text-slate-500 transition-colors hover:underline focus:outline-none"
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4 transition-colors hover:text-slate-400"><path stroke-linecap="round" stroke-linejoin="round" d="M6 12 3.269 3.125A59.769 59.769 0 0 1 21.485 12 59.768 59.768 0 0 1 3.27 20.875L5.999 12Zm0 0h7.5" /></svg>
</button>
<button
x-cloak
x-data="copyUrl"
x-show="isVisible"
@click="copyToClipboard('{{
route('questions.show', [
'user' => $question->to->username,
'question' => $question,
])
}}')"
type="button"
class="text-slate-500 transition-colors hover:underline focus:outline-none"
>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4 transition-colors hover:text-slate-400"><path stroke-linecap="round" stroke-linejoin="round" d="M6 12 3.269 3.125A59.769 59.769 0 0 1 21.485 12 59.768 59.768 0 0 1 3.27 20.875L5.999 12Zm0 0h7.5" /></svg>
</button>
</div>
</div>
</div>
Expand Down

0 comments on commit 5b25119

Please sign in to comment.