Skip to content

Commit

Permalink
Added clan badge colors
Browse files Browse the repository at this point in the history
Signed-off-by: Felix <github@fbrettnich.de>
  • Loading branch information
fbrettnich committed May 15, 2024
1 parent 86f638e commit 4bf7dc3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Helpers/Discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,8 @@ function getDiscoveryClan($guildId)
'bannerUrl' => '',
'playstyle' => 0,
'playstyleName' => '',
'badgeColorPrimary' => '',
'badgeColorSecondary' => '',
'searchTerms' => [],
'wildcardDescriptors' => [],
'gameIds' => [],
Expand Down Expand Up @@ -1034,6 +1036,12 @@ function getDiscoveryClan($guildId)
$array['playstyleName'] = 'n/a';
}

if(array_key_exists('badge_color_primary', $responseJson))
$array['badgeColorPrimary'] = $responseJson['badge_color_primary'];

if(array_key_exists('badge_color_secondary', $responseJson))
$array['badgeColorSecondary'] = $responseJson['badge_color_secondary'];

if(array_key_exists('search_terms', $responseJson))
$array['searchTerms'] = $responseJson['search_terms'];

Expand Down
14 changes: 14 additions & 0 deletions resources/views/components/user-clan-card.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@ class="inline-block h-16 rounded-md"
</p>
</div>
@endif

@if($clan['badgeColorPrimary'])
<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Primary Badge Color') }}<span class="hidden md:inline">:</span></span>
<x-color-preview :hexColor="$clan['badgeColorPrimary']" />
</div>
@endif

@if($clan['badgeColorSecondary'])
<div class="grid grid-cols-1 md:grid-cols-2">
<span class="font-semibold">{{ __('Secondary Badge Color') }}<span class="hidden md:inline">:</span></span>
<x-color-preview :hexColor="$clan['badgeColorSecondary']" />
</div>
@endif
</div>
<div class="space-y-5 md:space-y-0.5">
@if(array_key_exists('searchTerms', $clan) && !empty($clan['searchTerms']))
Expand Down

0 comments on commit 4bf7dc3

Please sign in to comment.