WIP
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
<span
|
||||
class=""
|
||||
style="width:90em;overflow: hidden; white-space: nowrap;"
|
||||
title="{{ Number::currency($low) }} - {{ Number::currency($high) }}"
|
||||
title="{{ Number::currency($low ?? 0) }} - {{ Number::currency($high ?? 0) }}"
|
||||
>
|
||||
|
||||
@php
|
||||
// 52-week low must be a non-zero
|
||||
if (empty($low)) {
|
||||
$low = 1;
|
||||
}
|
||||
@endphp
|
||||
|
||||
@for ($x = 0; $x < 10; $x++)
|
||||
@if ((($current - $low) * 100) / ($high - $low) > ($x * 10))
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
@php
|
||||
if (isset($percent)) {
|
||||
|
||||
$isUp = $percent > 0;
|
||||
|
||||
} else {
|
||||
|
||||
$isUp = $costBasis <= $marketValue;
|
||||
$percent = ($marketValue - $costBasis) / $costBasis;
|
||||
}
|
||||
|
||||
@endphp
|
||||
|
||||
@if(!empty($percent))
|
||||
|
||||
<x-badge class="badge-sm {{ $isUp ? 'badge-success' : 'badge-error' }} badge-outline ml-2">
|
||||
<x-slot:value>
|
||||
{!! $isUp ? '▲' :'▼' !!}
|
||||
{{ Number::percentage(
|
||||
$percent,
|
||||
$percent < 1 ? 2 : 0
|
||||
) }}
|
||||
</x-slot:value>
|
||||
</x-badge>
|
||||
|
||||
@endif
|
||||
@@ -12,7 +12,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="flex flex-grow gap-4 w-50">
|
||||
<div class="flex flex-grow gap-4 w-50" x-data>
|
||||
|
||||
<x-spotlight
|
||||
shortcut="slash"
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
<x-button
|
||||
icon="o-magnifying-glass"
|
||||
@click="$dispatch('mary-search-open')"
|
||||
@click.stop="$dispatch('mary-search-open')"
|
||||
class="btn-sm"
|
||||
>
|
||||
<x-slot:label>
|
||||
@lang('Press :key to search', ['key' => '<kbd class="kbd kbd-sm">/</kbd>'])
|
||||
@lang('Click or press :key to search', ['key' => '<kbd class="kbd kbd-sm">/</kbd>'])
|
||||
|
||||
</x-slot:label>
|
||||
</x-button>
|
||||
|
||||
Reference in New Issue
Block a user