PluginProbe
Ultimate Store Kit / 3.1.2
Ultimate Store Kit v3.1.2
3.0.8 3.0.9 3.1.0 3.1.2 3.1.3 3.0.7 3.0.5 3.0.4 3.0.3 3.0.2 trunk 1.5.0 1.5.1 1.5.2 1.6.1 1.6.2 1.6.3 1.6.4 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 92 releases
ultimate-store-kit / src / admin / components / Header.js

Header.js in Ultimate Store Kit 3.1.2, at src/admin/components/Header.js

92 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from '@wordpress/i18n';
2 import { applyFilters } from '@wordpress/hooks';
3 import { btnPrimary, btnSm, btnSecondary } from '../tw';
4 import { CloseIcon, MenuIcon, StarIcon, SupportIcon, UskLogo } from '../icons';
5
6 const HELP_URL = 'https://bdthemes.com/support/';
7 const PRO_URL = 'https://storekit.pro/pricing/';
8
9 const Header = ({ version, isPro, onToggleSidebar, isSidebarOpen, isDesktop }) => {
10 return (
11 <div className="rounded-tl-lg rounded-tr-lg border-0 border-b border-solid border-b-gray-100 bg-white px-5 py-5">
12 <div className="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between">
13 <div className="flex min-w-0 items-center gap-3 sm:gap-4">
14 <div className="flex">
15 <UskLogo />
16 </div>
17 <div className="flex min-w-0 flex-col gap-1">
18 <div className="flex flex-wrap items-center gap-2">
19 <h1 className="m-0 text-lg font-bold leading-tight text-slate-800 sm:text-xl">
20 {__('Ultimate Store Kit', 'ultimate-store-kit')}
21 </h1>
22 {version ? (
23 <span className="rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-gray-500">
24 v{version}
25 </span>
26 ) : null}
27 </div>
28 <p className="m-0 max-w-xl text-[13px] leading-snug text-gray-500 sm:text-sm">
29 {__(
30 'Build high-converting WooCommerce stores with Elementor widgets & presets.',
31 'ultimate-store-kit'
32 )}
33 </p>
34 </div>
35 </div>
36 <div className="flex shrink-0 flex-wrap items-center gap-2">
37 <button
38 type="button"
39 onClick={(e) => onToggleSidebar?.(e)}
40 className="inline-flex h-9 w-9 cursor-pointer items-center justify-center rounded-md border border-slate-200 bg-white text-slate-700 transition-colors hover:border-uks-brand/40 hover:text-uks-brand"
41 style={{ display: isDesktop ? 'none' : 'inline-flex' }}
42 aria-expanded={isSidebarOpen ? 'true' : 'false'}
43 aria-label={__('Open menu', 'ultimate-store-kit')}
44 >
45 {isSidebarOpen ? (
46 <CloseIcon className="h-4 w-4" />
47 ) : (
48 <MenuIcon className="h-4 w-4" />
49 )}
50 </button>
51 {(() => {
52 // Hide "Get Pro" when pro plugin is installed (License page takes over)
53 const proPages = applyFilters('usk.admin.pages', {});
54 if (isPro || proPages.license) return null;
55 return (
56 <a
57 href={PRO_URL}
58 target="_blank"
59 rel="noopener noreferrer"
60 className={`${btnSm} ${btnPrimary}`}
61 >
62 <StarIcon className="w-4 h-4 block" />
63 {__('Get Pro', 'ultimate-store-kit')}
64 </a>
65 );
66 })()}
67 {(() => {
68 const HeaderExtra = applyFilters('usk.admin.headerExtra', null);
69 return HeaderExtra ? <HeaderExtra /> : null;
70 })()}
71 <a
72 href={HELP_URL}
73 target="_blank"
74 rel="noopener noreferrer"
75 className={`${btnSm} ${btnSecondary} flex items-center gap-2 hover:border-uks-brand/40 hover:bg-white hover:text-uks-brand`}
76 >
77 <span
78 className="flex h-4 w-4 items-center justify-center rounded-full border border-current text-inherit"
79 aria-hidden="true"
80 >
81 <SupportIcon className="w-4 h-4 block" />
82 </span>
83 {__('Help & Support', 'ultimate-store-kit')}
84 </a>
85 </div>
86 </div>
87 </div>
88 );
89 };
90
91 export default Header;
92