+ $commonData = [
+ 'activity' => $activity,
+ 'recents' => $recents,
+ 'recentlyUpdatedPages' => $recentlyUpdatedPages,
+ 'draftPages' => $draftPages,
+ ];
+
+ if ($homepageOption === 'bookshelves') {
+ $shelves = $this->entityRepo->getAllPaginated('bookshelf', 18);
+ $shelvesViewType = setting()->getUser($this->currentUser, 'bookshelves_view_type', config('app.views.bookshelves', 'grid'));
+ $data = array_merge($commonData, ['shelves' => $shelves, 'shelvesViewType' => $shelvesViewType]);
+ return view('common.home-shelves', $data);
+ }