aboutsummaryrefslogtreecommitdiffstats
path: root/src/react/Tab.js
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2018-05-21 20:19:48 +0000
committerGerrit Code Review <gerrit@onap.org>2018-05-21 20:19:48 +0000
commit05b37297177e8a342668c15e5d6f738b51f7aedd (patch)
treee236c96df52a13f935292db8aa73e84d0c41ad8a /src/react/Tab.js
parent884dfb789593d2a3cc319047ab1f0215778aec9f (diff)
parent1994c98063c27a41797dec01f2ca9fcbe33ceab0 (diff)
Merge "init commit onap ui"2.0.0-ONAPbeijing2.0.0-ONAP
Diffstat (limited to 'src/react/Tab.js')
-rw-r--r--src/react/Tab.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/react/Tab.js b/src/react/Tab.js
new file mode 100644
index 0000000..5aa0f16
--- /dev/null
+++ b/src/react/Tab.js
@@ -0,0 +1,20 @@
+import React from 'react';
+
+class Tab extends React.Component {
+ render() {
+ const {activeTab, tabId, title, onClick, disabled, className = ''} = this.props;
+ const dataTestId = this.props['data-test-id'];
+ return (
+ <li
+ className={`sdc-tab ${activeTab === tabId ? 'sdc-tab-active' : ''} ${className}`}
+ onClick={!disabled && onClick}
+ data-test-id={dataTestId}
+ role='tab'
+ disabled={disabled}>
+ {title}
+ </li>
+ );
+ }
+}
+
+export default Tab;