| 1 |
import { useGlobalSyncStore } from '@help-center/state/globals-sync'; |
| 2 |
import { useActivityStore } from '@shared/state/activity'; |
| 3 |
import { Icon } from '@wordpress/components'; |
| 4 |
import { __, isRTL } from '@wordpress/i18n'; |
| 5 |
import { helpFilled } from '@wordpress/icons'; |
| 6 |
import classNames from 'classnames'; |
| 7 |
|
| 8 |
export const AdminBar = () => { |
| 9 |
const { setVisibility } = useGlobalSyncStore(); |
| 10 |
const { incrementActivity } = useActivityStore(); |
| 11 |
|
| 12 |
return ( |
| 13 |
<button |
| 14 |
type="button" |
| 15 |
data-test="help-center-adminbar-button" |
| 16 |
onClick={() => { |
| 17 |
setVisibility('open'); |
| 18 |
incrementActivity('hc-admin-bar-button'); |
| 19 |
}} |
| 20 |
className="m-1.5 -mt-1 inline-flex h-6 items-center justify-center gap-1 rounded-xs border-0 bg-wp-theme-main px-2 leading-extra-tight text-white ring-offset-1 ring-offset-wp-theme-bg focus:outline-hidden focus:ring-wp focus:ring-wp-theme-main" |
| 21 |
> |
| 22 |
{__('Help', 'extendify-local')} |
| 23 |
<Icon |
| 24 |
icon={helpFilled} |
| 25 |
width={18} |
| 26 |
height={18} |
| 27 |
className={classNames('fill-design-text', { |
| 28 |
'scale-x-[-1]': isRTL(), |
| 29 |
})} |
| 30 |
/> |
| 31 |
</button> |
| 32 |
); |
| 33 |
}; |
| 34 |
|