Skip to content

Commit

Permalink
Merge pull request #13 from fuelviews/add-spacer
Browse files Browse the repository at this point in the history
Added a new spacer component to the navigation package, allowing for the insertion of a spacer element in the navigation.
  • Loading branch information
thejmitchener authored Jun 24, 2024
2 parents 60facaa + 02db1fd commit e30e9cf
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,17 @@ Optionally, you can publish the views using:
php artisan vendor:publish --tag="navigation-views"
```

Optionally, you can publish the spacer view using:

```bash
php artisan vendor:publish --tag="navigation-spacer"
```

## Usage

```php
<x-navigation::navigation />
<x-navigation::spacer />
```

## Tailwindcss classes
Expand Down
1 change: 1 addition & 0 deletions resources/views/components/spacer.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div class="h-[112px] lg:h-[144px]"></div>
11 changes: 9 additions & 2 deletions src/NavigationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Fuelviews\Navigation\View\Components\Desktop\DesktopNavigation;
use Fuelviews\Navigation\View\Components\Mobile\MobileNavigation;
use Fuelviews\Navigation\View\Components\NavigationScroll;
use Fuelviews\Navigation\View\Components\Spacer;
use Fuelviews\Navigation\View\Components\TopBar;
use Illuminate\Support\Facades\Blade;
use Spatie\LaravelPackageTools\Package;
Expand All @@ -29,10 +30,16 @@ public function bootingPackage(): void
Blade::component('navigation::mobile.mobile-navigation', MobileNavigation::class);
Blade::component('navigation::desktop.desktop-navigation', DesktopNavigation::class);
Blade::component('navigation::desktop.desktop-dropdown-button', DesktopDropdownButton::class);
Blade::component('navigation::components.spacer', Spacer::class);

$sourcePath = __DIR__.'/../public/images';
$sourcePath = __DIR__.'/../resources/views/components/spacer.blade.php';
$this->publishes([
$sourcePath => public_path('images'),
$sourcePath => resource_path('views/vendor/navigation/components/spacer.blade.php'),
], 'navigation-spacer');

$sourcePath2 = __DIR__.'/../public/images';
$this->publishes([
$sourcePath2 => public_path('images'),
], 'navigation-logo');
}
}
13 changes: 13 additions & 0 deletions src/View/Components/Spacer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Fuelviews\Navigation\View\Components;

use Illuminate\View\Component;

class Spacer extends Component
{
public function render()
{
return view('navigation::components.spacer');
}
}

0 comments on commit e30e9cf

Please sign in to comment.