border: 1px solid transparent;
border-top-color: var(--barBorderColor);
transition: padding 0s, border 0s;
+ max-width: 100%;
+ text-align: left;
}
-a.hotspot-item:focus {
+button.hotspot-item:focus {
color: var(--baseFontColor);
}
*/
import classNames from 'classnames';
import * as React from 'react';
+import { ButtonPlain } from '../../../components/controls/buttons';
import QualifierIcon from '../../../components/icons/QualifierIcon';
import LocationsList from '../../../components/locations/LocationsList';
import { ComponentQualifier } from '../../../types/component';
const path = getFilePath(hotspot.component, hotspot.project);
return (
- <a
+ <ButtonPlain
+ aria-current={selected}
className={classNames('hotspot-item', { highlight: selected })}
- href="#"
onClick={() => !selected && props.onClick(hotspot)}>
+ {/* This is not a real interaction it is only for scrolling */
+ /* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
<div
className={classNames('little-spacer-left text-bold', { 'cursor-pointer': selected })}
- onClick={selected ? () => props.onLocationClick() : undefined}
- role={selected ? 'button' : undefined}>
+ onClick={selected ? () => props.onLocationClick() : undefined}>
{hotspot.message}
</div>
<div className="display-flex-center big-spacer-top">
scroll={props.onScroll}
/>
)}
- </a>
+ </ButtonPlain>
);
}
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render correctly 1`] = `
-<a
+<ButtonPlain
+ aria-current={false}
className="hotspot-item"
- href="#"
onClick={[Function]}
>
<div
</bdi>
</div>
</div>
-</a>
+</ButtonPlain>
`;
exports[`should render correctly 2`] = `
-<a
+<ButtonPlain
+ aria-current={true}
className="hotspot-item highlight"
- href="#"
onClick={[Function]}
>
<div
className="little-spacer-left text-bold cursor-pointer"
onClick={[Function]}
- role="button"
>
'3' is a magic number.
</div>
onLocationSelect={[Function]}
scroll={[MockFunction]}
/>
-</a>
+</ButtonPlain>
`;