Skip to content

Commit

Permalink
Merge pull request #19 from fuelviews/patch-logo-bug
Browse files Browse the repository at this point in the history
Refactored logo component and navigation configuration, added pre-scrolled routes, fix logo bug, and publish logo view.
  • Loading branch information
thejmitchener authored Sep 18, 2024
2 parents 2d6c631 + cfbf330 commit 83c4bc1
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- name: Bump version and push tag
id: bump_version
uses: anothrNick/github-tag-action@1.69.0
uses: anothrNick/github-tag-action@1.70.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
Expand Down
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,39 @@ return [
[
'name' => 'Welcome',
'route' => 'welcome',
]
],
],
],
],

// scrolled routes
'pre_scrolled_routes' => [
'careers',
'contact',
'forms.thank-you'
],

// phone config
'phone' => config('businessinfo.phone') ?: '(666) 666-6666',

// logo config
'default_logo' => 'images/logo.png',
'transparency_logo' => 'images/logo.png',

// phone config
'phone' => '(666) 420-6969',

// navigation config
'top_nav_enabled' => false,
'logo_swap_enabled' => true,
'transparent_nav_background' => true,
];
```

Optionally, you can publish the default logo using:
Optionally, you can publish the sample logo file using:

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

Optionally, you can publish the logo view using:

```bash
php artisan vendor:publish --tag="navigation-logo"
Expand Down
6 changes: 4 additions & 2 deletions config/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
],
],

// pre scrolled routes
// scrolled routes
'pre_scrolled_routes' => [
// 'welcome',
'careers',
'contact',
'forms.thank-you',
],

// phone config
Expand Down
6 changes: 3 additions & 3 deletions resources/views/components/logo.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
{{ config('app.name') }}
</span>
@if(Navigation::isLogoSwapEnabled() && Navigation::isTransparentNavBackground())
<img x-show="!scrolled" {{ glide()->src(Navigation::getTransparencyLogo(), lazy: false) }} loading="eager" class="{{ $attributes->get('logoClass', 'w-36 md:w-64 h-auto my-auto') }}" alt="{{ $attributes->get('alt', config('app.name')) }}" />
<img x-show="scrolled" {{ glide()->src(Navigation::getDefaultLogo(), lazy: false) }} loading="eager" class="{{ $attributes->get('logoClass', 'w-36 md:w-64 h-auto my-auto') }}" alt="{{ $attributes->get('alt', config('app.name')) }}" />
<img x-show="!scrolled" {{ glide()->src(Navigation::getTransparencyLogo(), 1000, lazy: false) }} loading="eager" class="{{ $attributes->get('logoClass', 'w-36 md:w-64 h-auto my-auto') }}" alt="{{ $attributes->get('alt', config('app.name')) }}" />
<img x-show="scrolled" {{ glide()->src(Navigation::getDefaultLogo(), 1000, lazy: false) }} loading="eager" class="{{ $attributes->get('logoClass', 'w-36 md:w-64 h-auto my-auto') }}" alt="{{ $attributes->get('alt', config('app.name')) }}" />
@else
<img {{ glide()->src(Navigation::getDefaultLogo(), lazy: false) }} loading="eager" class="{{ $attributes->get('logoClass', 'w-36 md:w-64 h-auto my-auto') }}" alt="{{ $attributes->get('alt', config('app.name')) }}" />
<img {{ glide()->src(Navigation::getDefaultLogo(), 1000, lazy: false) }} loading="eager" class="{{ $attributes->get('logoClass', 'w-36 md:w-64 h-auto my-auto') }}" alt="{{ $attributes->get('alt', config('app.name')) }}" />
@endif
</a>
</div>
7 changes: 6 additions & 1 deletion src/NavigationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ public function bootingPackage(): void
$sourcePath => resource_path('views/vendor/navigation/components/spacer.blade.php'),
], 'navigation-spacer');

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

$sourcePath2 = __DIR__.'/../public/images';
$this->publishes([
$sourcePath2 => public_path('images'),
], 'navigation-logo');
], 'navigation-logo-png');
}
}

0 comments on commit 83c4bc1

Please sign in to comment.