-
-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
570 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Components; | ||
|
||
use App\Enum\Livewire\GalleryMode; | ||
use App\Enum\Livewire\PageMode; | ||
use App\Http\Livewire\Traits\AlbumProperty; | ||
use App\Http\Livewire\Traits\InteractWithModal; | ||
use App\Models\Extensions\BaseAlbum; | ||
use App\SmartAlbums\BaseSmartAlbum; | ||
use Illuminate\View\View; | ||
use Livewire\Component; | ||
|
||
/** | ||
* This is the "start" page of the gallery | ||
* Integrate the list of all albums at top level. | ||
*/ | ||
class Header extends Component | ||
{ | ||
use InteractWithModal; | ||
use AlbumProperty; | ||
|
||
public ?PageMode $page_mode = null; | ||
public ?GalleryMode $gallery_mode = null; | ||
public string $title = ''; | ||
public bool $is_hidden = false; | ||
|
||
public ?BaseAlbum $baseAlbum = null; | ||
public ?BaseSmartAlbum $smartAlbum = null; | ||
|
||
|
||
/** | ||
* Render the header. | ||
* | ||
* @return View | ||
*/ | ||
public function render(): View | ||
{ | ||
return view('livewire.components.header'); | ||
} | ||
|
||
|
||
/** | ||
* Open a login modal box. | ||
* | ||
* @return void | ||
*/ | ||
public function openLoginModal(): void | ||
{ | ||
$this->openModal('forms.login'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Traits; | ||
|
||
use App\Enum\Livewire\PageMode; | ||
use Illuminate\Contracts\Container\BindingResolutionException; | ||
use Symfony\Component\Routing\Exception\RouteNotFoundException; | ||
|
||
/** | ||
* This trait provides a simple helper to update the URL of the browser. | ||
*/ | ||
trait UrlChange | ||
{ | ||
/** | ||
* Send an event to trigger updating the URL in the browser. | ||
* | ||
* @param PageMode $page | ||
* @param string $albumId | ||
* @param string $photoId | ||
* | ||
* @return void | ||
* @throws BindingResolutionException | ||
* @throws RouteNotFoundException | ||
*/ | ||
protected function emitUrlChange(PageMode $page, string $albumId, string $photoId): void | ||
{ | ||
// This ensures that the history has been updated | ||
$this->emit('urlChange', route('livewire_index', ['page' => $page, 'albumId' => $albumId, 'photoId' => $photoId])); | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.