Skip to content

Commit

Permalink
Remove icons from homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed Nov 5, 2024
1 parent 42d2a34 commit dee551d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
3 changes: 0 additions & 3 deletions app/Domain/Icon/FontAwesomeFree.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public function icons(): array
'loginGithub' => 'fab fa-github',

// homepage
'microblogsPopular' => 'far fa-comments',
'reputationRanking' => 'fas fa-star',
'forumNews' => 'fas fa-star',
'viewersOnlineLocal' => 'fas fa-eye',
'viewersOnlineGlobal' => 'fas fa-users',
'homepageActivityMicroblog' => 'far fa-person',
Expand Down
3 changes: 0 additions & 3 deletions app/Domain/Icon/FontAwesomePro.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ public function icons(): array
'loginGithub' => 'fa-brand fa-github',

// homepage
'microblogsPopular' => 'fa-light fa-fire-flame-curved',
'reputationRanking' => 'fa-light fa-trophy',
'forumNews' => 'fa-light fa-inbox-in',
'viewersOnlineLocal' => 'fa-light fa-eye',
'viewersOnlineGlobal' => 'fa-light fa-users',
'homepageActivityMicroblog' => 'fa-light fa-person',
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private function globalViewers(): View
{
/** @var Renderer $renderer */
$renderer = app(Renderer::class);
return $renderer->render('/', local:false);
return $renderer->render('/', local:false, iconVisible:false);
}

private function flags(): array
Expand Down
5 changes: 3 additions & 2 deletions app/Services/Session/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@ public function __construct(
$this->spacer = new Spacer(8);
}

public function render(string $requestUri, bool $local): View
public function render(string $requestUri, bool $local, bool $iconVisible = true): View
{
$viewers = $this->sessionViewers($requestUri);

[$users, $superfluous] = $this->spacer->fitInSpace($viewers->usersWithoutGroup());

return view('components.viewers', [
'local' => $local,
'iconVisible' => $iconVisible,
'guestsCount' => $viewers->guestsCount,
'usersCount' => \count($viewers->users),
'title' => $local
? 'Aktualnie na tej stronie'
: "{$viewers->totalCount()} użytkowników online",
: 'Użytkowników online',
'usersWithGroup' => $viewers->usersWithGroup(),
'usersWithoutGroup' => $users,
'superfluousCount' => $superfluous,
Expand Down
10 changes: 6 additions & 4 deletions resources/views/components/viewers.twig
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<div class="box">
<h4 class="heading">
{% if local %}
{{ icon('viewersOnlineLocal') }}
{% else %}
{{ icon('viewersOnlineGlobal') }}
{% if iconVisible %}
{% if local %}
{{ icon('viewersOnlineLocal') }}
{% else %}
{{ icon('viewersOnlineGlobal') }}
{% endif %}
{% endif %}
{{ title }}
</h4>
Expand Down
3 changes: 0 additions & 3 deletions resources/views/home.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<main class="col-md-8">
<section id="box-forum" class="box mt-4">
<h2 class="h4">
{{ icon('forumNews') }}
Co nowego na forum?
</h2>
<div class="card card-forum">
Expand Down Expand Up @@ -148,7 +147,6 @@

<section id="js-microblog" class="box">
<h4>
{{ icon('microblogsPopular') }}
Popularne wpisy na mikroblogu
</h4>
<vue-microblog
Expand Down Expand Up @@ -176,7 +174,6 @@

<section class="box mt-4">
<h4 class="heading">
{{ icon('reputationRanking') }}
Reputacja użytkowników
</h4>

Expand Down

0 comments on commit dee551d

Please sign in to comment.