Skip to content

Commit 1742e30

Browse files
[6.x] Add support link to header (#13889)
Co-authored-by: Jason Varga <jason@pixelfear.com>
1 parent 924aae3 commit 1742e30

5 files changed

Lines changed: 44 additions & 17 deletions

File tree

config/cp.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@
8686
| Support Link
8787
|--------------------------------------------------------------------------
8888
|
89-
| Set the location of the support link in the "Useful Links" header
90-
| dropdown. Use 'false' to remove it entirely.
89+
| Set the location of the support link in the header.
9190
|
9291
*/
9392

resources/js/components/global-header/Header.vue

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
<script setup>
2-
import { inject } from 'vue';
3-
import { Icon } from '@ui';
42
import Logo from './Logo.vue';
53
import Breadcrumbs from './Breadcrumbs.vue';
64
import SiteSelector from './SiteSelector.vue';
75
import Search from './Search.vue';
6+
import SupportButton from "@/components/global-header/SupportButton.vue";
7+
import MaxWidthButton from "@/components/global-header/MaxWidthButton.vue";
88
import ViewSiteButton from './ViewSiteButton.vue';
99
import UserDropdown from './UserDropdown.vue';
10-
11-
const layout = inject('layout', {});
12-
const isMaxWidthEnabled = layout.isMaxWidthEnabled;
13-
const toggleMaxWidth = layout.toggleMaxWidth;
1410
</script>
1511

1612
<template>
@@ -33,15 +29,8 @@ const toggleMaxWidth = layout.toggleMaxWidth;
3329
<div class="flex items-center">
3430
<Search />
3531
</div>
36-
<button
37-
@click="toggleMaxWidth"
38-
:aria-label="isMaxWidthEnabled ? __('Expand Layout') : __('Constrain Layout')"
39-
v-tooltip="isMaxWidthEnabled ? __('Expand Layout') : __('Constrain Layout')"
40-
class="hidden [@media(min-width:1800px)]:inline-flex items-center justify-center whitespace-nowrap shrink-0 font-medium antialiased cursor-pointer no-underline disabled:text-white/60 dark:disabled:text-white/50 disabled:cursor-not-allowed [&_svg]:shrink-0 [&_svg]:text-gray-925 [&_svg]:opacity-60 dark:[&_svg]:text-white bg-transparent hover:bg-gray-400/10 text-gray-900 dark:text-gray-300 dark:hover:bg-white/15 dark:hover:text-gray-200 h-8 text-[0.8125rem] leading-tight rounded-lg px-0 gap-0 w-8 [&_svg]:size-4 -me-2 [&_svg]:text-white/85! will-change-transform"
41-
data-expand-layout-control
42-
>
43-
<Icon :name="isMaxWidthEnabled ? 'zoom-fit-screen' : 'fit-screen'" class="animate-pulse-on-appearance" />
44-
</button>
32+
<SupportButton />
33+
<MaxWidthButton />
4534
<ViewSiteButton />
4635
<UserDropdown />
4736
</div>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script setup>
2+
import {Icon} from "@ui";
3+
import {inject} from "vue";
4+
5+
const layout = inject('layout', {});
6+
const isMaxWidthEnabled = layout.isMaxWidthEnabled;
7+
const toggleMaxWidth = layout.toggleMaxWidth;
8+
</script>
9+
10+
<template>
11+
<button
12+
@click="toggleMaxWidth"
13+
:aria-label="isMaxWidthEnabled ? __('Expand Layout') : __('Constrain Layout')"
14+
v-tooltip="isMaxWidthEnabled ? __('Expand Layout') : __('Constrain Layout')"
15+
class="hidden [@media(min-width:1800px)]:inline-flex items-center justify-center whitespace-nowrap shrink-0 font-medium antialiased cursor-pointer no-underline disabled:text-white/60 dark:disabled:text-white/50 disabled:cursor-not-allowed [&_svg]:shrink-0 [&_svg]:text-gray-925 [&_svg]:opacity-60 dark:[&_svg]:text-white bg-transparent hover:bg-gray-400/10 text-gray-900 dark:text-gray-300 dark:hover:bg-white/15 dark:hover:text-gray-200 h-8 text-[0.8125rem] leading-tight rounded-lg px-0 gap-0 w-8 [&_svg]:size-4 -me-2 [&_svg]:text-white/85! will-change-transform"
16+
data-expand-layout-control
17+
>
18+
<Icon :name="isMaxWidthEnabled ? 'zoom-fit-screen' : 'fit-screen'" class="animate-pulse-on-appearance" />
19+
</button>
20+
</template>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script setup>
2+
import { Icon } from '@ui';
3+
import useStatamicPageProps from '@/composables/page-props.js';
4+
5+
const { supportUrl: url } = useStatamicPageProps();
6+
</script>
7+
8+
<template>
9+
<a
10+
v-if="url"
11+
:href="url"
12+
:aria-label="__('Support')"
13+
class="inline-flex items-center justify-center whitespace-nowrap shrink-0 font-medium antialiased cursor-pointer no-underline disabled:text-white/60 dark:disabled:text-white/50 disabled:cursor-not-allowed [&_svg]:shrink-0 [&_svg]:text-gray-925 [&_svg]:opacity-60 dark:[&_svg]:text-white bg-transparent hover:bg-gray-400/10 text-gray-900 dark:text-gray-300 dark:hover:bg-white/15 dark:hover:text-gray-200 h-8 text-[0.8125rem] leading-tight rounded-lg px-0 gap-0 w-8 [&_svg]:size-4 -me-2 [&_svg]:text-white/85! v-popper--has-tooltip"
14+
target="_blank"
15+
>
16+
<Icon name="support" />
17+
</a>
18+
</template>

src/Http/Middleware/CP/HandleAuthenticatedInertiaRequests.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ private function protectedProps()
5858
}
5959

6060
return [
61+
'supportUrl' => config('statamic.cp.support_url'),
6162
'selectedSiteUrl' => Site::selected()->url(),
6263
'licensing' => $this->licensing(),
6364
'sessionExpiry' => $this->sessionExpiry(),

0 commit comments

Comments
 (0)