1 | import { __rest } from "tslib";
|
2 | import * as React from 'react';
|
3 | import styles from '@patternfly/react-styles/css/components/SkipToContent/skip-to-content';
|
4 | import buttonStyles from '@patternfly/react-styles/css/components/Button/button';
|
5 | import { css } from '@patternfly/react-styles';
|
6 | export class SkipToContent extends React.Component {
|
7 | constructor() {
|
8 | super(...arguments);
|
9 | this.componentRef = React.createRef();
|
10 | }
|
11 | componentDidMount() {
|
12 | if (this.props.show && this.componentRef.current) {
|
13 | this.componentRef.current.focus();
|
14 | }
|
15 | }
|
16 | render() {
|
17 |
|
18 | const _a = this.props, { children, className, href, show, type } = _a, rest = __rest(_a, ["children", "className", "href", "show", "type"]);
|
19 | return (React.createElement("a", Object.assign({}, rest, { className: css(buttonStyles.button, buttonStyles.modifiers.primary, styles.skipToContent, className), ref: this.componentRef, href: href }), children));
|
20 | }
|
21 | }
|
22 | SkipToContent.displayName = 'SkipToContent';
|
23 | SkipToContent.defaultProps = {
|
24 | show: false
|
25 | };
|
26 |
|
\ | No newline at end of file |