forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.tsx
More file actions
39 lines (34 loc) · 1.12 KB
/
button.tsx
File metadata and controls
39 lines (34 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
'use strict';
import * as React from 'react';
interface IButtonProps {
className: string;
tooltip: string;
disabled?: boolean;
hidden?: boolean;
onClick?(event?: React.MouseEvent<HTMLButtonElement>): void;
}
export class Button extends React.Component<IButtonProps> {
constructor(props: IButtonProps) {
super(props);
}
public render() {
const innerFilter = this.props.disabled ? 'button-inner-disabled-filter' : '';
const ariaDisabled = this.props.disabled ? 'true' : 'false';
return (
<button
role="button"
aria-pressed="false"
disabled={this.props.disabled}
aria-disabled={ariaDisabled}
title={this.props.tooltip}
aria-label={this.props.tooltip}
className={this.props.className}
onClick={this.props.onClick}
>
<span className={innerFilter}>{this.props.children}</span>
</button>
);
}
}