- Corriger la troncature de la toolbar (max-height 4rem → 5rem) - Animer la toolbar en translateY pour un effet "bloc uni" avec le header - Corriger le bug d'auto-hide du header après switch simple → scroll - Augmenter la taille du titre de chapitre dans la toolbar (text-sm font-medium) - Harmoniser le bouton scroll-to-top avec le style des ToolbarButtons - Ajouter support de prop `class` sur les labels de ToolbarSection
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Domain\Reader\Application\QueryHandler;
|
|
|
|
use App\Domain\Reader\Application\Query\GetChapterContext;
|
|
use App\Domain\Reader\Application\Response\ChapterContextResponse;
|
|
use App\Domain\Reader\Domain\Contract\Repository\ChapterRepositoryInterface;
|
|
use App\Domain\Reader\Domain\ValueObject\ChapterId;
|
|
|
|
final readonly class GetChapterContextHandler
|
|
{
|
|
public function __construct(
|
|
private ChapterRepositoryInterface $chapterRepository
|
|
) {
|
|
}
|
|
|
|
public function handle(GetChapterContext $query): ChapterContextResponse
|
|
{
|
|
$chapterId = new ChapterId($query->getChapterId());
|
|
|
|
$context = $this->chapterRepository->getChapterContext($chapterId);
|
|
|
|
return new ChapterContextResponse(
|
|
id: $query->getChapterId(),
|
|
mangaId: $context->getMangaId(),
|
|
title: $context->getChapterTitle(),
|
|
number: $context->getNumber(),
|
|
totalPages: $context->getTotalPages(),
|
|
previousChapterId: $context->getPreviousChapterId()?->getValue(),
|
|
nextChapterId: $context->getNextChapterId()?->getValue(),
|
|
);
|
|
}
|
|
}
|