Skip to content

Commit ad97e74

Browse files
committed
Update share-button.blade.php
1 parent e686ba4 commit ad97e74

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

resources/views/linkstack/modules/share-button.blade.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
33
@php
44
$ShowShrBtn = config('advanced-config.display_share_button');
55
6-
if ($ShowShrBtn === '') {
7-
$ShowShrBtn = 'true';
8-
} elseif ($ShowShrBtn === 'false') {
6+
if ($ShowShrBtn === 'false') {
97
$ShowShrBtn = 'false';
108
} elseif ($ShowShrBtn === 'user') {
119
$ShowShrBtn = Auth::user()->littlelink_name ? 'true' : 'false';
10+
} elseif (UserData::getData($userinfo->id, 'disable-sharebtn') == "true") {
11+
$ShowShrBtn = 'false';
1212
} else {
1313
$ShowShrBtn = 'true';
1414
}
1515
16-
$DisplayShowShrBtn = $ShowShrBtn === 'true' && UserData::getData($userinfo->id, 'disable-sharebtn') !== "true";
1716
@endphp
1817

19-
<div align="right" @if($DisplayShowShrBtn == 'false') style="visibility:hidden" @endif class="sharediv">
18+
<div align="right" @if($ShowShrBtn == 'false') style="visibility:hidden" @endif class="sharediv">
2019
<div>
2120
<span class="sharebutton button-hover icon-hover share-button" data-share="{{url()->current()}}" tabindex="0" role="button" aria-label="{{__('messages.Share this page')}}">
2221
<i style="color: black;" class="fa-solid fa-share sharebutton-img share-icon hvr-icon"></i>
@@ -26,6 +25,6 @@
2625
</div>
2726
<span class="copy-icon" tabindex="0" role="button" aria-label="{{__('messages.Copy URL to clipboard')}}"></span>
2827

29-
@if($DisplayShowShrBtn == true)
28+
@if($ShowShrBtn == 'true')
3029
<script>const shareButtons=document.querySelectorAll(".share-button");shareButtons.forEach((e=>{e.addEventListener("click",(()=>{const r=e.dataset.share;navigator.share?navigator.share({title:"{{__('messages.Share this page')}}",url:r}).catch((e=>console.error("Error:",e))):navigator.clipboard.writeText(r).then((()=>{alert("{{__('messages.URL has been copied to your clipboard!')}}")})).catch((e=>{alert("Error",e)}))}))}));</script>
3130
@endif

0 commit comments

Comments
 (0)