Commit f85fd09e authored by Robert Knight's avatar Robert Knight

Replace h-branding and h-tooltip Angular directive references

 - Replace `h-branding` with `applyTheme` utility

 - Replace `h-tooltip` with standard tooltips using the `title`
   attribute, which matches other icons in the top bar

 - Fix a double-quoted string after `<svg-icon>` in an Angular template
   was converted to `<SvgIcon ...>` in JSX
parent fd97febb
...@@ -4,6 +4,7 @@ const { Fragment, createElement } = require('preact'); ...@@ -4,6 +4,7 @@ const { Fragment, createElement } = require('preact');
const classnames = require('classnames'); const classnames = require('classnames');
const propTypes = require('prop-types'); const propTypes = require('prop-types');
const { applyTheme } = require('../util/theme');
const isThirdPartyService = require('../util/is-third-party-service'); const isThirdPartyService = require('../util/is-third-party-service');
const { withServices } = require('../util/service-context'); const { withServices } = require('../util/service-context');
...@@ -32,9 +33,8 @@ function TopBar({ ...@@ -32,9 +33,8 @@ function TopBar({
}) { }) {
const useCleanTheme = settings.theme === 'clean'; const useCleanTheme = settings.theme === 'clean';
const showSharePageButton = !isThirdPartyService(settings); const showSharePageButton = !isThirdPartyService(settings);
const loginLinkStyle = applyTheme(['accentColor'], settings);
// TODO - Replace `h-branding` directives.
// TODO - Replace `h-tooltip` directives.
// TODO - Simplify `SearchInput`'s `onSearch` prop type // TODO - Simplify `SearchInput`'s `onSearch` prop type
const loginControl = ( const loginControl = (
...@@ -42,16 +42,11 @@ function TopBar({ ...@@ -42,16 +42,11 @@ function TopBar({
{auth.status === 'unknown' && <span className="login-text"></span>} {auth.status === 'unknown' && <span className="login-text"></span>}
{auth.status === 'logged-out' && ( {auth.status === 'logged-out' && (
<span className="login-text"> <span className="login-text">
<a <a href="#" onClick={onSignUp} target="_blank" style={loginLinkStyle}>
href="#"
onClick={onSignUp}
target="_blank"
h-branding="accentColor"
>
Sign up Sign up
</a>{' '} </a>{' '}
/{' '} /{' '}
<a href="#" onClick={onLogin} h-branding="accentColor"> <a href="#" onClick={onLogin} style={loginLinkStyle}>
Log in Log in
</a> </a>
</span> </span>
...@@ -96,11 +91,9 @@ function TopBar({ ...@@ -96,11 +91,9 @@ function TopBar({
<a <a
className="top-bar__apply-update-btn" className="top-bar__apply-update-btn"
onClick={onApplyPendingUpdates} onClick={onApplyPendingUpdates}
h-tooltip title={`Show ${pendingUpdateCount} new/updated annotation(s)`}
tooltip-direction="up"
aria-label={`Show ${pendingUpdateCount} new/updated annotation(s)`}
> >
<SvgIcon className="top-bar__apply-icon" name="'refresh'" /> <SvgIcon className="top-bar__apply-icon" name="refresh" />
</a> </a>
)} )}
<SearchInput <SearchInput
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment