Skip to content

Commit

Permalink
Tweak links
Browse files Browse the repository at this point in the history
  • Loading branch information
barryvdh committed Dec 14, 2023
1 parent 6f205a4 commit b1ed410
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions resources/views/collectors/events.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


?>
@component('telescope-toolbar::item', ['name' => 'events', 'link' => true])
@component('telescope-toolbar::item', ['name' => 'events', 'link' => '#events'])

@slot('icon')
@ttIcon('events')
Expand All @@ -15,4 +15,4 @@
@endslot


@endcomponent
@endcomponent
2 changes: 1 addition & 1 deletion resources/views/collectors/queries.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
$statusColor = null;
}
?>
@component('telescope-toolbar::item', ['name' => 'queries', 'link' => true, 'status' => $statusColor, 'additional_classes' => 'sf-toolbar-block-fullwidth'])
@component('telescope-toolbar::item', ['name' => 'queries', 'link' => '#queries', 'status' => $statusColor, 'additional_classes' => 'sf-toolbar-block-fullwidth'])

@slot('icon')
@ttIcon('queries')
Expand Down
4 changes: 2 additions & 2 deletions resources/views/collectors/views.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
$views = collect($views)->reverse();

?>
@component('telescope-toolbar::item', ['name' => 'views', 'link' => true])
@component('telescope-toolbar::item', ['name' => 'views', 'link' => '#views'])

@slot('icon')
@ttIcon('views')
Expand Down Expand Up @@ -71,4 +71,4 @@
@endslot


@endcomponent
@endcomponent
14 changes: 12 additions & 2 deletions resources/views/item.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<div class="sf-toolbar-block sf-toolbar-block-{{ $name }} sf-toolbar-status-{{ $status ?? 'normal' }} {{ $additional_classes ?? ''}}" {!! $block_attrs ?? '' !!}>
@if(isset($link) && $link) <a href="{{ is_string($link) ? $link : route('telescope-toolbar.show', ['token' => $token, 'tab' => $name]) }}" target="_telescope">@endif
@if(isset($link) && $link)
@php
$ttLink = route('telescope-toolbar.show', ['token' => $token, 'tab' => $name]);
if ($link === true) {
$link = $ttLink;
} elseif (\Illuminate\Support\Str::startsWith($link, '#')) {
$link = $ttLink . $link;
}
@endphp
<a href="{{ $link }}">
@endif
<div class="sf-toolbar-icon">{{ $icon ?? '' }}</div>
@if(isset($link) && $link)</a>@endif
<div class="sf-toolbar-info">{{ $text ?? '' }}</div>
</div>
</div>

0 comments on commit b1ed410

Please sign in to comment.