Skip to content

Commit

Permalink
Merge pull request #4 from octoper/master
Browse files Browse the repository at this point in the history
Some nice cahnges
  • Loading branch information
freekmurze authored May 22, 2020
2 parents 9d2ee0a + 6835a58 commit adc8386
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 2 additions & 3 deletions resources/views/tile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ class="grid gap-2 justify-items-center h-full text-center"

<div wire:poll.600s class="uppercase">
<div class="flex w-full justify-center space-x-4 items-center">
<span> {{ $outsideTemperature }}° <span class="text-sm uppercase text-dimmed">out</span> </span>

<span> {{ $outsideTemperature }}°{{ $unit == 'metric' ? 'C': 'F'}} <span class="text-sm uppercase text-dimmed">out</span></span>
<span class="text-2xl">{{ $emoji }}</span>
</div>
<div class="hidden">{{ $city }}</div>
<div class="text-xs">{{ $city }}, {{ $countryCode }}</div>
</div>

<div
Expand Down
9 changes: 8 additions & 1 deletion src/TimeWeatherStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ public function getEmoji(): string
}

if ($weatherId === '801') {
return '';
$isNight = Str::endsWith(Arr::get($weatherReport, 'weather.0.icon'), 'n');

return $isNight? '' :'';
}

if ($group === '8') {
Expand All @@ -112,4 +114,9 @@ public function getCity(): ?string
{
return $this->tile->getData('weatherReport.name');
}

public function getCountryCode(): ?string
{
return $this->tile->getData('weatherReport.sys.country');
}
}
2 changes: 2 additions & 0 deletions src/TimeWeatherTileComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ public function render()

return view('dashboard-time-weather-tile::tile', [
'city' => $weatherStore->getCity(),
'countryCode' => $weatherStore->getCountryCode(),
'forecasts' => $weatherStore->forecasts(),
'outsideTemperature' => $weatherStore->outsideTemperature(),
'emoji' => $weatherStore->getEmoji(),
'unit' => config('dashboard.tiles.time_weather.units') ?? 'metric',
]);
}
}

0 comments on commit adc8386

Please sign in to comment.