Skip to content

Commit

Permalink
Update microblog heading title to current tag
Browse files Browse the repository at this point in the history
  • Loading branch information
danon committed Sep 6, 2024
1 parent 769b8ec commit d773618
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions app/Http/Controllers/Microblog/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ public function __construct(

public function index(): View
{
return $this->list(null);
return $this->list(null, 'Mikroblogi');
}

public function tag(string $tag): View
{
$this->breadcrumb->push('Wpisy z tagiem: ' . $tag, route('microblog.tag', [$tag]));
$this->breadcrumb->push("Wpisy z tagiem: $tag", route('microblog.tag', [$tag]));
$this->builder->withTag($tag);
return $this->list(new RenderParams($tag));
return $this->list(new RenderParams($tag), "Wpisy z tagiem: $tag");
}

private function list(?RenderParams $renderParams): View
private function list(?RenderParams $renderParams, string $headingTitle): View
{
return $this->view('microblog.home', [
'flags' => $this->flags(),
Expand All @@ -51,6 +51,7 @@ private function list(?RenderParams $renderParams): View
'render_params' => $renderParams,
'emojis' => Emoji::all(),
'microblogNewUrl' => $this->microblogNewUrl(),
'headingTitle' => $headingTitle,
]);
}

Expand Down
2 changes: 1 addition & 1 deletion resources/views/microblog/home.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{% block container %}
<div class="row mb-2">
<div class="col-md-12">
<h1>Mikroblogi</h1>
<h1>{{ headingTitle }}</h1>
</div>
</div>
<div id="js-microblog" class="row">
Expand Down

0 comments on commit d773618

Please sign in to comment.